generator-jhipster icon indicating copy to clipboard operation
generator-jhipster copied to clipboard

Investigate Spring Boot 3.1's Testcontainers support to see if it simplifies things

Open mraible opened this issue 1 year ago • 6 comments

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)

mraible avatar Apr 18 '23 14:04 mraible

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

BrayanMnz avatar Apr 25 '23 04:04 BrayanMnz

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/

mraible avatar May 17 '23 15:05 mraible

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

fleboulch avatar Sep 28 '23 11:09 fleboulch

I have mixed fillings about the feature. For the following reasons:

  1. testcontainer integration with tests outside spring-boot scope like gatling.
  2. we should take care about testcontainers restarts due to our CI time.
  3. may be reused by java based blueprints.

If the feature meets 1 and 2, I'm in favor.

mshima avatar Sep 28 '23 14:09 mshima

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)

fleboulch avatar Sep 28 '23 15:09 fleboulch

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)

Tcharl avatar Dec 08 '23 22:12 Tcharl