Class ParameterizedTestSpiInstantiator
java.lang.Object
org.junit.jupiter.params.ParameterizedTestSpiInstantiator
- Since:
- 5.12
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> Constructor<?> findBestConstructor(Class<T> spiInterface, Class<? extends T> implementationClass) Find the "best" constructor for the supplied implementation class.private static <T> Constructor<? extends T> findConstructor(Class<T> spiInterface, Class<? extends T> implementationClass) (package private) static <T> Tinstantiate(Class<T> spiInterface, Class<? extends T> implementationClass, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
-
Constructor Details
-
ParameterizedTestSpiInstantiator
ParameterizedTestSpiInstantiator()
-
-
Method Details
-
instantiate
-
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.
-