-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Description
Two issues are unclear in documentation
-
Probably outdated examples with
@Testcontainers
Every example contains@Testcontainersannotation. It seems be unnecessary. For example, Spring Initializer generates working test classes without the annotation. (If I'm right, I can create PR with@Testcontainersremoval) -
Two methods to register Container without explanation
Container can be registered with@org.testcontainers.junit.jupiter.Containerannotation 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.@Containeris 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)