Top Constructors Methods
org.junit.jupiter.params

pack-priv Class ParameterizedTestSpiInstantiator

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, org.junit.jupiter.api.extension.ExtensionContext, org.junit.platform.commons.JUnitException, org.junit.platform.commons.util.Preconditions, .ReflectionUtils

Since
5.12

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private 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)

pack-priv static <T> T
instantiate(Class<T> spiInterface, Class<? extends T> implementationClass, ExtensionContext extensionContext)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ParameterizedTestSpiInstantiatorback to summary
private ParameterizedTestSpiInstantiator()

Method Detail

findBestConstructorback to summary
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.

findConstructorback to summary
private static <T> Constructor<? extends T> findConstructor(Class<T> spiInterface, Class<? extends T> implementationClass)
Annotations
@SuppressWarnings:unchecked
instantiateback to summary
pack-priv static <T> T instantiate(Class<T> spiInterface, Class<? extends T> implementationClass, ExtensionContext extensionContext)