From eff352c81be6d97940365c55ae0678fb7e608928 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 17:59:17 +0200 Subject: [PATCH 1/7] refactor(integrationtests): decouple integration test hierarchy from 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. --- .../testsuite/AbstractAxonServerIT.java | 107 ------------- .../AbstractAxonServerIntegrationTest.java | 86 ---------- .../testsuite/AbstractIntegrationTest.java | 150 ++++++++++++++++++ .../AbstractAdministrationIT.java | 4 +- ...EntityModelAdministrationAxonServerIT.java | 34 ++++ ...bleBuilderEntityModelAdministrationIT.java | 2 +- ...erEntityModelAdministrationInMemoryIT.java | 34 ++++ ...EntityModelAdministrationAxonServerIT.java | 34 ++++ ...ReflectionEntityModelAdministrationIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 34 ++++ ...EntityModelAdministrationAxonServerIT.java | 34 ++++ ...bleBuilderEntityModelAdministrationIT.java | 2 +- ...erEntityModelAdministrationInMemoryIT.java | 34 ++++ ...EntityModelAdministrationAxonServerIT.java | 34 ++++ ...ReflectionEntityModelAdministrationIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 34 ++++ ...EntityModelAdministrationAxonServerIT.java | 34 ++++ ...ReflectionEntityModelAdministrationIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 34 ++++ .../course/SealedClassCourseAxonServerIT.java | 33 ++++ .../testsuite/course/SealedClassCourseIT.java | 4 +- .../course/SealedClassCourseInMemoryIT.java | 33 ++++ .../AxonServerTestInfrastructure.java | 95 +++++++++++ .../InMemoryTestInfrastructure.java | 77 +++++++++ .../infrastructure/TestInfrastructure.java | 63 ++++++++ .../testsuite/student/AbstractStudentIT.java | 4 +- ...mmandHandlingInterceptorsAxonServerIT.java | 33 ++++ .../CommandHandlingInterceptorsIT.java | 2 +- ...CommandHandlingInterceptorsInMemoryIT.java | 33 ++++ .../student/CommandPayloadConversionIT.java | 11 ++ .../CommandSequencingAxonServerIT.java | 33 ++++ .../student/CommandSequencingIT.java | 2 +- .../student/CommandSequencingInMemoryIT.java | 33 ++++ ...rCommandHandlingComponentAxonServerIT.java | 34 ++++ ...yIdentifierCommandHandlingComponentIT.java | 2 +- ...ierCommandHandlingComponentInMemoryIT.java | 34 ++++ ...entSourcedPooledStreamingAxonServerIT.java | 34 ++++ ...nnotatedEventSourcedPooledStreamingIT.java | 2 +- ...EventSourcedPooledStreamingInMemoryIT.java | 34 ++++ ...StateBasedPooledStreamingAxonServerIT.java | 34 ++++ ...gAnnotatedStateBasedPooledStreamingIT.java | 2 +- ...edStateBasedPooledStreamingInMemoryIT.java | 34 ++++ ...entSourcedPooledStreamingAxonServerIT.java | 34 ++++ ...larativeEventSourcedPooledStreamingIT.java | 2 +- ...EventSourcedPooledStreamingInMemoryIT.java | 34 ++++ ...oledEventProcessingReportAxonServerIT.java | 34 ++++ ...nitoringPooledEventProcessingReportIT.java | 4 +- ...PooledEventProcessingReportInMemoryIT.java | 34 ++++ ...yCommandHandlingComponentAxonServerIT.java | 34 ++++ ...MultiEntityCommandHandlingComponentIT.java | 2 +- ...ityCommandHandlingComponentInMemoryIT.java | 34 ++++ ...eplayStatusChangedHandlerAxonServerIT.java | 33 ++++ .../student/ReplayStatusChangedHandlerIT.java | 4 +- .../ReplayStatusChangedHandlerInMemoryIT.java | 33 ++++ ...yCommandHandlingComponentAxonServerIT.java | 34 ++++ ...ingleEntityCommandHandlingComponentIT.java | 2 +- ...ityCommandHandlingComponentInMemoryIT.java | 34 ++++ ...ntSourceWithEventAppenderAxonServerIT.java | 34 ++++ ...ventSourceWithEventAppenderInMemoryIT.java | 34 ++++ ...bableEventSourceWithEventAppenderTest.java | 2 +- 60 files changed, 1568 insertions(+), 217 deletions(-) delete mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIT.java delete mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIntegrationTest.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java create mode 100644 integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIT.java deleted file mode 100644 index d7b9f31d1a2..00000000000 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIT.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2010-2026. Axon Framework - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.axonframework.integrationtests.testsuite; - -import org.axonframework.axonserver.connector.AxonServerConfiguration; -import org.axonframework.common.configuration.ApplicationConfigurer; -import org.axonframework.common.configuration.AxonConfiguration; -import org.axonframework.messaging.commandhandling.gateway.CommandGateway; -import org.axonframework.test.server.AxonServerContainer; -import org.axonframework.test.server.AxonServerContainerUtils; -import org.junit.jupiter.api.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.Random; - -/** - * Abstract test suite for integration tests using an AxonServerContainer. Concrete implementations have to provide a - * specific {@link ApplicationConfigurer}. The server is started using the default {@link AxonServerConfiguration}. The - * started configuration and the associated {@link CommandGateway} are available through member-variables. - * - * @author Mitchell Herrijgers - */ -public abstract class AbstractAxonServerIT { - - protected static final Logger logger = LoggerFactory.getLogger(AbstractAxonServerIT.class); - - private static final AxonServerContainer container = - new AxonServerContainer("docker.axoniq.io/axoniq/axonserver:2025.2.0") - .withAxonServerHostname("localhost") - .withDevMode(true) - .withReuse(true) - .withDcbContext(true); - - protected CommandGateway commandGateway; - protected AxonConfiguration startedConfiguration; - - @BeforeAll - static void beforeAll() { - container.start(); - logger.info("Using Axon Server for integration test. UI is available at http://localhost:{}", - container.getHttpPort()); - } - - @AfterEach - void tearDown() { - if (startedConfiguration != null) { - startedConfiguration.shutdown(); - } - } - - protected void startApp() { - AxonServerConfiguration axonServerConfiguration = new AxonServerConfiguration(); - axonServerConfiguration.setServers(container.getHost() + ":" + container.getGrpcPort()); - startedConfiguration = createConfigurer().componentRegistry(cr -> cr.registerComponent( - AxonServerConfiguration.class, c -> axonServerConfiguration - )) - .start(); - commandGateway = startedConfiguration.getComponent(CommandGateway.class); - } - - /** - * Creates the {@link ApplicationConfigurer} defining the Axon Framework test context. - * - * @return The {@link ApplicationConfigurer} defining the Axon Framework test context. - */ - protected abstract ApplicationConfigurer createConfigurer(); - - private static final Random RND = new Random(); - - protected static String createId(String prefix) { - return prefix + "-" + RND.nextInt(Integer.MAX_VALUE); - } - - /** - * Purges all events from the AxonServer event storage. This method can be called before tests to ensure a clean - * state, preventing events from previous test runs from affecting the current test. - */ - protected void purgeEventStorage() { - try { - logger.info("Purging events from Axon Server."); - AxonServerContainerUtils.purgeEventsFromAxonServer( - container.getHost(), - container.getHttpPort(), - "default", - AxonServerContainerUtils.DCB_CONTEXT - ); - } catch (IOException e) { - throw new RuntimeException("Failed to purge event storage", e); - } - } -} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIntegrationTest.java deleted file mode 100644 index 41401a90fb4..00000000000 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractAxonServerIntegrationTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2010-2026. Axon Framework - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.axonframework.integrationtests.testsuite; - -import org.axonframework.axonserver.connector.AxonServerConfiguration; -import org.axonframework.messaging.commandhandling.gateway.CommandGateway; -import org.axonframework.common.configuration.ApplicationConfigurer; -import org.axonframework.common.configuration.AxonConfiguration; -import org.axonframework.test.server.AxonServerContainer; -import org.junit.jupiter.api.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Random; - -/** - * Abstract test suite for integration tests using an AxonServerContainer. Concrete implementations have to provide a - * specific {@link ApplicationConfigurer}. The server is started using the default {@link AxonServerConfiguration}. The - * started configuration and the associated {@link CommandGateway} are available through member-variables. - * - * @author Mitchell Herrijgers - */ -public abstract class AbstractAxonServerIntegrationTest { - - protected static final Logger logger = LoggerFactory.getLogger(AbstractAxonServerIntegrationTest.class); - - private static final AxonServerContainer container = new AxonServerContainer("docker.axoniq.io/axoniq/axonserver:2025.2.0") - .withAxonServerHostname("localhost") - .withDevMode(true) - .withReuse(true) - .withDcbContext(true); - - protected CommandGateway commandGateway; - protected AxonConfiguration startedConfiguration; - - @BeforeAll - static void beforeAll() { - container.start(); - logger.info("Using Axon Server for integration test. UI is available at http://localhost:{}", - container.getHttpPort()); - } - - @AfterEach - void tearDown() { - if (startedConfiguration != null) { - startedConfiguration.shutdown(); - } - } - - protected void startApp() { - AxonServerConfiguration axonServerConfiguration = new AxonServerConfiguration(); - axonServerConfiguration.setServers(container.getHost() + ":" + container.getGrpcPort()); - startedConfiguration = createConfigurer().componentRegistry(cr -> cr.registerComponent( - AxonServerConfiguration.class, c -> axonServerConfiguration - )) - .start(); - commandGateway = startedConfiguration.getComponent(CommandGateway.class); - } - - /** - * Creates the {@link ApplicationConfigurer} defining the Axon Framework test context. - * - * @return The {@link ApplicationConfigurer} defining the Axon Framework test context. - */ - protected abstract ApplicationConfigurer createConfigurer(); - - private static final Random RND = new Random(); - - protected static final String createId(String prefix) { - return prefix + "-" + RND.nextInt(Integer.MAX_VALUE); - } -} \ No newline at end of file diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java new file mode 100644 index 00000000000..723c654448d --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite; + +import org.axonframework.common.configuration.ApplicationConfigurer; +import org.axonframework.common.configuration.AxonConfiguration; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; +import org.axonframework.messaging.commandhandling.gateway.CommandGateway; +import org.junit.jupiter.api.AfterEach; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Random; + +/** + * Infrastructure-agnostic base class for all integration tests in this suite. + *

+ * Replaces the AxonServer-coupled {@code AbstractAxonServerIT}. The specific backend (AxonServer, in-memory, Postgres, + * …) is supplied by leaf test classes through {@link #createTestInfrastructure()}. + *

+ * Subclasses must implement: + *

+ * and must call {@link #startApp()} (typically from a {@code @BeforeEach} method) to start the Axon configuration. + */ +public abstract class AbstractIntegrationTest { + + protected static final Logger logger = LoggerFactory.getLogger(AbstractIntegrationTest.class); + + private static final Random RND = new Random(); + + protected CommandGateway commandGateway; + protected AxonConfiguration startedConfiguration; + + /** + * Per-test cache of the {@link TestInfrastructure} wrapper, ensuring that {@link TestInfrastructure#start()} and + * {@link TestInfrastructure#stop()} always operate on the same instance. + */ + private TestInfrastructure cachedInfrastructure; + + /** + * Factory method called once per test to obtain the {@link TestInfrastructure} for this test class. Leaf classes + * typically return a {@code private static final} instance: + *
{@code
+     * private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure();
+     *
+     * @Override
+     * protected TestInfrastructure createTestInfrastructure() {
+     *     return INFRASTRUCTURE;
+     * }
+     * }
+ * + * @return the infrastructure strategy to use for this test + */ + protected abstract TestInfrastructure createTestInfrastructure(); + + /** + * Returns the domain-specific {@link ApplicationConfigurer} for this test. Called from {@link #startApp()} each + * time the Axon configuration is started. + * + * @return the application configurer for this test + */ + protected abstract ApplicationConfigurer createConfigurer(); + + /** + * Returns the cached {@link TestInfrastructure} for the current test, initializing it on first access. + *

+ * This accessor is {@code final} to guarantee that all internal callers ({@link #startApp()}, + * {@link #purgeData()}, {@code @AfterEach}) share the same instance. + * + * @return the infrastructure wrapper for this test + */ + protected final TestInfrastructure testInfrastructure() { + if (cachedInfrastructure == null) { + cachedInfrastructure = createTestInfrastructure(); + } + return cachedInfrastructure; + } + + /** + * Shuts down the Axon configuration and releases infrastructure resources acquired during {@link #startApp()}. + */ + @AfterEach + void tearDown() { + try { + if (startedConfiguration != null) { + startedConfiguration.shutdown(); + } + } finally { + try { + if (cachedInfrastructure != null) { + cachedInfrastructure.stop(); + } + } finally { + cachedInfrastructure = null; + } + } + } + + /** + * Starts the Axon Framework application using the configured infrastructure and domain configurer. + *

+ * Subclasses must call this method (directly or via {@code super.startApp()}) from a {@code @BeforeEach} method. + * The infrastructure's {@link TestInfrastructure#start()} is invoked first (idempotent), followed by building and + * starting the {@link AxonConfiguration}. + */ + protected void startApp() { + TestInfrastructure infra = testInfrastructure(); + infra.start(); + startedConfiguration = createConfigurer() + .componentRegistry(infra::configureInfrastructure) + .start(); + commandGateway = startedConfiguration.getComponent(CommandGateway.class); + } + + /** + * Purges persisted data via the current {@link TestInfrastructure}. Opt-in — only tests that require a clean + * initial state (e.g. event-replay tests) should call this method. + */ + protected void purgeData() { + testInfrastructure().purgeData(); + } + + /** + * Creates a unique ID string with the given {@code prefix}, suitable for use as an aggregate or entity identifier + * in tests. + * + * @param prefix a human-readable prefix for the generated ID + * @return a unique identifier string + */ + protected static String createId(String prefix) { + return prefix + "-" + RND.nextInt(Integer.MAX_VALUE); + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java index d21427db743..42efcb594d9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java @@ -18,7 +18,7 @@ import org.axonframework.common.configuration.ApplicationConfigurer; import org.axonframework.eventsourcing.configuration.EventSourcingConfigurer; -import org.axonframework.integrationtests.testsuite.AbstractAxonServerIT; +import org.axonframework.integrationtests.testsuite.AbstractIntegrationTest; import org.axonframework.integrationtests.testsuite.administration.commands.AssignTaskCommand; import org.axonframework.integrationtests.testsuite.administration.commands.ChangeEmailAddress; import org.axonframework.integrationtests.testsuite.administration.commands.CompleteTaskCommand; @@ -37,7 +37,7 @@ * Test suite for verifying polymorphic behavior of entities. Can be implemented by different test classes that verify * different ways of building the {@link org.axonframework.modelling.entity.EntityCommandHandlingComponent}. */ -public abstract class AbstractAdministrationIT extends AbstractAxonServerIT { +public abstract class AbstractAdministrationIT extends AbstractIntegrationTest { private final CreateEmployee CREATE_EMPLOYEE_1_COMMAND = new CreateEmployee( new PersonIdentifier(PersonType.EMPLOYEE, createId("employee")), diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java new file mode 100644 index 00000000000..e52ed4d31c0 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ImmutableBuilderEntityModelAdministrationIT} against a real Axon Server instance. + */ +public class ImmutableBuilderEntityModelAdministrationAxonServerIT + extends ImmutableBuilderEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationIT.java index bb25246740a..0789e4db18c 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationIT.java @@ -54,7 +54,7 @@ /** * Runs the administration test suite using the builders of {@link EntityMetamodel} and related classes. */ -public class ImmutableBuilderEntityModelAdministrationIT extends AbstractAdministrationIT { +public abstract class ImmutableBuilderEntityModelAdministrationIT extends AbstractAdministrationIT { EntityMetamodel buildEntityMetamodel(Configuration configuration, EntityMetamodelBuilder builder) { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java new file mode 100644 index 00000000000..e4463eee058 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ImmutableBuilderEntityModelAdministrationIT} against the in-memory framework defaults. + */ +public class ImmutableBuilderEntityModelAdministrationInMemoryIT + extends ImmutableBuilderEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java new file mode 100644 index 00000000000..d1d945fd953 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ImmutableReflectionEntityModelAdministrationIT} against a real Axon Server instance. + */ +public class ImmutableReflectionEntityModelAdministrationAxonServerIT + extends ImmutableReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationIT.java index 09e4102584a..19729a0ad3c 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationIT.java @@ -26,7 +26,7 @@ * Runs the administration test suite using as many reflection components of the {@link EntityMetamodel} and related * classes as possible. As reflection-based components are added, this test may change to use more of them. */ -public class ImmutableReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { +public abstract class ImmutableReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { @Override protected EventSourcingConfigurer testSuiteConfigurer(EventSourcingConfigurer configurer) { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java new file mode 100644 index 00000000000..cb98aea06b3 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ImmutableReflectionEntityModelAdministrationIT} against the in-memory framework defaults. + */ +public class ImmutableReflectionEntityModelAdministrationInMemoryIT + extends ImmutableReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java new file mode 100644 index 00000000000..e13c8d30884 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MutableBuilderEntityModelAdministrationIT} against a real Axon Server instance. + */ +public class MutableBuilderEntityModelAdministrationAxonServerIT + extends MutableBuilderEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationIT.java index c15956f9c60..35170800e74 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationIT.java @@ -51,7 +51,7 @@ /** * Runs the administration test suite using the builders of {@link EntityMetamodel} and related classes. */ -public class MutableBuilderEntityModelAdministrationIT extends AbstractAdministrationIT { +public abstract class MutableBuilderEntityModelAdministrationIT extends AbstractAdministrationIT { EntityMetamodel buildEntityMetamodel(Configuration configuration, EntityMetamodelBuilder builder) { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java new file mode 100644 index 00000000000..fdfd6ae8b61 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MutableBuilderEntityModelAdministrationIT} against the in-memory framework defaults. + */ +public class MutableBuilderEntityModelAdministrationInMemoryIT + extends MutableBuilderEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java new file mode 100644 index 00000000000..237d27114ce --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MutableReflectionEntityModelAdministrationIT} against a real Axon Server instance. + */ +public class MutableReflectionEntityModelAdministrationAxonServerIT + extends MutableReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationIT.java index 5b0f5efdf89..1d1e72d47e8 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationIT.java @@ -26,7 +26,7 @@ * Runs the administration test suite using as many reflection components of the {@link EntityMetamodel} and related * classes as possible. As reflection-based components are added, this test may change to use more of them. */ -public class MutableReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { +public abstract class MutableReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { @Override protected EventSourcingConfigurer testSuiteConfigurer(EventSourcingConfigurer configurer) { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java new file mode 100644 index 00000000000..cb7260eef58 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MutableReflectionEntityModelAdministrationIT} against the in-memory framework defaults. + */ +public class MutableReflectionEntityModelAdministrationInMemoryIT + extends MutableReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java new file mode 100644 index 00000000000..515191895e7 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SealedReflectionEntityModelAdministrationIT} against a real Axon Server instance. + */ +public class SealedReflectionEntityModelAdministrationAxonServerIT + extends SealedReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationIT.java index f6ac1a61d79..3cb79c9d3ab 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationIT.java @@ -26,7 +26,7 @@ * Runs the administration test suite using as many reflection components of the {@link EntityMetamodel} and related * classes as possible. As reflection-based components are added, this test may change to use more of them. */ -public class SealedReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { +public abstract class SealedReflectionEntityModelAdministrationIT extends AbstractAdministrationIT { @Override protected EventSourcingConfigurer testSuiteConfigurer(EventSourcingConfigurer configurer) { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java new file mode 100644 index 00000000000..47b6083115c --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.administration; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SealedReflectionEntityModelAdministrationIT} against the in-memory framework defaults. + */ +public class SealedReflectionEntityModelAdministrationInMemoryIT + extends SealedReflectionEntityModelAdministrationIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java new file mode 100644 index 00000000000..0013b377304 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.course; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SealedClassCourseIT} against a real Axon Server instance. + */ +public class SealedClassCourseAxonServerIT extends SealedClassCourseIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java index eff07d1b53b..4bd63c51c35 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java @@ -19,7 +19,7 @@ import org.axonframework.common.configuration.ApplicationConfigurer; import org.axonframework.eventsourcing.configuration.EventSourcedEntityModule; import org.axonframework.eventsourcing.configuration.EventSourcingConfigurer; -import org.axonframework.integrationtests.testsuite.AbstractAxonServerIT; +import org.axonframework.integrationtests.testsuite.AbstractIntegrationTest; import org.axonframework.integrationtests.testsuite.course.commands.CreateCourse; import org.axonframework.integrationtests.testsuite.course.commands.PublishCourse; import org.axonframework.integrationtests.testsuite.course.module.SealedClassCourseCommandHandlers; @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.*; -class SealedClassCourseIT extends AbstractAxonServerIT { +abstract class SealedClassCourseIT extends AbstractIntegrationTest { protected UnitOfWorkFactory unitOfWorkFactory; diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java new file mode 100644 index 00000000000..3d99bae88eb --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.course; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SealedClassCourseIT} against the in-memory framework defaults. + */ +public class SealedClassCourseInMemoryIT extends SealedClassCourseIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java new file mode 100644 index 00000000000..c754f700df8 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.infrastructure; + +import org.axonframework.axonserver.connector.AxonServerConfiguration; +import org.axonframework.common.configuration.ComponentRegistry; +import org.axonframework.test.server.AxonServerContainer; +import org.axonframework.test.server.AxonServerContainerUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; + +/** + * {@link TestInfrastructure} implementation that wires tests against a real Axon Server instance managed by + * Testcontainers. + *

+ * The underlying {@link AxonServerContainer} is a {@code static final} field, so it is shared across all instances of + * this class and all leaf test classes that use it. {@link AxonServerContainer#start()} is idempotent — Testcontainers + * makes it a no-op when the container is already running — so calling {@link #start()} from every {@code @BeforeEach} + * is safe and cheap after the first test. + *

+ * Leaf test classes should hold a {@code private static final} instance of this class: + *

{@code
+ * private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure();
+ *
+ * @Override
+ * protected TestInfrastructure createTestInfrastructure() {
+ *     return INFRASTRUCTURE;
+ * }
+ * }
+ */ +public final class AxonServerTestInfrastructure implements TestInfrastructure { + + private static final Logger LOG = LoggerFactory.getLogger(AxonServerTestInfrastructure.class); + + private static final AxonServerContainer CONTAINER = + new AxonServerContainer("docker.axoniq.io/axoniq/axonserver:2025.2.0") + .withAxonServerHostname("localhost") + .withDevMode(true) + .withReuse(true) + .withDcbContext(true); + + @Override + public void start() { + boolean wasRunning = CONTAINER.isRunning(); + CONTAINER.start(); + if (!wasRunning) { + LOG.info("Axon Server UI at http://localhost:{}", CONTAINER.getHttpPort()); + } + } + + @Override + public void configureInfrastructure(ComponentRegistry registry) { + AxonServerConfiguration config = new AxonServerConfiguration(); + config.setServers(CONTAINER.getHost() + ":" + CONTAINER.getGrpcPort()); + registry.registerComponent(AxonServerConfiguration.class, c -> config); + } + + @Override + public void purgeData() { + try { + LOG.info("Purging events from Axon Server."); + AxonServerContainerUtils.purgeEventsFromAxonServer( + CONTAINER.getHost(), + CONTAINER.getHttpPort(), + "default", + AxonServerContainerUtils.DCB_CONTEXT + ); + } catch (IOException e) { + throw new RuntimeException("Failed to purge AxonServer event storage", e); + } + } + + @Override + public void stop() { + // The container is shared across the JVM (static final, withReuse(true)). + // Testcontainers + Ryuk handle cleanup on JVM exit; stopping per test would + // defeat reuse. No-op on purpose. + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java new file mode 100644 index 00000000000..bc6ca0e55bd --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.infrastructure; + +import org.axonframework.common.configuration.ComponentRegistry; + +/** + * {@link TestInfrastructure} implementation that uses the framework's default in-memory components. + *

+ * No containers are started. The only configuration step is disabling the AxonServer enhancer so that classpath + * scanning does not replace the in-memory defaults ({@code SimpleCommandBus}, {@code SimpleQueryBus}, + * {@code InMemoryEventStorageEngine}) with distributed AxonServer equivalents. + *

+ * Data "purging" is a no-op: each test shuts down and recreates the + * {@link org.axonframework.common.configuration.AxonConfiguration} via + * {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#startApp()}, so the in-memory stores + * are always fresh at the start of every test. + *

+ * Leaf test classes should hold a {@code private static final} instance of this class: + *

{@code
+ * private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure();
+ *
+ * @Override
+ * protected TestInfrastructure createTestInfrastructure() {
+ *     return INFRASTRUCTURE;
+ * }
+ * }
+ */ +public final class InMemoryTestInfrastructure implements TestInfrastructure { + + /** + * FQCN string used to disable the AxonServer configuration enhancer without introducing a compile-time dependency + * on the {@code axon-server-connector} module. The {@link ComponentRegistry#disableEnhancer(String)} overload + * treats "enhancer not found on classpath" and "enhancer found and disabled" identically, so this is safe even in + * environments where the connector JAR is absent. + */ + private static final String AXON_SERVER_ENHANCER_FQCN = + "org.axonframework.axonserver.connector.AxonServerConfigurationEnhancer"; + + @Override + public void start() { + // No containers to start. + } + + @Override + public void configureInfrastructure(ComponentRegistry registry) { + // Prevent the AxonServer enhancer from replacing the in-memory defaults. + // EventSourcingConfigurationDefaults already provides InMemoryEventStorageEngine; + // MessagingConfigurationDefaults provides SimpleCommandBus / SimpleQueryBus. + registry.disableEnhancer(AXON_SERVER_ENHANCER_FQCN); + } + + @Override + public void purgeData() { + // No-op: the configuration is recreated from scratch in every startApp() call, + // so in-memory stores are always empty at the beginning of each test. + } + + @Override + public void stop() { + // Nothing to release — no containers, no pools, no external resources. + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java new file mode 100644 index 00000000000..6a12627c541 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.infrastructure; + +import org.axonframework.common.configuration.ComponentRegistry; + +/** + * Strategy interface that encapsulates the lifecycle and configuration of a specific test infrastructure backend (e.g. + * AxonServer via Testcontainers, pure in-memory, JDBC, etc.). + *

+ * An implementation is provided by each concrete leaf test class via + * {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#createTestInfrastructure()}. The base + * class caches the returned instance for the duration of a single test method, so {@link #start()} and {@link #stop()} + * are guaranteed to receive the same object. + */ +public interface TestInfrastructure { + + /** + * Start the infrastructure (e.g. launch a Testcontainer). Must be idempotent — calling {@code start()} on an + * already-running infrastructure must be a safe no-op. + */ + void start(); + + /** + * Register infrastructure-specific components or disable unwanted enhancers in the given {@code registry}. Called + * once per test, just before the {@link org.axonframework.common.configuration.AxonConfiguration} is started. + * + * @param registry the registry to configure + */ + void configureInfrastructure(ComponentRegistry registry); + + /** + * Purge persisted data so the next test starts with a clean slate. Opt-in — only tests that require a clean + * initial state need to call {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#purgeData()}. + *

+ * For in-memory backends this is typically a no-op because the configuration is recreated per test anyway. + */ + void purgeData(); + + /** + * Release resources acquired during {@link #start()}. Called from the base class's {@code @AfterEach} after the + * {@link org.axonframework.common.configuration.AxonConfiguration} has been shut down. + *

+ * For shared/reused containers (e.g. {@code withReuse(true)} Testcontainers), this is typically a no-op — + * Testcontainers + Ryuk handle JVM-exit cleanup. The hook exists so future backends (e.g. Postgres with per-suite + * schema isolation) have a defined place to release resources. + */ + void stop(); +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java index 36533b5afdd..47994e1ae8a 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java @@ -22,7 +22,7 @@ import org.axonframework.eventsourcing.EventSourcedEntityFactory; import org.axonframework.eventsourcing.configuration.EventSourcedEntityModule; import org.axonframework.eventsourcing.configuration.EventSourcingConfigurer; -import org.axonframework.integrationtests.testsuite.AbstractAxonServerIT; +import org.axonframework.integrationtests.testsuite.AbstractIntegrationTest; import org.axonframework.integrationtests.testsuite.student.events.StudentEnrolledEvent; import org.axonframework.integrationtests.testsuite.student.state.Course; import org.axonframework.integrationtests.testsuite.student.state.Student; @@ -55,7 +55,7 @@ * @author Mitchell Herrijgers * @author Steven van Beelen */ -public abstract class AbstractStudentIT extends AbstractAxonServerIT { +public abstract class AbstractStudentIT extends AbstractIntegrationTest { protected static final GenericCommandResultMessage SUCCESSFUL_COMMAND_RESULT = new GenericCommandResultMessage(new MessageType("empty"), "successful"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java new file mode 100644 index 00000000000..807d7ab356d --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CommandHandlingInterceptorsIT} against a real Axon Server instance. + */ +public class CommandHandlingInterceptorsAxonServerIT extends CommandHandlingInterceptorsIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java index d409c6cc70c..de1b63aedbc 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java @@ -46,7 +46,7 @@ * * @author Mateusz Nowak */ -class CommandHandlingInterceptorsIT extends AbstractCommandHandlingStudentIT { +abstract class CommandHandlingInterceptorsIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java new file mode 100644 index 00000000000..a231fa6cdba --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CommandHandlingInterceptorsIT} against the in-memory framework defaults. + */ +public class CommandHandlingInterceptorsInMemoryIT extends CommandHandlingInterceptorsIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java index 014541aaaa8..4c4f0fef61b 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java @@ -16,6 +16,8 @@ package org.axonframework.integrationtests.testsuite.student; +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; import org.axonframework.integrationtests.testsuite.student.commands.EnrollStudentToCourseCommand; import org.axonframework.messaging.commandhandling.CommandMessage; import org.axonframework.messaging.commandhandling.CommandResultMessage; @@ -35,6 +37,15 @@ */ class CommandPayloadConversionIT extends AbstractCommandHandlingStudentIT { + // AxonServer-only: payload conversion is a distributed-bus concern. + // SimpleCommandBus passes the payload through without serialization, so there is no in-memory equivalent. + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } + @Test void commandAndResultSupportInlinePayloadConversion() throws InterruptedException, ExecutionException { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java new file mode 100644 index 00000000000..d4456979b3e --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CommandSequencingIT} against a real Axon Server instance. + */ +public class CommandSequencingAxonServerIT extends CommandSequencingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java index be598f7f789..76a5f2ee819 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java @@ -53,7 +53,7 @@ * * @author Jakob Hatzl */ -class CommandSequencingIT extends AbstractCommandHandlingStudentIT { +abstract class CommandSequencingIT extends AbstractCommandHandlingStudentIT { public static final String ROUTING_KEY_METADATA_KEY = "CommandSequencingIT#routingKey"; diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java new file mode 100644 index 00000000000..e1926c71b10 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CommandSequencingIT} against the in-memory framework defaults. + */ +public class CommandSequencingInMemoryIT extends CommandSequencingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java new file mode 100644 index 00000000000..a7ab68ebfc6 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CompoundEntityIdentifierCommandHandlingComponentIT} against a real Axon Server instance. + */ +public class CompoundEntityIdentifierCommandHandlingComponentAxonServerIT + extends CompoundEntityIdentifierCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java index 7e78693eabd..226af5839e0 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java @@ -45,7 +45,7 @@ * * @author Mitchell Herrijgers */ -class CompoundEntityIdentifierCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +abstract class CompoundEntityIdentifierCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); private final String student3 = createId("student-3"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java new file mode 100644 index 00000000000..608e42ba3d7 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link CompoundEntityIdentifierCommandHandlingComponentIT} against the in-memory framework defaults. + */ +public class CompoundEntityIdentifierCommandHandlingComponentInMemoryIT + extends CompoundEntityIdentifierCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java new file mode 100644 index 00000000000..50d857950b6 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingAnnotatedEventSourcedPooledStreamingIT} against a real Axon Server instance. + */ +public class EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT + extends EventProcessingAnnotatedEventSourcedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingIT.java index 8df8a99f0be..77d44c76cc9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingIT.java @@ -57,7 +57,7 @@ * @author Mateusz Nowak * @since 5.0.0 */ -public class EventProcessingAnnotatedEventSourcedPooledStreamingIT extends AbstractStudentIT { +public abstract class EventProcessingAnnotatedEventSourcedPooledStreamingIT extends AbstractStudentIT { @Test void whenStudentEnrolled3CoursesThenSendNotificationTest() { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java new file mode 100644 index 00000000000..d088a37947e --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingAnnotatedEventSourcedPooledStreamingIT} against the in-memory framework defaults. + */ +public class EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT + extends EventProcessingAnnotatedEventSourcedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java new file mode 100644 index 00000000000..3e7b0550b74 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingAnnotatedStateBasedPooledStreamingIT} against a real Axon Server instance. + */ +public class EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT + extends EventProcessingAnnotatedStateBasedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingIT.java index 17bb2079d9c..d168c34d4a4 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingIT.java @@ -52,7 +52,7 @@ * @author Mateusz Nowak * @since 5.0.0 */ -public class EventProcessingAnnotatedStateBasedPooledStreamingIT extends AbstractStudentIT { +public abstract class EventProcessingAnnotatedStateBasedPooledStreamingIT extends AbstractStudentIT { @Test void whenStudentEnrolledThenUpdateReadModel() { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java new file mode 100644 index 00000000000..11776aa8310 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingAnnotatedStateBasedPooledStreamingIT} against the in-memory framework defaults. + */ +public class EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT + extends EventProcessingAnnotatedStateBasedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java new file mode 100644 index 00000000000..fede6bdc008 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingDeclarativeEventSourcedPooledStreamingIT} against a real Axon Server instance. + */ +public class EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT + extends EventProcessingDeclarativeEventSourcedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingIT.java index 297d374c4cd..6ff4529e904 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingIT.java @@ -59,7 +59,7 @@ * @author Mateusz Nowak * @since 5.0.0 */ -public class EventProcessingDeclarativeEventSourcedPooledStreamingIT extends AbstractStudentIT { +public abstract class EventProcessingDeclarativeEventSourcedPooledStreamingIT extends AbstractStudentIT { @Test void whenStudentEnrolled3CoursesThenSendNotificationTest() { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java new file mode 100644 index 00000000000..8a05d2f48ba --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link EventProcessingDeclarativeEventSourcedPooledStreamingIT} against the in-memory framework defaults. + */ +public class EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT + extends EventProcessingDeclarativeEventSourcedPooledStreamingIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java new file mode 100644 index 00000000000..cf1697e62e5 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MonitoringPooledEventProcessingReportIT} against a real Axon Server instance. + */ +public class MonitoringPooledEventProcessingReportAxonServerIT + extends MonitoringPooledEventProcessingReportIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportIT.java index 880e67f7331..6b7a6757c2a 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportIT.java @@ -38,7 +38,7 @@ * This tests uses a {@link RecordingMessageMonitor} to verify that successfully processed events and ignored events are * reported correctly. */ -public class MonitoringPooledEventProcessingReportIT extends AbstractStudentIT { +public abstract class MonitoringPooledEventProcessingReportIT extends AbstractStudentIT { private static final String NAME = MonitoringPooledEventProcessingReportIT.class.getSimpleName(); @@ -107,7 +107,7 @@ void reportsSuccessForKnownEvent() { @Override protected EventSourcingConfigurer testSuiteConfigurer(EventSourcingConfigurer configurer) { // purge events to restart with an empty eventstore and avoid processing historic events - purgeEventStorage(); + purgeData(); // a noop setup that allows verification of ignored event configurer.messaging(mc -> mc diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java new file mode 100644 index 00000000000..faf612a486f --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MonitoringPooledEventProcessingReportIT} against the in-memory framework defaults. + */ +public class MonitoringPooledEventProcessingReportInMemoryIT + extends MonitoringPooledEventProcessingReportIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java new file mode 100644 index 00000000000..adbd242d502 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MultiEntityCommandHandlingComponentIT} against a real Axon Server instance. + */ +public class MultiEntityCommandHandlingComponentAxonServerIT + extends MultiEntityCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java index 9bc345c2c0b..a7feb1ed5ff 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java @@ -49,7 +49,7 @@ * * @author Mitchell Herrijgers */ -class MultiEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +abstract class MultiEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); private final String student3 = createId("student-3"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java new file mode 100644 index 00000000000..c94d830e0cb --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link MultiEntityCommandHandlingComponentIT} against the in-memory framework defaults. + */ +public class MultiEntityCommandHandlingComponentInMemoryIT + extends MultiEntityCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java new file mode 100644 index 00000000000..3ff42158a56 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ReplayStatusChangedHandlerIT} against a real Axon Server instance. + */ +public class ReplayStatusChangedHandlerAxonServerIT extends ReplayStatusChangedHandlerIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java index ad7f6e2921e..8231928d0e9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java @@ -55,7 +55,7 @@ * @author Steven van Beelen * @since 5.1.0 */ -class ReplayStatusChangedHandlerIT extends AbstractStudentIT { +abstract class ReplayStatusChangedHandlerIT extends AbstractStudentIT { private static final String PSEP_NAME = "replayStatusChangeHandler"; @@ -70,7 +70,7 @@ void setUp() { resetHandlerInvoked = new AtomicBoolean(false); replayStatusReference = new AtomicReference<>(null); statusChangedInvoked = new CountDownLatch(0); - purgeEventStorage(); + purgeData(); } @Test diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java new file mode 100644 index 00000000000..1a9841563d4 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link ReplayStatusChangedHandlerIT} against the in-memory framework defaults. + */ +public class ReplayStatusChangedHandlerInMemoryIT extends ReplayStatusChangedHandlerIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java new file mode 100644 index 00000000000..d48ab071c13 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SingleEntityCommandHandlingComponentIT} against a real Axon Server instance. + */ +public class SingleEntityCommandHandlingComponentAxonServerIT + extends SingleEntityCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java index cecc9040b2f..0c5a3376f1d 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java @@ -36,7 +36,7 @@ * * @author Mitchell Herrijgers */ -class SingleEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +abstract class SingleEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java new file mode 100644 index 00000000000..877223a1826 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SingleEntityCommandHandlingComponentIT} against the in-memory framework defaults. + */ +public class SingleEntityCommandHandlingComponentInMemoryIT + extends SingleEntityCommandHandlingComponentIT { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java new file mode 100644 index 00000000000..1fb4a93b360 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.AxonServerTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SubscribableEventSourceWithEventAppenderTest} against a real Axon Server instance. + */ +public class SubscribableEventSourceWithEventAppenderAxonServerIT + extends SubscribableEventSourceWithEventAppenderTest { + + private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java new file mode 100644 index 00000000000..bf262db2667 --- /dev/null +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2026. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.axonframework.integrationtests.testsuite.student; + +import org.axonframework.integrationtests.testsuite.infrastructure.InMemoryTestInfrastructure; +import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; + +/** + * Runs {@link SubscribableEventSourceWithEventAppenderTest} against the in-memory framework defaults. + */ +public class SubscribableEventSourceWithEventAppenderInMemoryIT + extends SubscribableEventSourceWithEventAppenderTest { + + private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); + + @Override + protected TestInfrastructure createTestInfrastructure() { + return INFRASTRUCTURE; + } +} diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java index 0eac139986f..cc2bd2a3ac8 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java @@ -43,7 +43,7 @@ * @author Mateusz Nowak * @since 5.0.0 */ -class SubscribableEventSourceWithEventAppenderTest extends AbstractStudentIT { +abstract class SubscribableEventSourceWithEventAppenderTest extends AbstractStudentIT { @Test void whenEventPublishedViaEventAppenderThenSubscriberReceivesEvent() { From 7b97f71e70ff873fba54b91c9ecfb6c2fa1534b5 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 18:05:40 +0200 Subject: [PATCH 2/7] refactor(integrationtests): replace Random with UUID for ID generation in AbstractIntegrationTest - less collision risk --- .../integrationtests/testsuite/AbstractIntegrationTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java index 723c654448d..f131d3acb9d 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -24,7 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Random; +import java.util.UUID; /** * Infrastructure-agnostic base class for all integration tests in this suite. @@ -43,7 +43,6 @@ public abstract class AbstractIntegrationTest { protected static final Logger logger = LoggerFactory.getLogger(AbstractIntegrationTest.class); - private static final Random RND = new Random(); protected CommandGateway commandGateway; protected AxonConfiguration startedConfiguration; @@ -145,6 +144,6 @@ protected void purgeData() { * @return a unique identifier string */ protected static String createId(String prefix) { - return prefix + "-" + RND.nextInt(Integer.MAX_VALUE); + return prefix + "-" + UUID.randomUUID(); } } From cadd57c892e5e343cc92f7b673ee2e2f8ccc5eaf Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 19:59:25 +0200 Subject: [PATCH 3/7] javadoc(integrationtests): add `@since 5.1.0` and `@Internal` annotations to clarify changes --- .../integrationtests/testsuite/AbstractIntegrationTest.java | 2 ++ .../infrastructure/AxonServerTestInfrastructure.java | 2 ++ .../testsuite/infrastructure/InMemoryTestInfrastructure.java | 2 ++ .../testsuite/infrastructure/TestInfrastructure.java | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java index f131d3acb9d..165a7503f2b 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -38,6 +38,8 @@ *

  • {@link #createConfigurer()} — return the domain-specific {@link ApplicationConfigurer}
  • * * and must call {@link #startApp()} (typically from a {@code @BeforeEach} method) to start the Axon configuration. + * + * @since 5.1.0 */ public abstract class AbstractIntegrationTest { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java index c754f700df8..1bc9e76bb2b 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java @@ -43,6 +43,8 @@ * return INFRASTRUCTURE; * } * } + * + * @since 5.1.0 */ public final class AxonServerTestInfrastructure implements TestInfrastructure { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java index bc6ca0e55bd..64336f722db 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java @@ -39,6 +39,8 @@ * return INFRASTRUCTURE; * } * } + * + * @since 5.1.0 */ public final class InMemoryTestInfrastructure implements TestInfrastructure { diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java index 6a12627c541..7937aac6dba 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java @@ -16,6 +16,7 @@ package org.axonframework.integrationtests.testsuite.infrastructure; +import org.axonframework.common.annotation.Internal; import org.axonframework.common.configuration.ComponentRegistry; /** @@ -26,7 +27,10 @@ * {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#createTestInfrastructure()}. The base * class caches the returned instance for the duration of a single test method, so {@link #start()} and {@link #stop()} * are guaranteed to receive the same object. + * + * @since 5.1.0 */ +@Internal public interface TestInfrastructure { /** From 9a7cffc6571506b68f1e9bd3e75a97e16296e707 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 20:01:20 +0200 Subject: [PATCH 4/7] javadoc(integrationtests): add `@since 5.1.0` and `@Internal` annotations to clarify changes --- .../integrationtests/testsuite/AbstractIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java index 165a7503f2b..f239d483757 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -16,6 +16,7 @@ package org.axonframework.integrationtests.testsuite; +import org.axonframework.common.annotation.Internal; import org.axonframework.common.configuration.ApplicationConfigurer; import org.axonframework.common.configuration.AxonConfiguration; import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; @@ -41,6 +42,7 @@ * * @since 5.1.0 */ +@Internal public abstract class AbstractIntegrationTest { protected static final Logger logger = LoggerFactory.getLogger(AbstractIntegrationTest.class); From f6ddec6e1fe912ab07f1ccfc7fbd4cdb0e36ab03 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 22:41:19 +0200 Subject: [PATCH 5/7] refactor(integrationtests): simplify AbstractIntegrationTest hooks 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. --- .../testsuite/AbstractIntegrationTest.java | 62 +++++-------------- .../AbstractAdministrationIT.java | 2 +- ...EntityModelAdministrationAxonServerIT.java | 2 +- ...erEntityModelAdministrationInMemoryIT.java | 2 +- ...EntityModelAdministrationAxonServerIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 2 +- ...EntityModelAdministrationAxonServerIT.java | 2 +- ...erEntityModelAdministrationInMemoryIT.java | 2 +- ...EntityModelAdministrationAxonServerIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 2 +- ...EntityModelAdministrationAxonServerIT.java | 2 +- ...onEntityModelAdministrationInMemoryIT.java | 2 +- .../course/SealedClassCourseAxonServerIT.java | 2 +- .../testsuite/course/SealedClassCourseIT.java | 2 +- .../course/SealedClassCourseInMemoryIT.java | 2 +- .../AxonServerTestInfrastructure.java | 2 +- .../InMemoryTestInfrastructure.java | 2 +- .../infrastructure/TestInfrastructure.java | 6 +- .../testsuite/student/AbstractStudentIT.java | 2 +- ...mmandHandlingInterceptorsAxonServerIT.java | 2 +- ...CommandHandlingInterceptorsInMemoryIT.java | 2 +- .../student/CommandPayloadConversionIT.java | 2 +- .../CommandSequencingAxonServerIT.java | 2 +- .../student/CommandSequencingInMemoryIT.java | 2 +- ...rCommandHandlingComponentAxonServerIT.java | 2 +- ...ierCommandHandlingComponentInMemoryIT.java | 2 +- ...entSourcedPooledStreamingAxonServerIT.java | 2 +- ...EventSourcedPooledStreamingInMemoryIT.java | 2 +- ...StateBasedPooledStreamingAxonServerIT.java | 2 +- ...edStateBasedPooledStreamingInMemoryIT.java | 2 +- ...entSourcedPooledStreamingAxonServerIT.java | 2 +- ...EventSourcedPooledStreamingInMemoryIT.java | 2 +- ...oledEventProcessingReportAxonServerIT.java | 2 +- ...PooledEventProcessingReportInMemoryIT.java | 2 +- ...yCommandHandlingComponentAxonServerIT.java | 2 +- ...ityCommandHandlingComponentInMemoryIT.java | 2 +- ...eplayStatusChangedHandlerAxonServerIT.java | 2 +- .../ReplayStatusChangedHandlerInMemoryIT.java | 2 +- ...yCommandHandlingComponentAxonServerIT.java | 2 +- ...ityCommandHandlingComponentInMemoryIT.java | 2 +- ...ntSourceWithEventAppenderAxonServerIT.java | 2 +- ...ventSourceWithEventAppenderInMemoryIT.java | 2 +- 42 files changed, 60 insertions(+), 88 deletions(-) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java index f239d483757..17e99e0a273 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -22,8 +22,6 @@ import org.axonframework.integrationtests.testsuite.infrastructure.TestInfrastructure; import org.axonframework.messaging.commandhandling.gateway.CommandGateway; import org.junit.jupiter.api.AfterEach; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.UUID; @@ -31,12 +29,12 @@ * Infrastructure-agnostic base class for all integration tests in this suite. *

    * Replaces the AxonServer-coupled {@code AbstractAxonServerIT}. The specific backend (AxonServer, in-memory, Postgres, - * …) is supplied by leaf test classes through {@link #createTestInfrastructure()}. + * …) is supplied by leaf test classes through {@link #testInfrastructure()}. *

    * Subclasses must implement: *

      - *
    • {@link #createTestInfrastructure()} — return the infrastructure strategy to use
    • - *
    • {@link #createConfigurer()} — return the domain-specific {@link ApplicationConfigurer}
    • + *
    • {@link #testInfrastructure()} — return the infrastructure strategy to use
    • + *
    • {@link #applicationConfigurer()} — return the domain-specific {@link ApplicationConfigurer}
    • *
    * and must call {@link #startApp()} (typically from a {@code @BeforeEach} method) to start the Axon configuration. * @@ -45,33 +43,25 @@ @Internal public abstract class AbstractIntegrationTest { - protected static final Logger logger = LoggerFactory.getLogger(AbstractIntegrationTest.class); - - protected CommandGateway commandGateway; protected AxonConfiguration startedConfiguration; /** - * Per-test cache of the {@link TestInfrastructure} wrapper, ensuring that {@link TestInfrastructure#start()} and - * {@link TestInfrastructure#stop()} always operate on the same instance. - */ - private TestInfrastructure cachedInfrastructure; - - /** - * Factory method called once per test to obtain the {@link TestInfrastructure} for this test class. Leaf classes - * typically return a {@code private static final} instance: + * Returns the {@link TestInfrastructure} for this test. Leaf classes typically return a {@code private static + * final} instance so the infrastructure wrapper (and any heavy resources it guards, such as a shared + * Testcontainer) is created once per leaf class: *
    {@code
          * private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure();
          *
          * @Override
    -     * protected TestInfrastructure createTestInfrastructure() {
    +     * protected TestInfrastructure testInfrastructure() {
          *     return INFRASTRUCTURE;
          * }
          * }
    * * @return the infrastructure strategy to use for this test */ - protected abstract TestInfrastructure createTestInfrastructure(); + protected abstract TestInfrastructure testInfrastructure(); /** * Returns the domain-specific {@link ApplicationConfigurer} for this test. Called from {@link #startApp()} each @@ -79,40 +69,22 @@ public abstract class AbstractIntegrationTest { * * @return the application configurer for this test */ - protected abstract ApplicationConfigurer createConfigurer(); - - /** - * Returns the cached {@link TestInfrastructure} for the current test, initializing it on first access. - *

    - * This accessor is {@code final} to guarantee that all internal callers ({@link #startApp()}, - * {@link #purgeData()}, {@code @AfterEach}) share the same instance. - * - * @return the infrastructure wrapper for this test - */ - protected final TestInfrastructure testInfrastructure() { - if (cachedInfrastructure == null) { - cachedInfrastructure = createTestInfrastructure(); - } - return cachedInfrastructure; - } + protected abstract ApplicationConfigurer applicationConfigurer(); /** * Shuts down the Axon configuration and releases infrastructure resources acquired during {@link #startApp()}. + * The infrastructure is only stopped when {@link #startApp()} actually completed, signalled by a non-null + * {@link #startedConfiguration}. */ @AfterEach void tearDown() { + if (startedConfiguration == null) { + return; + } try { - if (startedConfiguration != null) { - startedConfiguration.shutdown(); - } + startedConfiguration.shutdown(); } finally { - try { - if (cachedInfrastructure != null) { - cachedInfrastructure.stop(); - } - } finally { - cachedInfrastructure = null; - } + testInfrastructure().stop(); } } @@ -126,7 +98,7 @@ void tearDown() { protected void startApp() { TestInfrastructure infra = testInfrastructure(); infra.start(); - startedConfiguration = createConfigurer() + startedConfiguration = applicationConfigurer() .componentRegistry(infra::configureInfrastructure) .start(); commandGateway = startedConfiguration.getComponent(CommandGateway.class); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java index 42efcb594d9..d4dc8e45c66 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/AbstractAdministrationIT.java @@ -56,7 +56,7 @@ public void doStartApp() { } @Override - protected ApplicationConfigurer createConfigurer() { + protected ApplicationConfigurer applicationConfigurer() { var configurer = EventSourcingConfigurer.create(); return testSuiteConfigurer(configurer); } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java index e52ed4d31c0..9e55e8eee96 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationAxonServerIT.java @@ -28,7 +28,7 @@ public class ImmutableBuilderEntityModelAdministrationAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java index e4463eee058..c90604b7369 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableBuilderEntityModelAdministrationInMemoryIT.java @@ -28,7 +28,7 @@ public class ImmutableBuilderEntityModelAdministrationInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java index d1d945fd953..3f629ec8981 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationAxonServerIT.java @@ -28,7 +28,7 @@ public class ImmutableReflectionEntityModelAdministrationAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java index cb98aea06b3..dde91a8b269 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/ImmutableReflectionEntityModelAdministrationInMemoryIT.java @@ -28,7 +28,7 @@ public class ImmutableReflectionEntityModelAdministrationInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java index e13c8d30884..f4bb2ff353c 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationAxonServerIT.java @@ -28,7 +28,7 @@ public class MutableBuilderEntityModelAdministrationAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java index fdfd6ae8b61..1eaf8db8742 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableBuilderEntityModelAdministrationInMemoryIT.java @@ -28,7 +28,7 @@ public class MutableBuilderEntityModelAdministrationInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java index 237d27114ce..cbd7d53778c 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationAxonServerIT.java @@ -28,7 +28,7 @@ public class MutableReflectionEntityModelAdministrationAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java index cb7260eef58..708ab1b3893 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/MutableReflectionEntityModelAdministrationInMemoryIT.java @@ -28,7 +28,7 @@ public class MutableReflectionEntityModelAdministrationInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java index 515191895e7..798be8fa62d 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationAxonServerIT.java @@ -28,7 +28,7 @@ public class SealedReflectionEntityModelAdministrationAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java index 47b6083115c..e9f9987d968 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/administration/SealedReflectionEntityModelAdministrationInMemoryIT.java @@ -28,7 +28,7 @@ public class SealedReflectionEntityModelAdministrationInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java index 0013b377304..dc2ed9b7c72 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseAxonServerIT.java @@ -27,7 +27,7 @@ public class SealedClassCourseAxonServerIT extends SealedClassCourseIT { private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java index 4bd63c51c35..4d5d5e2bc53 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java @@ -37,7 +37,7 @@ abstract class SealedClassCourseIT extends AbstractIntegrationTest { protected UnitOfWorkFactory unitOfWorkFactory; @Override - protected ApplicationConfigurer createConfigurer() { + protected ApplicationConfigurer applicationConfigurer() { // configuration example see https://github.com/holixon/emn-kotlin/blob/8de05d6f3601df5de3d17e23066b2c7cef836d86/examples/university/src/main/kotlin/faculty/write/renamecoursepolymorph/RenameCoursePolymorphConfiguration.kt final var configurer = EventSourcingConfigurer.create(); final var courseEntity = EventSourcedEntityModule.autodetected(String.class, diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java index 3d99bae88eb..389f6b507db 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseInMemoryIT.java @@ -27,7 +27,7 @@ public class SealedClassCourseInMemoryIT extends SealedClassCourseIT { private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java index 1bc9e76bb2b..b34b914f007 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java @@ -39,7 +39,7 @@ * private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); * * @Override - * protected TestInfrastructure createTestInfrastructure() { + * protected TestInfrastructure testInfrastructure() { * return INFRASTRUCTURE; * } * } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java index 64336f722db..715e36c213d 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java @@ -35,7 +35,7 @@ * private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); * * @Override - * protected TestInfrastructure createTestInfrastructure() { + * protected TestInfrastructure testInfrastructure() { * return INFRASTRUCTURE; * } * } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java index 7937aac6dba..1a2ff1a629e 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java @@ -24,9 +24,9 @@ * AxonServer via Testcontainers, pure in-memory, JDBC, etc.). *

    * An implementation is provided by each concrete leaf test class via - * {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#createTestInfrastructure()}. The base - * class caches the returned instance for the duration of a single test method, so {@link #start()} and {@link #stop()} - * are guaranteed to receive the same object. + * {@link org.axonframework.integrationtests.testsuite.AbstractIntegrationTest#testInfrastructure()}. Leaf classes + * typically return a {@code private static final} singleton, so {@link #start()} and {@link #stop()} are guaranteed to + * receive the same object across test methods. * * @since 5.1.0 */ diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java index 47994e1ae8a..1f989ed25a9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/AbstractStudentIT.java @@ -87,7 +87,7 @@ protected void prepareModule() { } @Override - protected ApplicationConfigurer createConfigurer() { + protected ApplicationConfigurer applicationConfigurer() { var configurer = EventSourcingConfigurer.create() .componentRegistry(cr -> cr.registerModule(studentEntity)) .componentRegistry(cr -> cr.registerModule(courseEntity)); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java index 807d7ab356d..57a5c199862 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsAxonServerIT.java @@ -27,7 +27,7 @@ public class CommandHandlingInterceptorsAxonServerIT extends CommandHandlingInte private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java index a231fa6cdba..a9dc6040ee9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsInMemoryIT.java @@ -27,7 +27,7 @@ public class CommandHandlingInterceptorsInMemoryIT extends CommandHandlingInterc private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java index 4c4f0fef61b..c271eec53e2 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandPayloadConversionIT.java @@ -42,7 +42,7 @@ class CommandPayloadConversionIT extends AbstractCommandHandlingStudentIT { private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java index d4456979b3e..acfa91e99f0 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingAxonServerIT.java @@ -27,7 +27,7 @@ public class CommandSequencingAxonServerIT extends CommandSequencingIT { private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java index e1926c71b10..1f89a8511ca 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingInMemoryIT.java @@ -27,7 +27,7 @@ public class CommandSequencingInMemoryIT extends CommandSequencingIT { private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java index a7ab68ebfc6..1ebeaaaa879 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentAxonServerIT.java @@ -28,7 +28,7 @@ public class CompoundEntityIdentifierCommandHandlingComponentAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java index 608e42ba3d7..39faeace246 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentInMemoryIT.java @@ -28,7 +28,7 @@ public class CompoundEntityIdentifierCommandHandlingComponentInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java index 50d857950b6..c34291a0917 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT.java @@ -28,7 +28,7 @@ public class EventProcessingAnnotatedEventSourcedPooledStreamingAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java index d088a37947e..a5874c49c6a 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT.java @@ -28,7 +28,7 @@ public class EventProcessingAnnotatedEventSourcedPooledStreamingInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java index 3e7b0550b74..67bfe9186b3 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT.java @@ -28,7 +28,7 @@ public class EventProcessingAnnotatedStateBasedPooledStreamingAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java index 11776aa8310..b10aad59774 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT.java @@ -28,7 +28,7 @@ public class EventProcessingAnnotatedStateBasedPooledStreamingInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java index fede6bdc008..406abeaa760 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT.java @@ -28,7 +28,7 @@ public class EventProcessingDeclarativeEventSourcedPooledStreamingAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java index 8a05d2f48ba..50968d42ee3 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT.java @@ -28,7 +28,7 @@ public class EventProcessingDeclarativeEventSourcedPooledStreamingInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java index cf1697e62e5..e70e24b39ef 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportAxonServerIT.java @@ -28,7 +28,7 @@ public class MonitoringPooledEventProcessingReportAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java index faf612a486f..bec1663ecb9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MonitoringPooledEventProcessingReportInMemoryIT.java @@ -28,7 +28,7 @@ public class MonitoringPooledEventProcessingReportInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java index adbd242d502..263613b24bf 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentAxonServerIT.java @@ -28,7 +28,7 @@ public class MultiEntityCommandHandlingComponentAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java index c94d830e0cb..27db5bf6222 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentInMemoryIT.java @@ -28,7 +28,7 @@ public class MultiEntityCommandHandlingComponentInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java index 3ff42158a56..fcbc4a724b5 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerAxonServerIT.java @@ -27,7 +27,7 @@ public class ReplayStatusChangedHandlerAxonServerIT extends ReplayStatusChangedH private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java index 1a9841563d4..188acfd0c3c 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerInMemoryIT.java @@ -27,7 +27,7 @@ public class ReplayStatusChangedHandlerInMemoryIT extends ReplayStatusChangedHan private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java index d48ab071c13..e0bde4ce011 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentAxonServerIT.java @@ -28,7 +28,7 @@ public class SingleEntityCommandHandlingComponentAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java index 877223a1826..e0f34425f2a 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentInMemoryIT.java @@ -28,7 +28,7 @@ public class SingleEntityCommandHandlingComponentInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java index 1fb4a93b360..464c63d5ab0 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderAxonServerIT.java @@ -28,7 +28,7 @@ public class SubscribableEventSourceWithEventAppenderAxonServerIT private static final TestInfrastructure INFRASTRUCTURE = new AxonServerTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java index bf262db2667..c767b3782d7 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderInMemoryIT.java @@ -28,7 +28,7 @@ public class SubscribableEventSourceWithEventAppenderInMemoryIT private static final TestInfrastructure INFRASTRUCTURE = new InMemoryTestInfrastructure(); @Override - protected TestInfrastructure createTestInfrastructure() { + protected TestInfrastructure testInfrastructure() { return INFRASTRUCTURE; } } From d195d660a0cc0596abdd412297639d49234db028 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 14 Apr 2026 22:43:53 +0200 Subject: [PATCH 6/7] test(integrationtests): do not expect `CommandExecutionException`, because it's thrown by `DistirubtedEventBus` only, not by the `SimpleCommandBus` --- .../CompoundEntityIdentifierCommandHandlingComponentIT.java | 2 -- .../student/MultiEntityCommandHandlingComponentIT.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java index 226af5839e0..6007ac613a3 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java @@ -130,12 +130,10 @@ private void verifyMentorLogicForComponent() { // But not a second time assertThatThrownBy(() -> sendCommand(new AssignMentorCommand(student1, student3))) - .isInstanceOf(CommandExecutionException.class) .hasMessageContaining("Mentee already has a mentor"); // And a third student can't become the mentee of the second, because the second is already a mentor assertThatThrownBy(() -> sendCommand(new AssignMentorCommand(student3, student2))) - .isInstanceOf(CommandExecutionException.class) .hasMessageContaining("Mentor already assigned to a mentee"); // But the mentee can become a mentor for a third student diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java index a7feb1ed5ff..781ea2f90e6 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java @@ -116,7 +116,6 @@ void canCombineStatesInLambdaCommandHandlerViaStateManagerParameter() { // But five can not enroll for the first course assertThatThrownBy(() -> enrollStudentToCourse(student5, course1)) - .isInstanceOf(CommandExecutionException.class) .hasMessageContaining("Course already has 3 students"); } @@ -132,7 +131,6 @@ void canHandleCommandThatTargetsMultipleOfTheSameModelInSameAnnotatedCommandHand // But not a second time assertThatThrownBy(() -> sendCommand(new AssignMentorCommand(student1, student3))) - .isInstanceOf(CommandExecutionException.class) .hasMessageContaining("Mentor already assigned to a mentee"); } From ed898876886c0eddedfefa8c959083c48f5f7a96 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Thu, 16 Apr 2026 10:01:04 +0200 Subject: [PATCH 7/7] refactor(integrationtests): update visibility, enhance Javadocs, and 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. --- .../integrationtests/testsuite/AbstractIntegrationTest.java | 5 +++-- .../testsuite/course/SealedClassCourseIT.java | 2 +- .../infrastructure/AxonServerTestInfrastructure.java | 2 +- .../infrastructure/InMemoryTestInfrastructure.java | 6 +++++- .../testsuite/infrastructure/TestInfrastructure.java | 1 + .../testsuite/student/CommandHandlingInterceptorsIT.java | 2 +- .../testsuite/student/CommandSequencingIT.java | 2 +- .../CompoundEntityIdentifierCommandHandlingComponentIT.java | 2 +- .../student/MultiEntityCommandHandlingComponentIT.java | 2 +- .../testsuite/student/ReplayStatusChangedHandlerIT.java | 2 +- .../student/SingleEntityCommandHandlingComponentIT.java | 2 +- .../SubscribableEventSourceWithEventAppenderTest.java | 2 +- 12 files changed, 18 insertions(+), 12 deletions(-) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java index 17e99e0a273..f9682d732b8 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/AbstractIntegrationTest.java @@ -28,8 +28,8 @@ /** * Infrastructure-agnostic base class for all integration tests in this suite. *

    - * Replaces the AxonServer-coupled {@code AbstractAxonServerIT}. The specific backend (AxonServer, in-memory, Postgres, - * …) is supplied by leaf test classes through {@link #testInfrastructure()}. + * The specific backend (AxonServer, InMemory, Postgres, …) is supplied by leaf test classes through + * {@link #testInfrastructure()}. *

    * Subclasses must implement: *

      @@ -38,6 +38,7 @@ *
    * and must call {@link #startApp()} (typically from a {@code @BeforeEach} method) to start the Axon configuration. * + * @author Mateusz Nowak * @since 5.1.0 */ @Internal diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java index 4d5d5e2bc53..1167c68d884 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/course/SealedClassCourseIT.java @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.*; -abstract class SealedClassCourseIT extends AbstractIntegrationTest { +public abstract class SealedClassCourseIT extends AbstractIntegrationTest { protected UnitOfWorkFactory unitOfWorkFactory; diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java index b34b914f007..5bd8a037049 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/AxonServerTestInfrastructure.java @@ -51,7 +51,7 @@ public final class AxonServerTestInfrastructure implements TestInfrastructure { private static final Logger LOG = LoggerFactory.getLogger(AxonServerTestInfrastructure.class); private static final AxonServerContainer CONTAINER = - new AxonServerContainer("docker.axoniq.io/axoniq/axonserver:2025.2.0") + new AxonServerContainer("docker.axoniq.io/axoniq/axonserver:latest") .withAxonServerHostname("localhost") .withDevMode(true) .withReuse(true) diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java index 715e36c213d..531c98b29e9 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/InMemoryTestInfrastructure.java @@ -49,8 +49,11 @@ public final class InMemoryTestInfrastructure implements TestInfrastructure { * on the {@code axon-server-connector} module. The {@link ComponentRegistry#disableEnhancer(String)} overload * treats "enhancer not found on classpath" and "enhancer found and disabled" identically, so this is safe even in * environments where the connector JAR is absent. + *

    */ - private static final String AXON_SERVER_ENHANCER_FQCN = + private static final String AXONIQ_SERVER_ENHANCER_FQCN = + "io.axoniq.framework.axonserver.connector.configuration.AxonServerConfigurationEnhancer"; + private static final String AXON_SERVER_ENHANCER_FQCN = // TODO #4412 - remove as a part of this task "org.axonframework.axonserver.connector.AxonServerConfigurationEnhancer"; @Override @@ -64,6 +67,7 @@ public void configureInfrastructure(ComponentRegistry registry) { // EventSourcingConfigurationDefaults already provides InMemoryEventStorageEngine; // MessagingConfigurationDefaults provides SimpleCommandBus / SimpleQueryBus. registry.disableEnhancer(AXON_SERVER_ENHANCER_FQCN); + registry.disableEnhancer(AXONIQ_SERVER_ENHANCER_FQCN); } @Override diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java index 1a2ff1a629e..1371e3cc32b 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/infrastructure/TestInfrastructure.java @@ -28,6 +28,7 @@ * typically return a {@code private static final} singleton, so {@link #start()} and {@link #stop()} are guaranteed to * receive the same object across test methods. * + * @author Mateusz Nowak * @since 5.1.0 */ @Internal diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java index de1b63aedbc..0b475be6ec6 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandHandlingInterceptorsIT.java @@ -46,7 +46,7 @@ * * @author Mateusz Nowak */ -abstract class CommandHandlingInterceptorsIT extends AbstractCommandHandlingStudentIT { +public abstract class CommandHandlingInterceptorsIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java index 76a5f2ee819..eb9ad9a8ace 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CommandSequencingIT.java @@ -53,7 +53,7 @@ * * @author Jakob Hatzl */ -abstract class CommandSequencingIT extends AbstractCommandHandlingStudentIT { +public abstract class CommandSequencingIT extends AbstractCommandHandlingStudentIT { public static final String ROUTING_KEY_METADATA_KEY = "CommandSequencingIT#routingKey"; diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java index 6007ac613a3..e840cfb9600 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/CompoundEntityIdentifierCommandHandlingComponentIT.java @@ -45,7 +45,7 @@ * * @author Mitchell Herrijgers */ -abstract class CompoundEntityIdentifierCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +public abstract class CompoundEntityIdentifierCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); private final String student3 = createId("student-3"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java index 781ea2f90e6..8d57b555d30 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/MultiEntityCommandHandlingComponentIT.java @@ -49,7 +49,7 @@ * * @author Mitchell Herrijgers */ -abstract class MultiEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +public abstract class MultiEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); private final String student3 = createId("student-3"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java index 8231928d0e9..e7bfd23c5d1 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/ReplayStatusChangedHandlerIT.java @@ -55,7 +55,7 @@ * @author Steven van Beelen * @since 5.1.0 */ -abstract class ReplayStatusChangedHandlerIT extends AbstractStudentIT { +public abstract class ReplayStatusChangedHandlerIT extends AbstractStudentIT { private static final String PSEP_NAME = "replayStatusChangeHandler"; diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java index 0c5a3376f1d..eb69ecfafc5 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SingleEntityCommandHandlingComponentIT.java @@ -36,7 +36,7 @@ * * @author Mitchell Herrijgers */ -abstract class SingleEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { +public abstract class SingleEntityCommandHandlingComponentIT extends AbstractCommandHandlingStudentIT { private final String student1 = createId("student-1"); private final String student2 = createId("student-2"); diff --git a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java index cc2bd2a3ac8..1f1e7a12b31 100644 --- a/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java +++ b/integrationtests/src/test/java/org/axonframework/integrationtests/testsuite/student/SubscribableEventSourceWithEventAppenderTest.java @@ -43,7 +43,7 @@ * @author Mateusz Nowak * @since 5.0.0 */ -abstract class SubscribableEventSourceWithEventAppenderTest extends AbstractStudentIT { +public abstract class SubscribableEventSourceWithEventAppenderTest extends AbstractStudentIT { @Test void whenEventPublishedViaEventAppenderThenSubscriberReceivesEvent() {