Package org.axonframework.test.aggregate
Class StubAggregateLifecycleExtension
java.lang.Object
org.axonframework.messaging.Scope
org.axonframework.modelling.command.AggregateLifecycle
org.axonframework.test.aggregate.StubAggregateLifecycle
org.axonframework.test.aggregate.StubAggregateLifecycleExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
public class StubAggregateLifecycleExtension
extends StubAggregateLifecycle
implements org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeEachCallback
Implementation of
StubAggregateLifecycle that can be used as an RegisterExtension
annotated method or field in a test class. In that case, the JUnit lifecycle will automatically register and
deregister the StubAggregateLifecycle.
Usage example:
@RegisterExtension
public StubAggregateLifecycleExtension lifecycle = new StubAggregateLifecycleExtension();
@Test
public void testMethod() {
... perform tests ...
// get applied events from lifecycle to validate some more
lifecycle.getAppliedEvents();
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Methods inherited from class org.axonframework.test.aggregate.StubAggregateLifecycle
activate, close, doApply, doCreateNew, doMarkDeleted, getAppliedEventPayloads, getAppliedEvents, getIsLive, identifier, isMarkedDeleted, type, versionMethods inherited from class org.axonframework.modelling.command.AggregateLifecycle
apply, apply, createNew, describeScope, execute, getInstance, getVersion, isLive, markDeletedMethods inherited from class org.axonframework.messaging.Scope
describeCurrentScope, endScope, executeWithResult, getCurrentScope, startScope
-
Constructor Details
-
StubAggregateLifecycleExtension
public StubAggregateLifecycleExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback- Throws:
Exception
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception - Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback- Throws:
Exception
-