feat(integrationtests): base AbstractIntegrationTest class decoupled from Axon Server#4413
feat(integrationtests): base AbstractIntegrationTest class decoupled from Axon Server#4413smcvb merged 7 commits intoaxon-5.1.xfrom
Conversation
…Axon Server Replace AbstractAxonServerIT and AbstractAxonServerIntegrationTest with an infrastructure-agnostic AbstractIntegrationTest base class backed by a TestInfrastructure strategy interface. AxonServerTestInfrastructure wraps the existing Testcontainers setup; InMemoryTestInfrastructure disables the AxonServer enhancer by FQCN string so the framework's default SimpleCommandBus/InMemoryEventStorageEngine are used without any container dependency. All domain test classes in the administration, student, and course subtrees are made abstract. Each gets a concrete ...AxonServerIT and ...InMemoryIT leaf that pins the infrastructure. CommandPayloadConversionIT remains concrete and AxonServer-only since payload conversion is a distributed-bus concern that has no in-memory equivalent.
…n in AbstractIntegrationTest - less collision risk
…ions to clarify changes
…ions to clarify changes
Merge the abstract createTestInfrastructure() factory and the cached testInfrastructure() accessor into a single abstract testInfrastructure() method. Leaf classes already hold a private static final singleton, so the cache field (and its teardown bookkeeping) was redundant. Rename createConfigurer() to applicationConfigurer() to match the noun-style accessor naming and read more naturally at call sites. Also drop the unused logger field on AbstractIntegrationTest.
…cause it's thrown by `DistirubtedEventBus` only, not by the `SimpleCommandBus`
|
smcvb
left a comment
There was a problem hiding this comment.
Couple of nits here and there on docs. Biggest pointer is making the abstract test suite classes public, otherwise there's no value in this setup I am afraid. Lastly, it might be good to do a pass through the student, course, and administration domains in this project, to ensure those classes are public as well. I can imagine we may have tests in the future that are specific for Axoniq Framework that require access to the internals too.
| * environments where the connector JAR is absent. | ||
| */ | ||
| private static final String AXON_SERVER_ENHANCER_FQCN = | ||
| "org.axonframework.axonserver.connector.AxonServerConfigurationEnhancer"; |
There was a problem hiding this comment.
This should be
| "org.axonframework.axonserver.connector.AxonServerConfigurationEnhancer"; | |
| "io.axoniq.framework.axonserver.connector.configuration.AxonServerConfigurationEnhancer"; |
There was a problem hiding this comment.
Not yet @smcvb, because it's still in the repostiory. I'm going to change it after the AxonServer removal form THIS repository, or for the transition period I will disable both.
…refine AxonServer configuration Make integration test classes explicitly `public abstract` for clarity. Enhance documentation with `@author` annotations and refine AxonServer enhancer handling by introducing a transitional constant. Update AxonServer container to use the `latest` tag.
smcvb
left a comment
There was a problem hiding this comment.
My concerns have been addressed, hence I'm approving this pull request.
Remove AxonServer specific integration tests again. With #4413 implemented, the test suites can be implemented differently depending on the available infrastructure. As we're moving Axon Server entirely to Axoniq Framework, any Axon Server versions of the integration tests should be ported entirely.



Summary
Refactor the integration test hierarchy in
integrationtests/so that the same domain tests (administration, student, course) run against multiple infrastructure backends. Today every base class (AbstractAxonServerIT,AbstractAxonServerIntegrationTest) hard-codes Axon Server; there is no way to verify the same behavior against the framework's in-memory defaults, and there was no extension point for future event stores ( like Postgres/JDBC/JPA). This PR replaces that coupling with aTestInfrastructurestrategy and a single infrastructure-agnostic base.Changes
Infrastructure layer (new)
testsuite/AbstractIntegrationTest.java— infrastructure-agnostic base replacingAbstractAxonServerIT/AbstractAxonServerIntegrationTest. ExposestestInfrastructure()andapplicationConfigurer()as abstract hooks.createId()usesUUID.randomUUID()to avoid collisions under JUnit'sPER_METHODlifecycle.testsuite/infrastructure/TestInfrastructure.java— strategy withstart()/configureInfrastructure(...)/purgeData()/stop().testsuite/infrastructure/AxonServerTestInfrastructure.java— sharedstatic final AxonServerContainerwithwithReuse(true);stop()is a deliberate no-op (Testcontainers + Ryuk handle JVM-exit cleanup).testsuite/infrastructure/InMemoryTestInfrastructure.java— disables the AxonServer enhancer by FQCN string, notClassreference, so this variant compiles and runs even withoutaxon-server-connectoron the classpath.Domain tests
abstract(5 administration, 10 student, 1 course) with thin...AxonServerIT/...InMemoryITleaf pairs (34 leaves total).CommandPayloadConversionITstays AxonServer-only:SimpleCommandBusdoes not convert payloads, so there is no in-memory equivalent.purgeEventStorage()call sites renamed topurgeData(), now delegated through the infrastructure strategy.Legacy cleanup
AbstractAxonServerITandAbstractAxonServerIntegrationTest.Test assertion fix
MultiEntityCommandHandlingComponentIT/CompoundEntityIdentifierCommandHandlingComponentIT: dropped.isInstanceOf(CommandExecutionException.class)assertions. That wrapper is added by the distributed command bus;SimpleCommandBussurfaces the raw exception. Removing the type check lets the same assertion pass on both backends; the message assertion still validates behavior.