Contexts as a single deployment unit. Easy to refactor Easy to test the overall system Likely to degrade unless explicitly managed Harder to test individual Bounded Contexts
deployment artifact. Often parts of the context are even deployed as separate processes. ◦ Bounded Context interaction is remote ◦ Testing individual modules Hard to refactor context boundaries Hard to test the overall system
Packages directly nested underneath the main application package are considered context ones. 2. Test support to bootstrap modules Integration with Spring test context framework and Spring Boot integration test support to limit bootstrap (component & entity scanning) to only the involved packages.
{ … } package com.acme.moduleA @ModuleTest // Instead of @SpringBootTest class MyModuleTests { … } Applies package conventions Bootstraps single module for test
and entities of other modules. 2. Component dependency References to other Spring beans, required to bootstrap the module 3. Events & event listeners Dependency on some other module’s event type. Interesting as they’re great hooks for testing.
and entities of other modules. 2. Component dependency References to other Spring beans, required to bootstrap the module 3. Events & event listeners Dependency on some other module’s event type. Interesting as they’re great hooks for testing. ☝Avoid!
is contained in. Components in other modules the bootstrapped module depends on need to be provided through @MockBean. 2. Direct dependencies Bootstraps the module including the modules it directly depends on. Transitive dependencies have to be mocked just like in standalone mode. 3. All dependencies Bootstraps the entire sub-tree of modules starting from the current one.
Packages directly nested underneath the main application package are considered context ones. 2. Test support to bootstrap modules Integration with Spring test context framework and Spring Boot integration test support to limit bootstrap (component & entity scanning) to only the involved packages. 3. Simple set of access rules and API to verify Only access components in module API packages.
Packages directly nested underneath the main application package are considered context ones. 2. Test support to bootstrap modules Integration with Spring test context framework and Spring Boot integration test support to limit bootstrap (component & entity scanning) to only the involved packages. 3. Simple set of access rules and API to verify Only access components in module API packages. 4. Documentation support PlantUML integration via Simon Brown’s Structurizr to document module structure and dependency types.
artifact. Dedicated control over dependencies Test scope is defined by the artifact Potential explosion of number of artifacts Internal structure visible to the outside
Packages directly nested underneath the main application package are considered context ones. 2. Test support to bootstrap modules Integration with Spring test context framework and Spring Boot integration test support to limit bootstrap (component & entity scanning) to only the involved packages. 3. Simple set of access rules and API to verify Only access components in module API packages. 4. Documentation support PlantUML integration via Simon Brown’s Structurizr to document module structure and dependency types.