2025-01
Cohesion: Cohesion refers to the degree to which the elements within a module, class, or component of a software system work together to perform a single, well-defined task.
Coupling: Coupling refers to the degree of interdependence between software modules, classes, or components. It measures how much one module relies on another to function correctly.
Leverages Spring's Own Application Event Publisher
Provides Event persistence (JPA, JDBC, others)
Provides Externalization abstraction (JMS, AMQP, Kafka)
Opens the architecture to other useful patterns (outbox pattern, CQRS, audit ...)
Verification Includes:
@ApplicationModule(allowedDependencies = …)
// Custom annotation that bootstraps only required module(s) @ApplicationModuleTest class SomeApplicationModuleTest { @Test public void someModuleIntegrationTest(Scenario scenario) { // Use the Scenario API to define your integration test } }
@Test void testName(Scenario scenario) { // Start with an event publication scenario.publish(new MyApplicationEvent(…)).… // Start with a bean invocation scenario.stimulate(() -> someBean.someMethod(…)).… // Verification // Executes the scenario ….toArrive(…) // Execute and define assertions on the event received ….toArriveAndVerify(event -> …) ...andWaitForStateChange(() -> someBean.someMethod(…))) .andVerify(result -> …); }