Package org.axonframework.migration
Class MarkUnsupportedSagaTestFixtureCalls
java.lang.Object
org.openrewrite.Recipe
org.axonframework.migration.MarkUnsupportedSagaTestFixtureCalls
- All Implemented Interfaces:
Cloneable
public class MarkUnsupportedSagaTestFixtureCalls
extends org.openrewrite.Recipe
Leaves a
// TODO(axon4to5): marker on the Axon Framework 4 SagaTestFixture usage that the fixture
ported by axoniq-legacy-test no longer supports, keeping every call in place.
The ported fixture keeps the Axon Framework 4 API where Axon Framework 5 allows it. Where it does not, the test either stops compiling or fails at run time, and what to do instead depends on what the test meant to verify, so the recipe marks the statement and leaves the decision to the developer:
withTransienceCheckDisabled()is a deprecated-for-removal no-op: Sagas get no field injection, so there is no transience check to disable;expectScheduledEvent*,expectNoScheduledEvent*andexpectNoScheduledEvents()throw anUnsupportedOperationException, because the event scheduler is not ported;registerCommandGateway(..)andregisterListenerInvocationErrorHandler(..)are removed, as Axon Framework 5 has neither a gateway factory nor a listener invocation error handler;- a variable declared as the Saga
FixtureConfigurationcannot be stopped, while the ported fixture runs a started configuration that must be stopped after each test; givenAPublished,andThenAPublished,whenPublishingAandpublishestake metadata as aMap<String, String>instead of aMap<String, ?>, so passing a variable declared with other values, such as aMap<String, Object>, no longer compiles.
registerResourceInjector(..) is not handled here: MarkSagaResourceInjection marks it. The marker goes
on the enclosing statement, so a call inside a multi-line fixture chain is flagged above the chain. 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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
-
MarkUnsupportedSagaTestFixtureCalls
public MarkUnsupportedSagaTestFixtureCalls()
-
-
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
-