class DefaultTestInstanceFactoryContext extends java.lang.Object implements TestInstanceFactoryContext
TestInstanceFactoryContext
API.Modifier and Type | Field and Description |
---|---|
private java.util.Optional<java.lang.Object> |
outerInstance |
private java.lang.Class<?> |
testClass |
Constructor and Description |
---|
DefaultTestInstanceFactoryContext(java.lang.Class<?> testClass,
java.util.Optional<java.lang.Object> outerInstance) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.Object> |
getOuterInstance()
Get the instance of the outer class, if available.
|
java.lang.Class<?> |
getTestClass()
Get the test class for this context.
|
java.lang.String |
toString() |
private final java.lang.Class<?> testClass
private final java.util.Optional<java.lang.Object> outerInstance
DefaultTestInstanceFactoryContext(java.lang.Class<?> testClass, java.util.Optional<java.lang.Object> outerInstance)
public java.lang.Class<?> getTestClass()
TestInstanceFactoryContext
getTestClass
in interface TestInstanceFactoryContext
null
public java.util.Optional<java.lang.Object> getOuterInstance()
TestInstanceFactoryContext
The returned Optional
will be empty unless the
current test class is a
@Nested
test class.
getOuterInstance
in interface TestInstanceFactoryContext
Optional
containing the outer test instance; never
null
but potentially emptyNested
public java.lang.String toString()
toString
in class java.lang.Object