Interface TestInstanceFactoryContext


  • @API(status=EXPERIMENTAL,
         since="5.3")
    public interface TestInstanceFactoryContext
    TestInstanceFactoryContext encapsulates the context in which a test class is to be instantiated by a TestInstanceFactory.
    Since:
    5.3
    See Also:
    TestInstanceFactory
    • Method Detail

      • getTestClass

        java.lang.Class<?> getTestClass()
        Get the test class for this context.
        Returns:
        the test class to be instantiated; never null
      • getOuterInstance

        java.util.Optional<java.lang.Object> getOuterInstance()
        Get the instance of the outer class, if available.

        The returned Optional will be empty unless the current test class is a @Nested test class.

        Returns:
        an Optional containing the outer test instance; never null but potentially empty
        See Also:
        Nested