-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare @Testcontainers
before @SpringBootTest
in documentation examples to ensure that Testcontainers is started before the application tries to use its containers
#35572
Comments
The ordering of the Can you please try the following and let us know if it works: @Testcontainers
@SpringBootTest
public class OrderServiceTest { |
Hi @wilkinsona Thank you for the quick response. @Testcontainers
@SpringBootTest
public class OrderServiceTest { Can you please update the documentation? |
Thanks for trying the other order. What I wrote earlier was a bit too absolute as I've just reminded myself that the ordering doesn't always matter. I'd like to understand why it mattered in your case. To help with that, could you share a minimal sample that reproduces the problem you had with the "wrong" ordering? |
I just figured out what causes such behavior. It's that dependency: <dependency>
<groupId>io.zonky.test</groupId>
<artifactId>embedded-database-spring-test</artifactId>
<version>2.3.0</version>
<scope>test</scope>
</dependency> If I remove it then ordering doesn't matter. |
Thanks, @sergey-morenets. I guess that |
@Testcontainers
before @SpringBootTest
in documentation examples to ensure that Testcontainers is started before the application tries to use its containers
Thank you for your efforts. |
Hi
I tried to use integration of Spring Boot & TestContainers added in Spring Boot 3.1.0. So I took this example from official Spring Boot documentation:
and create my test based on this template:
However I've got an exception running the test:
Spring Boot: 3.1.0
The text was updated successfully, but these errors were encountered: