Description
Two issues are unclear in documentation
-
Probably outdated examples with
@Testcontainers
Every example contains@Testcontainers
annotation. It seems be unnecessary. For example, Spring Initializer generates working test classes without the annotation. (If I'm right, I can create PR with@Testcontainers
removal) -
Two methods to register Container without explanation
Container can be registered with@org.testcontainers.junit.jupiter.Container
annotation or as a Spring@Bean
. Which one is better for which case? On one hand, Spring Initializer generates@Bean
, so it looks as recommended. On the other hand, Spring Boot Reference begins with@Container
, to it looks as primary decision hint.@Container
is a bit boilerplate-less, so the hint looks reasonable.
As a developer, which method should I choose at the beginning?
(ref: https://docs.spring.io/spring-boot/reference/testing/testcontainers.html)