Package org.axonframework.test.saga
Class FixtureExecutionResultImpl<T>
java.lang.Object
org.axonframework.test.saga.FixtureExecutionResultImpl<T>
- All Implemented Interfaces:
FixtureExecutionResult
Default implementation of FixtureExecutionResult.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionexpectActiveSagas(int expected) Expect the given number of Sagas to be active (i.e. ready to respond to incoming events.expectAssociationWith(String associationKey, Object associationValue) Asserts that at least one of the active sagas is associated with the givenassociationKeyandassociationValue.expectDeadlinesMet(Object... expected) Asserts that givenexpecteddeadlines have been met (which have passed in time).expectDeadlinesMetMatching(org.hamcrest.Matcher<? extends List<? super DeadlineMessage<?>>> matcher) Asserts that deadlines match givenmatcherhave been met (which have passed in time) on this saga.expectDispatchedCommands(Object... expected) Asserts that the given commands have been dispatched in exactly the order given.expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends List<? super CommandMessage<?>>> matcher) Asserts that the sagas dispatched commands as defined by the givenmatcher.expectNoAssociationWith(String associationKey, Object associationValue) Asserts that at none of the active sagas is associated with the givenassociationKeyandassociationValue.Asserts that the sagas did not dispatch any commands.expectNoScheduledDeadline(Duration durationToScheduledTime, Object deadline) Asserts that no deadline equal to the givendeadlinehas been scheduled after the givendurationToScheduledTime.expectNoScheduledDeadline(Instant scheduledTime, Object deadline) Asserts that no deadline equal to the givendeadlinehas been scheduled at the givenscheduledTime.expectNoScheduledDeadline(Instant from, Instant to, Object deadline) Asserts that no deadline equal to the givendeadlinehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive.expectNoScheduledDeadlineMatching(Duration durationToScheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that no deadline matching the givenmatchershould be scheduled after the givendurationToScheduledTime.expectNoScheduledDeadlineMatching(Instant from, Instant to, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that no deadline matching the givenmatcherhas been scheduled between thetoandfromtimes, wheretoandfromare inclusive.expectNoScheduledDeadlineMatching(Instant scheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that no deadline matching the givenmatcherhas been scheduled at the givenscheduledTime.expectNoScheduledDeadlineMatching(org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that no deadline matching the givenmatcheris scheduled.expectNoScheduledDeadlineOfType(Duration durationToScheduledTime, Class<?> deadlineType) Asserts that no deadline of the givendeadlineTypehas been scheduled at the givendurationToScheduledTime.expectNoScheduledDeadlineOfType(Instant scheduledTime, Class<?> deadlineType) Asserts that no deadline with the givendeadlineTypehas been scheduled at the givenscheduledTime.expectNoScheduledDeadlineOfType(Instant from, Instant to, Class<?> deadlineType) Asserts that no deadline with the givendeadlineTypehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive.Asserts that no deadlines are scheduled.expectNoScheduledDeadlineWithName(Duration durationToScheduledTime, String deadlineName) Asserts that no deadline with the givendeadlineNamehas been scheduled after the givendurationToScheduledTime.expectNoScheduledDeadlineWithName(Instant scheduledTime, String deadlineName) Asserts that no deadline with the givendeadlineNamehas been scheduled at the givenscheduledTime.expectNoScheduledDeadlineWithName(Instant from, Instant to, String deadlineName) Asserts that no deadline with the givendeadlineNamehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive.expectNoScheduledEvent(Duration durationToScheduledTime, Object event) Asserts that no event equal to the giveneventhas been scheduled after the givendurationToScheduledTime.expectNoScheduledEvent(Instant scheduledTime, Object event) Asserts that no event equal to the giveneventhas been scheduled at the givenscheduledTime.expectNoScheduledEventMatching(Duration durationToScheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Asserts that no event matching the givenmatcherhas been scheduled to be published after the givendurationToScheduledTime.expectNoScheduledEventMatching(Instant scheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Asserts that no event matching the givenmatcherhas been scheduled at the givenscheduledTime.expectNoScheduledEventOfType(Duration durationToScheduledTime, Class<?> eventType) Asserts that no event of the giveneventTypehas been scheduled after the givendurationToScheduledTime.expectNoScheduledEventOfType(Instant scheduledTime, Class<?> eventType) Asserts that no event with the giveneventTypehas been scheduled at the givenscheduledTime.Assert that no events are scheduled for publication.expectPublishedEvents(Object... expected) Assert that the saga published events on the EventBus in the exact sequence of the givenexpectedevents.expectPublishedEventsMatching(org.hamcrest.Matcher<? extends List<? super EventMessage<?>>> matcher) Assert that the saga published events on the EventBus as defined by the givenmatcher.expectScheduledDeadline(Duration duration, Object deadline) Asserts that a deadline equal to the givendeadlinehas been scheduled after the givenduration.expectScheduledDeadline(Instant scheduledTime, Object deadline) Asserts that a deadline equal to the givendeadlinehas been scheduled at the givenscheduledTime.expectScheduledDeadlineMatching(Duration duration, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that a deadline scheduled after givendurationmatches the givenmatcher.expectScheduledDeadlineMatching(Instant scheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Asserts that a deadline matching the givenmatcherhas been scheduled at the givenscheduledTime.expectScheduledDeadlineOfType(Duration duration, Class<?> deadlineType) Asserts that a deadline of the givendeadlineTypehas been scheduled after the givenduration.expectScheduledDeadlineOfType(Instant scheduledTime, Class<?> deadlineType) Asserts that a deadline of the givendeadlineTypehas been scheduled at the givenscheduledTime.expectScheduledDeadlineWithName(Duration duration, String deadlineName) Asserts that a deadline with the givendeadlineNamehas been scheduled after the givenduration.expectScheduledDeadlineWithName(Instant scheduledTime, String deadlineName) Asserts that a deadline with the givendeadlineNamehas been scheduled at the givenscheduledTime.expectScheduledEvent(Duration duration, Object applicationEvent) Asserts that an event equal to the giveneventhas been scheduled for publication after the givenduration.expectScheduledEvent(Instant scheduledTime, Object applicationEvent) Asserts that an event equal to the giveneventhas been scheduled for publication at the givenscheduledTime.expectScheduledEventMatching(Duration duration, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Asserts that an event matching the givenmatcherhas been scheduled to be published after the givenduration.expectScheduledEventMatching(Instant scheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Asserts that an event matching the givenmatcherhas been scheduled to be published at the givenscheduledTime.expectScheduledEventOfType(Duration duration, Class<?> eventType) Asserts that an event of the giveneventTypehas been scheduled for publication after the givenduration.expectScheduledEventOfType(Instant scheduledTime, Class<?> eventType) Asserts that an event of the giveneventTypehas been scheduled for publication at the givenscheduledTime.Expect a successful execution of the given event handler.expectTriggeredDeadlines(Object... expected) Asserts that givenexpecteddeadlines have been triggered.expectTriggeredDeadlinesMatching(org.hamcrest.Matcher<? extends List<? super DeadlineMessage<?>>> matcher) Asserts that deadlines matching the givenmatcherhave been triggered for this aggregate.expectTriggeredDeadlinesOfType(Class<?>... expectedDeadlineTypes) Asserts that the givenexpectedDeadlineTypeshave been triggered.expectTriggeredDeadlinesWithName(String... expectedDeadlineNames) Asserts that the givenexpectedDeadlineNameshave been triggered.voidregisterStartRecordingCallback(Runnable onStartRecordingCallback) Registers a callback to be invoked when the fixture execution starts recording.voidTells this class to start monitoring activity in infrastructure classes.
-
Method Details
-
registerStartRecordingCallback
Registers a callback to be invoked when the fixture execution starts recording. This happens right before invocation of the 'when' step (stimulus) of the fixture. Use this to manage Saga dependencies which are not an Axon first class citizen, but do require monitoring of their interactions. For example, register the callback to set a mock in recording mode.- Parameters:
onStartRecordingCallback- callback to invoke
-
startRecording
public void startRecording()Tells this class to start monitoring activity in infrastructure classes. -
expectActiveSagas
Description copied from interface:FixtureExecutionResultExpect the given number of Sagas to be active (i.e. ready to respond to incoming events.- Specified by:
expectActiveSagasin interfaceFixtureExecutionResult- Parameters:
expected- the expected number of active events in the repository- Returns:
- the FixtureExecutionResult for method chaining
-
expectAssociationWith
Description copied from interface:FixtureExecutionResultAsserts that at least one of the active sagas is associated with the givenassociationKeyandassociationValue.- Specified by:
expectAssociationWithin interfaceFixtureExecutionResult- Parameters:
associationKey- The key of the association to verifyassociationValue- The value of the association to verify- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoAssociationWith
public FixtureExecutionResult expectNoAssociationWith(String associationKey, Object associationValue) Description copied from interface:FixtureExecutionResultAsserts that at none of the active sagas is associated with the givenassociationKeyandassociationValue.- Specified by:
expectNoAssociationWithin interfaceFixtureExecutionResult- Parameters:
associationKey- The key of the association to verifyassociationValue- The value of the association to verify- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEventMatching
public FixtureExecutionResult expectScheduledEventMatching(Duration duration, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that an event matching the givenmatcherhas been scheduled to be published after the givenduration.- Specified by:
expectScheduledEventMatchingin interfaceFixtureExecutionResult- Parameters:
duration- The time to wait before the event should be publishedmatcher- A matcher defining the event expected to be published- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineMatching
public FixtureExecutionResult expectScheduledDeadlineMatching(Duration duration, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that a deadline scheduled after givendurationmatches the givenmatcher.- Specified by:
expectScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
duration- The delay expected before the deadline is metmatcher- The matcher that must match with the deadline scheduled at the given time- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEvent
Description copied from interface:FixtureExecutionResultAsserts that an event equal to the giveneventhas been scheduled for publication after the givenduration. Note that the source attribute of the event is ignored when comparing events. Events are compared using an "equals" check on all fields in the events.- Specified by:
expectScheduledEventin interfaceFixtureExecutionResult- Parameters:
duration- The time to wait before the event should be publishedapplicationEvent- The expected event- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadline
Description copied from interface:FixtureExecutionResultAsserts that a deadline equal to the givendeadlinehas been scheduled after the givenduration. Note that the source attribute of the deadline is ignored when comparing deadlines. Deadlines are compared using an "equals" check on all fields in the deadlines.- Specified by:
expectScheduledDeadlinein interfaceFixtureExecutionResult- Parameters:
duration- The time to wait before the deadline should be metdeadline- The expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEventOfType
Description copied from interface:FixtureExecutionResultAsserts that an event of the giveneventTypehas been scheduled for publication after the givenduration.- Specified by:
expectScheduledEventOfTypein interfaceFixtureExecutionResult- Parameters:
duration- The time to wait before the event should be publishedeventType- The type of the expected event- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineOfType
public FixtureExecutionResult expectScheduledDeadlineOfType(Duration duration, Class<?> deadlineType) Description copied from interface:FixtureExecutionResultAsserts that a deadline of the givendeadlineTypehas been scheduled after the givenduration.- Specified by:
expectScheduledDeadlineOfTypein interfaceFixtureExecutionResult- Parameters:
duration- The time to wait before the deadline is metdeadlineType- The type of the expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineWithName
public FixtureExecutionResult expectScheduledDeadlineWithName(Duration duration, String deadlineName) Description copied from interface:FixtureExecutionResultAsserts that a deadline with the givendeadlineNamehas been scheduled after the givenduration.- Specified by:
expectScheduledDeadlineWithNamein interfaceFixtureExecutionResult- Parameters:
duration- the time to wait before the deadline is metdeadlineName- the name of the expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEventMatching
public FixtureExecutionResult expectScheduledEventMatching(Instant scheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that an event matching the givenmatcherhas been scheduled to be published at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theFixtureConfiguration.currentTime()to get the time to use as "current time".- Specified by:
expectScheduledEventMatchingin interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the event should be publishedmatcher- A matcher defining the event expected to be published- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineMatching
public FixtureExecutionResult expectScheduledDeadlineMatching(Instant scheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that a deadline matching the givenmatcherhas been scheduled at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theFixtureConfiguration.currentTime()to get the time to use as "current time".- Specified by:
expectScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the deadline should be metmatcher- The matcher defining the deadline expected- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEvent
Description copied from interface:FixtureExecutionResultAsserts that an event equal to the giveneventhas been scheduled for publication at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theFixtureConfiguration.currentTime()to get the time to use as "current time". Note that the source attribute of the event is ignored when comparing events. Events are compared using an "equals" check on all fields in the events.- Specified by:
expectScheduledEventin interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the event should be publishedapplicationEvent- The expected event- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadline
Description copied from interface:FixtureExecutionResultAsserts that a deadline equal to the givendeadlinehas been scheduled at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theFixtureConfiguration.currentTime()to get the time to use as "current time". Note that the source attribute of the deadline is ignored when comparing deadlines. Deadlines are compared using an "equals" check on all fields in the deadlines.- Specified by:
expectScheduledDeadlinein interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the deadline is scheduleddeadline- The expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledEventOfType
Description copied from interface:FixtureExecutionResultAsserts that an event of the giveneventTypehas been scheduled for publication at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theFixtureConfiguration.currentTime()to get the time to use as "current time".- Specified by:
expectScheduledEventOfTypein interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the event should be publishedeventType- The type of the expected event- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineOfType
public FixtureExecutionResult expectScheduledDeadlineOfType(Instant scheduledTime, Class<?> deadlineType) Description copied from interface:FixtureExecutionResultAsserts that a deadline of the givendeadlineTypehas been scheduled at the givenscheduledTime.- Specified by:
expectScheduledDeadlineOfTypein interfaceFixtureExecutionResult- Parameters:
scheduledTime- The time at which the deadline is scheduleddeadlineType- The type of the expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectScheduledDeadlineWithName
public FixtureExecutionResult expectScheduledDeadlineWithName(Instant scheduledTime, String deadlineName) Description copied from interface:FixtureExecutionResultAsserts that a deadline with the givendeadlineNamehas been scheduled at the givenscheduledTime.- Specified by:
expectScheduledDeadlineWithNamein interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which the deadline is scheduleddeadlineName- the name of the expected deadline- Returns:
- the FixtureExecutionResult for method chaining
-
expectDispatchedCommands
Description copied from interface:FixtureExecutionResultAsserts that the given commands have been dispatched in exactly the order given. The command objects are compared using the equals method. Only commands as a result of the event in the "when" stage of the fixture are compared.If exact order doesn't matter, or the validation needs be done in another way than "equal payload", consider using
FixtureExecutionResult.expectDispatchedCommandsMatching(Matcher)instead.- Specified by:
expectDispatchedCommandsin interfaceFixtureExecutionResult- Parameters:
expected- The expected commands- Returns:
- the FixtureExecutionResult for method chaining
-
expectDispatchedCommandsMatching
public FixtureExecutionResult expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends List<? super CommandMessage<?>>> matcher) Description copied from interface:FixtureExecutionResultAsserts that the sagas dispatched commands as defined by the givenmatcher. Only commands as a result of the event in the "when" stage of the fixture are matched.- Specified by:
expectDispatchedCommandsMatchingin interfaceFixtureExecutionResult- Parameters:
matcher- The matcher that describes the expected list of commands- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoDispatchedCommands
Description copied from interface:FixtureExecutionResultAsserts that the sagas did not dispatch any commands. Only commands as a result of the event in the "when" stage of ths fixture are recorded.- Specified by:
expectNoDispatchedCommandsin interfaceFixtureExecutionResult- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEvents
Description copied from interface:FixtureExecutionResultAssert that no events are scheduled for publication. This means that either no events were scheduled at all, all schedules have been cancelled or all scheduled events have been published already.- Specified by:
expectNoScheduledEventsin interfaceFixtureExecutionResult- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEventMatching
public FixtureExecutionResult expectNoScheduledEventMatching(Duration durationToScheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no event matching the givenmatcherhas been scheduled to be published after the givendurationToScheduledTime.- Specified by:
expectNoScheduledEventMatchingin interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the event which should not be scheduledmatcher- the matcher defining the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEvent
public FixtureExecutionResult expectNoScheduledEvent(Duration durationToScheduledTime, Object event) Description copied from interface:FixtureExecutionResultAsserts that no event equal to the giveneventhas been scheduled after the givendurationToScheduledTime. Note that the source attribute of the event is ignored when comparing events. Events are compared using an "equals" check on all fields in the events.- Specified by:
expectNoScheduledEventin interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the event which should not be scheduledevent- the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEventOfType
public FixtureExecutionResult expectNoScheduledEventOfType(Duration durationToScheduledTime, Class<?> eventType) Description copied from interface:FixtureExecutionResultAsserts that no event of the giveneventTypehas been scheduled after the givendurationToScheduledTime.- Specified by:
expectNoScheduledEventOfTypein interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the event which should not be scheduledeventType- the type of the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEventMatching
public FixtureExecutionResult expectNoScheduledEventMatching(Instant scheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no event matching the givenmatcherhas been scheduled at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theTestExecutor.currentTime()to get the time to use as "current time".- Specified by:
expectNoScheduledEventMatchingin interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no event matching the givenmatchershould be scheduledmatcher- the matcher defining the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEvent
Description copied from interface:FixtureExecutionResultAsserts that no event equal to the giveneventhas been scheduled at the givenscheduledTime. If thescheduledTimeis calculated based on the "current time", use theTestExecutor.currentTime()to get the time to use as "current time". Note that the source attribute of the event is ignored when comparing events. Events are compared using an "equals" check on all fields in the events.- Specified by:
expectNoScheduledEventin interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no event equal to the giveneventshould be scheduledevent- the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledEventOfType
public FixtureExecutionResult expectNoScheduledEventOfType(Instant scheduledTime, Class<?> eventType) Description copied from interface:FixtureExecutionResultAsserts that no event with the giveneventTypehas been scheduled at the givenscheduledTime.- Specified by:
expectNoScheduledEventOfTypein interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no event ofeventTypeshould be scheduledeventType- the type of the event which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlines
Description copied from interface:FixtureExecutionResultAsserts that no deadlines are scheduled. This means that either no deadlines were scheduled at all, all schedules have been cancelled or all scheduled deadlines have been met already.- Specified by:
expectNoScheduledDeadlinesin interfaceFixtureExecutionResult- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineMatching
public FixtureExecutionResult expectNoScheduledDeadlineMatching(org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no deadline matching the givenmatcheris scheduled. Can be used to validate if a deadline has never been set or has been canceled.- Specified by:
expectNoScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
matcher- the matcher defining the deadline which should not be scheduled- Returns:
- the current ResultValidator, for fluent interfacing
-
expectNoScheduledDeadlineMatching
public FixtureExecutionResult expectNoScheduledDeadlineMatching(Duration durationToScheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no deadline matching the givenmatchershould be scheduled after the givendurationToScheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time.- Specified by:
expectNoScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the deadline which should not be scheduledmatcher- the matcher defining the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadline
public FixtureExecutionResult expectNoScheduledDeadline(Duration durationToScheduledTime, Object deadline) Description copied from interface:FixtureExecutionResultAsserts that no deadline equal to the givendeadlinehas been scheduled after the givendurationToScheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time. Note that the source attribute of the deadline is ignored when comparing deadlines. Deadlines are compared using an "equals" check on all fields in the deadlines.- Specified by:
expectNoScheduledDeadlinein interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the deadline which should not be scheduleddeadline- the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineOfType
public FixtureExecutionResult expectNoScheduledDeadlineOfType(Duration durationToScheduledTime, Class<?> deadlineType) Description copied from interface:FixtureExecutionResultAsserts that no deadline of the givendeadlineTypehas been scheduled at the givendurationToScheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time.- Specified by:
expectNoScheduledDeadlineOfTypein interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the deadline which should not be scheduleddeadlineType- the type of the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineWithName
public FixtureExecutionResult expectNoScheduledDeadlineWithName(Duration durationToScheduledTime, String deadlineName) Description copied from interface:FixtureExecutionResultAsserts that no deadline with the givendeadlineNamehas been scheduled after the givendurationToScheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time.- Specified by:
expectNoScheduledDeadlineWithNamein interfaceFixtureExecutionResult- Parameters:
durationToScheduledTime- the time to wait until the trigger point of the deadline which should not be scheduleddeadlineName- the name of the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineMatching
public FixtureExecutionResult expectNoScheduledDeadlineMatching(Instant scheduledTime, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no deadline matching the givenmatcherhas been scheduled at the givenscheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time. If thescheduledTimeis calculated based on the "current time", use theTestExecutor.currentTime()to get the time to use as "current time".- Specified by:
expectNoScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no deadline matching the givenmatchershould be scheduledmatcher- the matcher defining the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadline
Description copied from interface:FixtureExecutionResultAsserts that no deadline equal to the givendeadlinehas been scheduled at the givenscheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time. If thescheduledTimeis calculated based on the "current time", use theTestExecutor.currentTime()to get the time to use as "current time". Note that the source attribute of the deadline is ignored when comparing deadlines. Deadlines are compared using an "equals" check on all fields in the deadlines.- Specified by:
expectNoScheduledDeadlinein interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no deadline equal to the givendeadlineshould be scheduleddeadline- the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineOfType
public FixtureExecutionResult expectNoScheduledDeadlineOfType(Instant scheduledTime, Class<?> deadlineType) Description copied from interface:FixtureExecutionResultAsserts that no deadline with the givendeadlineTypehas been scheduled at the givenscheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time.- Specified by:
expectNoScheduledDeadlineOfTypein interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no deadline ofdeadlineTypeshould be scheduleddeadlineType- the type of the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineWithName
public FixtureExecutionResult expectNoScheduledDeadlineWithName(Instant scheduledTime, String deadlineName) Description copied from interface:FixtureExecutionResultAsserts that no deadline with the givendeadlineNamehas been scheduled at the givenscheduledTime. Can be used to validate if a deadline has never been set or has been canceled at an exact moment in time.- Specified by:
expectNoScheduledDeadlineWithNamein interfaceFixtureExecutionResult- Parameters:
scheduledTime- the time at which no deadline ofdeadlineNameshould be scheduleddeadlineName- the name of the deadline which should not be scheduled- Returns:
- the FixtureExecutionResult for method chaining
-
expectNoScheduledDeadlineMatching
public FixtureExecutionResult expectNoScheduledDeadlineMatching(Instant from, Instant to, org.hamcrest.Matcher<? super DeadlineMessage<?>> matcher) Description copied from interface:FixtureExecutionResultAsserts that no deadline matching the givenmatcherhas been scheduled between thetoandfromtimes, wheretoandfromare inclusive. Can be used to validate if a deadline has never been set or has been canceled within a given timeframe.- Specified by:
expectNoScheduledDeadlineMatchingin interfaceFixtureExecutionResult- Parameters:
from- the time from which no deadline equal to the givendeadlineshould be scheduled (inclusive)to- the time until which no deadline equal to the givendeadlineshould be scheduled (inclusive)matcher- the matcher defining the deadline which should not be scheduled- Returns:
- the current ResultValidator, for fluent interfacing
-
expectNoScheduledDeadline
Description copied from interface:FixtureExecutionResultAsserts that no deadline equal to the givendeadlinehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive. Can be used to validate if a deadline has never been set or has been canceled within a given timeframe.- Specified by:
expectNoScheduledDeadlinein interfaceFixtureExecutionResult- Parameters:
from- the time from which no deadline equal to the givendeadlineshould be scheduled (inclusive)to- the time until which no deadline equal to the givendeadlineshould be scheduled (inclusive)deadline- the deadline which should not be scheduled- Returns:
- the current ResultValidator, for fluent interfacing
-
expectNoScheduledDeadlineOfType
public FixtureExecutionResult expectNoScheduledDeadlineOfType(Instant from, Instant to, Class<?> deadlineType) Description copied from interface:FixtureExecutionResultAsserts that no deadline with the givendeadlineTypehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive. Can be used to validate if a deadline has never been set or has been canceled within a given timeframe.- Specified by:
expectNoScheduledDeadlineOfTypein interfaceFixtureExecutionResult- Parameters:
from- the time from which no deadline equal to the givendeadlineshould be scheduled (inclusive)to- the time until which no deadline equal to the givendeadlineshould be scheduled (inclusive)deadlineType- the type of the deadline which should not be scheduled- Returns:
- the current ResultValidator, for fluent interfacing
-
expectNoScheduledDeadlineWithName
public FixtureExecutionResult expectNoScheduledDeadlineWithName(Instant from, Instant to, String deadlineName) Description copied from interface:FixtureExecutionResultAsserts that no deadline with the givendeadlineNamehas been scheduled between thetoandfromtimes, wheretoandfromare inclusive. Can be used to validate if a deadline has never been set or has been canceled within a given timeframe.- Specified by:
expectNoScheduledDeadlineWithNamein interfaceFixtureExecutionResult- Parameters:
from- the time from which no deadline equal to the givendeadlineshould be scheduled (inclusive)to- the time until which no deadline equal to the givendeadlineshould be scheduled (inclusive)deadlineName- the name of the deadline which should not be scheduled- Returns:
- the current ResultValidator, for fluent interfacing
-
expectPublishedEventsMatching
public FixtureExecutionResult expectPublishedEventsMatching(org.hamcrest.Matcher<? extends List<? super EventMessage<?>>> matcher) Description copied from interface:FixtureExecutionResultAssert that the saga published events on the EventBus as defined by the givenmatcher. Only events published in the "when" stage of the tests are matched.- Specified by:
expectPublishedEventsMatchingin interfaceFixtureExecutionResult- Parameters:
matcher- The matcher that defines the expected list of published events.- Returns:
- the FixtureExecutionResult for method chaining
-
expectDeadlinesMetMatching
public FixtureExecutionResult expectDeadlinesMetMatching(org.hamcrest.Matcher<? extends List<? super DeadlineMessage<?>>> matcher) Description copied from interface:FixtureExecutionResultAsserts that deadlines match givenmatcherhave been met (which have passed in time) on this saga.- Specified by:
expectDeadlinesMetMatchingin interfaceFixtureExecutionResult- Parameters:
matcher- The matcher that defines the expected list of deadlines- Returns:
- the FixtureExecutionResult for method chaining
-
expectTriggeredDeadlinesMatching
public FixtureExecutionResult expectTriggeredDeadlinesMatching(org.hamcrest.Matcher<? extends List<? super DeadlineMessage<?>>> matcher) Description copied from interface:FixtureExecutionResultAsserts that deadlines matching the givenmatcherhave been triggered for this aggregate.- Specified by:
expectTriggeredDeadlinesMatchingin interfaceFixtureExecutionResult- Parameters:
matcher- the matcher that defines the expected list of deadlines- Returns:
- the current FixtureExecutionResult for method chaining
-
expectPublishedEvents
Description copied from interface:FixtureExecutionResultAssert that the saga published events on the EventBus in the exact sequence of the givenexpectedevents. Events are compared comparing their type and fields using equals. Sequence number and aggregate identifier (for domain events) are ignored in the comparison.- Specified by:
expectPublishedEventsin interfaceFixtureExecutionResult- Parameters:
expected- The sequence of events expected to be published by the Saga- Returns:
- the FixtureExecutionResult for method chaining
-
expectDeadlinesMet
Description copied from interface:FixtureExecutionResultAsserts that givenexpecteddeadlines have been met (which have passed in time). Deadlines are compared comparing their type and fields using "equals".- Specified by:
expectDeadlinesMetin interfaceFixtureExecutionResult- Parameters:
expected- The sequence of deadlines expected to be met- Returns:
- the FixtureExecutionResult for method chaining
-
expectTriggeredDeadlines
Description copied from interface:FixtureExecutionResultAsserts that givenexpecteddeadlines have been triggered. Deadlines are compared comparing their type and fields using "equals".- Specified by:
expectTriggeredDeadlinesin interfaceFixtureExecutionResult- Parameters:
expected- the sequence of deadlines expected to have been triggered- Returns:
- the current FixtureExecutionResult for method chaining
-
expectTriggeredDeadlinesWithName
Description copied from interface:FixtureExecutionResultAsserts that the givenexpectedDeadlineNameshave been triggered. Matches that the given names are complete, in the same order and match the triggered deadlines by validating withDeadlineMessage.getDeadlineName().- Specified by:
expectTriggeredDeadlinesWithNamein interfaceFixtureExecutionResult- Parameters:
expectedDeadlineNames- the sequence of deadline names expected to have been triggered- Returns:
- the current FixtureExecutionResult for method chaining
-
expectTriggeredDeadlinesOfType
Description copied from interface:FixtureExecutionResultAsserts that the givenexpectedDeadlineTypeshave been triggered. Matches that the given types are complete, in the same order and match the triggered deadlines by validating withMessage.getPayloadType().- Specified by:
expectTriggeredDeadlinesOfTypein interfaceFixtureExecutionResult- Parameters:
expectedDeadlineTypes- the sequence of deadline types expected to have been triggered- Returns:
- the current FixtureExecutionResult for method chaining
-
expectSuccessfulHandlerExecution
Description copied from interface:FixtureExecutionResultExpect a successful execution of the given event handler.- Specified by:
expectSuccessfulHandlerExecutionin interfaceFixtureExecutionResult- Returns:
- the current FixtureExecutionResult, for fluent interfacing
-