Package io.micronaut.transaction.test
Class DefaultTestTransactionExecutionListener
java.lang.Object
io.micronaut.transaction.test.DefaultTestTransactionExecutionListener
- All Implemented Interfaces:
io.micronaut.test.context.TestExecutionListener
,io.micronaut.test.context.TestMethodInterceptor<Object>
@EachBean(TransactionOperations.class)
@Requires(classes=io.micronaut.test.context.TestExecutionListener.class) @Requires(property="micronaut.test.transactional",value="true",defaultValue="true")
@Replaces(io.micronaut.spring.tx.test.SpringTransactionTestExecutionListener.class)
@Internal
public class DefaultTestTransactionExecutionListener
extends Object
implements io.micronaut.test.context.TestExecutionListener, io.micronaut.test.context.TestMethodInterceptor<Object>
Adds support for MicronautTest transactional handling.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultTestTransactionExecutionListener
(TransactionOperations<Object> transactionManager, boolean rollback, io.micronaut.test.annotation.TransactionMode transactionMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) interceptAfterEach
(io.micronaut.test.context.TestMethodInvocationContext<Object> methodInvocationContext) interceptBeforeEach
(io.micronaut.test.context.TestMethodInvocationContext<Object> methodInvocationContext) interceptTest
(io.micronaut.test.context.TestMethodInvocationContext<Object> methodInvocationContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.test.context.TestExecutionListener
afterTestClass, afterTestMethod, beforeTestClass, beforeTestMethod
-
Constructor Details
-
DefaultTestTransactionExecutionListener
protected DefaultTestTransactionExecutionListener(TransactionOperations<Object> 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) - Parameters:
transactionManager
- The transaction managerrollback
-true
if the transaction should be rollbacktransactionMode
- The transaction mode
-
-
Method Details
-
interceptTest
-
interceptBeforeEach
-
interceptAfterEach
-
beforeSetupTest
public void beforeSetupTest(io.micronaut.test.context.TestContext testContext) - Specified by:
beforeSetupTest
in interfaceio.micronaut.test.context.TestExecutionListener
-
afterSetupTest
public void afterSetupTest(io.micronaut.test.context.TestContext testContext) - Specified by:
afterSetupTest
in interfaceio.micronaut.test.context.TestExecutionListener
-
beforeCleanupTest
public void beforeCleanupTest(io.micronaut.test.context.TestContext testContext) - Specified by:
beforeCleanupTest
in interfaceio.micronaut.test.context.TestExecutionListener
-
afterCleanupTest
public void afterCleanupTest(io.micronaut.test.context.TestContext testContext) - Specified by:
afterCleanupTest
in interfaceio.micronaut.test.context.TestExecutionListener
-
afterTestExecution
public void afterTestExecution(io.micronaut.test.context.TestContext testContext) - Specified by:
afterTestExecution
in interfaceio.micronaut.test.context.TestExecutionListener
-
beforeTestExecution
public void beforeTestExecution(io.micronaut.test.context.TestContext testContext) - Specified by:
beforeTestExecution
in interfaceio.micronaut.test.context.TestExecutionListener
-