@Requires(classes=org.springframework.transaction.PlatformTransactionManager.class) @Requires(property="micronaut.test.transactional",value="true",defaultValue="true") @EachBean(value=org.springframework.transaction.PlatformTransactionManager.class) public class SpringTransactionTestExecutionListener extends java.lang.Object implements TestExecutionListener
Constructor and Description |
---|
SpringTransactionTestExecutionListener(org.springframework.transaction.PlatformTransactionManager transactionManager,
boolean rollback,
TransactionMode transactionMode) |
Modifier and Type | Method and Description |
---|---|
void |
afterCleanupTest(TestContext testContext)
Executed after the setup method of a test method.
|
void |
afterSetupTest(TestContext testContext)
Executed after the setup method of a test method.
|
void |
afterTestExecution(TestContext testContext)
Executed after a single test iteration has been executed .
|
void |
beforeCleanupTest(TestContext testContext)
Executed before the setup method of a test method.
|
void |
beforeSetupTest(TestContext testContext)
Executed before the setup method of a test method.
|
void |
beforeTestExecution(TestContext testContext)
Executed before a single test iteration is executed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterTestClass, afterTestMethod, beforeTestClass, beforeTestMethod
public SpringTransactionTestExecutionListener(org.springframework.transaction.PlatformTransactionManager transactionManager, @Property(name="micronaut.test.rollback",defaultValue="true") boolean rollback, @Property(name="micronaut.test.transaction-mode",defaultValue="SEPARATE_TRANSACTIONS") TransactionMode transactionMode)
transactionManager
- Spring's PlatformTransactionManager
rollback
- true
if the transaction should be rollbacktransactionMode
- TransactionMode
to use for each testpublic void beforeSetupTest(TestContext testContext)
TestExecutionListener
beforeSetupTest
in interface TestExecutionListener
testContext
- the test contextpublic void afterSetupTest(TestContext testContext)
TestExecutionListener
afterSetupTest
in interface TestExecutionListener
testContext
- the test contextpublic void beforeCleanupTest(TestContext testContext) throws java.lang.Exception
TestExecutionListener
beforeCleanupTest
in interface TestExecutionListener
testContext
- the test contextjava.lang.Exception
- allows any exception to propagatepublic void afterCleanupTest(TestContext testContext) throws java.lang.Exception
TestExecutionListener
afterCleanupTest
in interface TestExecutionListener
testContext
- the test contextjava.lang.Exception
- allows any exception to propagatepublic void afterTestExecution(TestContext testContext)
TestExecutionListener
afterTestExecution
in interface TestExecutionListener
testContext
- the test contextpublic void beforeTestExecution(TestContext testContext)
TestExecutionListener
beforeTestExecution
in interface TestExecutionListener
testContext
- the test context