generator-jhipster
generator-jhipster copied to clipboard
Investigate Spring Boot 3.1's Testcontainers support to see if it simplifies things
Overview of the feature request
Investigate using Spring Boot 3.1's Testcontainers and @ServiceConnector
annotation to reduce boilerplate
Motivation for or Use Case
This video gives a good overview:
https://www.youtube.com/watch?v=UuLD9gZmiZU
Related issues or PR
- [x] Checking this box is mandatory (this is just to show you read everything)
Testcontainer is just a game changer option, would be great to add it. It is already available on Spring Boot 3.1.0 rc1 https://spring.io/blog/2023/04/22/spring-boot-3-1-0-rc1-available-now
Here's another blog post that explains how it works. https://www.atomicjar.com/2023/05/spring-boot-3-1-0-testcontainers-for-testing-and-local-development/
If no one is working on this issue, I can make a PR. I have already worked few hours on SB 3.1 and testcontainers
I have mixed fillings about the feature. For the following reasons:
- testcontainer integration with tests outside spring-boot scope like gatling.
- we should take care about testcontainers restarts due to our CI time.
- may be reused by java based blueprints.
If the feature meets 1 and 2, I'm in favor.
Point 1 will require extra help. I'm not sure to succeed by myself About the point 2 we can use restart true provided by testcontainers. It's an experimental feature but it's only for our tests (not for the production code)
Baeldung made a really nice article on the support: https://www.baeldung.com/spring-boot-built-in-testcontainers It can also avoid restarting containers in local dev (somewhat we succeed to achieve kind of clunkily)