Package io.micronaut.test.context
Class TestContext
java.lang.Object
io.micronaut.test.context.TestContext
Test context used by
TestExecutionListener
s.- Since:
- 1.2
- Author:
- bidorffOL
-
Constructor Summary
ConstructorDescriptionTestContext
(io.micronaut.context.ApplicationContext applicationContext, Class<?> testClass, AnnotatedElement testMethod, Object testInstance, Throwable testException, String testName, boolean supportsTestMethodInterceptors) -
Method Summary
-
Constructor Details
-
TestContext
public TestContext(io.micronaut.context.ApplicationContext applicationContext, Class<?> testClass, AnnotatedElement testMethod, Object testInstance, Throwable testException, String testName, boolean supportsTestMethodInterceptors) - Parameters:
applicationContext
- The application contexttestClass
- The test classtestMethod
- The test methodtestInstance
- The test instancetestException
- The exception thrown by the test executiontestName
- The test namesupportsTestMethodInterceptors
- The indicator if the test framework supportsTestMethodInterceptor
.
-
-
Method Details
-
getApplicationContext
public io.micronaut.context.ApplicationContext getApplicationContext()- Returns:
- The application context
-
getTestClass
- Returns:
- The test class
-
getTestException
- Returns:
- The test instance
-
getTestMethod
- Returns:
- The test method
-
getTestInstance
- Returns:
- The exception thrown by the test execution
-
getTestName
- Returns:
- The test name
-
isSupportsTestMethodInterceptors
public boolean isSupportsTestMethodInterceptors()- Returns:
- True if
TestMethodInterceptor
is supported
-