@Requires(classes={org.springframework.transaction.PlatformTransactionManager.class,io.micronaut.test.extensions.AbstractMicronautExtension.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 io.micronaut.test.context.TestExecutionListener
| Constructor and Description |
|---|
SpringTransactionTestExecutionListener(org.springframework.transaction.PlatformTransactionManager transactionManager,
boolean rollback,
io.micronaut.test.annotation.TransactionMode transactionMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCleanupTest(io.micronaut.test.context.TestContext testContext) |
void |
afterSetupTest(io.micronaut.test.context.TestContext testContext) |
void |
afterTestExecution(io.micronaut.test.context.TestContext testContext) |
void |
beforeCleanupTest(io.micronaut.test.context.TestContext testContext) |
void |
beforeSetupTest(io.micronaut.test.context.TestContext testContext) |
void |
beforeTestExecution(io.micronaut.test.context.TestContext testContext) |
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")
io.micronaut.test.annotation.TransactionMode transactionMode)
transactionManager - Spring's PlatformTransactionManagerrollback - true if the transaction should be rollbacktransactionMode - TransactionMode to use for each testpublic void beforeSetupTest(io.micronaut.test.context.TestContext testContext)
beforeSetupTest in interface io.micronaut.test.context.TestExecutionListenerpublic void afterSetupTest(io.micronaut.test.context.TestContext testContext)
afterSetupTest in interface io.micronaut.test.context.TestExecutionListenerpublic void beforeCleanupTest(io.micronaut.test.context.TestContext testContext)
throws java.lang.Exception
beforeCleanupTest in interface io.micronaut.test.context.TestExecutionListenerjava.lang.Exceptionpublic void afterCleanupTest(io.micronaut.test.context.TestContext testContext)
throws java.lang.Exception
afterCleanupTest in interface io.micronaut.test.context.TestExecutionListenerjava.lang.Exceptionpublic void afterTestExecution(io.micronaut.test.context.TestContext testContext)
afterTestExecution in interface io.micronaut.test.context.TestExecutionListenerpublic void beforeTestExecution(io.micronaut.test.context.TestContext testContext)
beforeTestExecution in interface io.micronaut.test.context.TestExecutionListener