hexagonal-architecture-java icon indicating copy to clipboard operation
hexagonal-architecture-java copied to clipboard

MongoDB persistence adapter with Test Containers

Open alfredorueda opened this issue 1 year ago • 0 comments

Sven's practical approach to explaining hexagonal architecture is fantastic. Adding a persistence adapter that uses a non-relational technology is relevant, demonstrating even more explicitly that the rich domain can be fully reused.

MongoDB is a successful non-relational database system in the industry and integrates well into the Spring ecosystem. That is why it has been selected as an additional adapter in this excellent hexagonal architecture example. All tests, both unit tests and end-to-end tests, passed successfully.

The Singleton pattern was implemented to use the same MongoDB Docker container in both tests. I would be happy to receive feedback on how to improve this implementation: See: https://java.testcontainers.org/test_framework_integration/manual_lifecycle_control/#singleton-containers

Of course, I am also happy to provide top-quality documentation on par with Sven's original documentation.

image

Co-authored-by: Francisco José Nebrera [email protected]

alfredorueda avatar Dec 20 '24 12:12 alfredorueda