Class MarkAggregateTestFixtureDeadlineCalls
- All Implemented Interfaces:
Cloneable
// TODO(axon4to5): marker on the statements that use the deadline and time support of the Axon
Framework 4 aggregate test fixture, keeping every call in place.
The Axon Framework 4 AggregateTestFixture ran a stub deadline manager on a simulated clock: tests asserted
scheduled, cancelled and triggered deadlines (expectScheduledDeadline*, expectNoScheduledDeadline*,
expectDeadlinesMet*, expectTriggeredDeadlines*), moved the clock (givenCurrentTime,
andGivenCurrentTime, currentTime, whenTimeElapses, whenTimeAdvancesTo and their
whenThen* and andThen* variants) and intercepted deadlines
(registerDeadlineDispatchInterceptor, registerDeadlineHandlerInterceptor). The Axon Framework 5
AxonTestFixture the aggregate fixture migrates to has none of this: no deadline manager and no clock. The
fluent rewrite of the surrounding chain therefore leaves these calls behind as code that does not compile, and how to
test the deadline instead depends on what the test meant to verify.
The marker text depends on where the migrated application runs its deadlines. Free Axon Framework 5 has none. On
Axoniq Framework, axoniq-legacy delivers a fired aggregate deadline as a command to the
@CommandHandler its @DeadlineHandler became, so a test can send that command itself; set
axoniqLegacy to say so. Both variants share the marker keys, so the free migration leaves
a statement alone that the commercial one marked first.
Runs on the Axon Framework 4 types, before they are renamed. Java sources only. Idempotent.
- Since:
- 5.4.0
- Author:
- Mateusz Nowak
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
ConstructorsConstructorDescriptionMarkAggregateTestFixtureDeadlineCalls(@Nullable Boolean axoniqLegacy) Creates the recipe, choosing the marker text for the platform the deadlines migrate to. -
Method Summary
Modifier and TypeMethodDescription@Nullable BooleanReturns whether the migrated application keeps its deadlines onaxoniq-legacy.org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, aggregateDataTableDescriptors, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Constructor Details
-
MarkAggregateTestFixtureDeadlineCalls
Creates the recipe, choosing the marker text for the platform the deadlines migrate to.- Parameters:
axoniqLegacy- whether the deadlines keep running onaxoniq-legacy;nullmeans they do not
-
-
Method Details
-
getAxoniqLegacy
Returns whether the migrated application keeps its deadlines onaxoniq-legacy.- Returns:
- whether the deadlines keep running on
axoniq-legacy, ornullwhen not set
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-