Class ParameterizedTestSpiInstantiator

java.lang.Object
org.junit.jupiter.params.ParameterizedTestSpiInstantiator

class ParameterizedTestSpiInstantiator extends Object
Since:
5.12
  • Constructor Details

    • ParameterizedTestSpiInstantiator

      ParameterizedTestSpiInstantiator()
  • Method Details

    • instantiate

      static <T> T instantiate(Class<T> spiInterface, Class<? extends T> implementationClass, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    • findConstructor

      private static <T> Constructor<? extends T> findConstructor(Class<T> spiInterface, Class<? extends T> implementationClass)
    • findBestConstructor

      private static <T> Constructor<?> findBestConstructor(Class<T> spiInterface, Class<? extends T> implementationClass)
      Find the "best" constructor for the supplied implementation class.

      For backward compatibility, it first checks for a single constructor and returns that. If there are multiple constructors, it checks for a default constructor which takes precedence over any other constructors. Otherwise, this method throws an exception stating that it failed to find a suitable constructor.