Package org.junit.jupiter.api.extension
Interface TestInstanceFactoryContext
-
@API(status=EXPERIMENTAL, since="5.3") public interface TestInstanceFactoryContext
TestInstanceFactoryContextencapsulates the context in which a test class is to be instantiated by aTestInstanceFactory.- Since:
- 5.3
- See Also:
TestInstanceFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Object>getOuterInstance()Get the instance of the outer class, if available.Class<?>getTestClass()Get the test class for this context.
-
-
-
Method Detail
-
getTestClass
Class<?> getTestClass()
Get the test class for this context.- Returns:
- the test class to be instantiated; never
null
-
getOuterInstance
Optional<Object> getOuterInstance()
Get the instance of the outer class, if available.The returned
Optionalwill be empty unless the current test class is a@Nestedtest class.- Returns:
- an
Optionalcontaining the outer test instance; nevernullbut potentially empty - See Also:
Nested
-
-