Class MigrateAggregateTestFixtureSetup
- All Implemented Interfaces:
Cloneable
new AggregateTestFixture<X>(X.class) (or its diamond form) to the AF5
fluent factory:
AxonTestFixture.with(
EventSourcingConfigurer.create()
.registerEntity(
EventSourcedEntityModule.autodetected(
<IdType>.class,
X.class)))
The aggregate type X is read from the constructor's class literal
argument. The <IdType> is looked up in the cross-recipe map populated
by AddEventTagAnnotation (under AddEventTagAnnotation.SHARED_ID_TYPES_KEY)
while @AggregateIdentifier is still on the source. When the id type is
unavailable (no annotated field, or an unresolvable type), the recipe falls
back to Object.class with a TODO(axon4to5): comment so the developer
notices and supplies the correct type manually — same shape as
ConfigureEventSourcedAnnotation.
Only the AF4 AggregateTestFixture FQN is matched, so
SagaTestFixture setups are left for manual migration. The recipe
targets the new ... expression itself, so callers in field
initializers or @BeforeEach bodies are both handled.
When to run: before ChangeType
AggregateTestFixture → AxonTestFixture. Once the type is renamed, the
AF4-specific match disappears and the recipe is a no-op.
- Since:
- 5.1.1
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, 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
-
MigrateAggregateTestFixtureSetup
public MigrateAggregateTestFixtureSetup()
-
-
Method Details
-
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
-