- Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
type: bugA general bugA general bug
Milestone
Description
I am using spring-boot-3.1.0-SNAPSHOT with Spring Data JPA, Postgres, Testcontainers.
For local development, I have created TestcontainersConfiguration.java
and TestApplication.java
under src/test/java
as follows:
@TestConfiguration(proxyBeanMethods = false) public class TestcontainersConfiguration { @Bean @ServiceConnection public PostgreSQLContainer<?> postgreSQLContainer() { return new PostgreSQLContainer<>("postgres:15.2-alpine"); } }
public class TestApplication { public static void main(String[] args) { SpringApplication .from(Application::main) .with(TestcontainersConfiguration.class) .run(args); } }
When I run TestApplication.java from IDE then Testcontainers is starting the Postgres database and application is working fine.
Problem:
But, if I add spring-boot-devtools
dependency and run TestApplication.java then Testcontainers integration is stopped working. ie, Postgres container is not being started and application startup is failing.
Reproducer: https://github.com/sivaprasadreddy/spring-boot-testcontainers-devmode
In pom.xml uncomment spring-boot-devtools
dependency and run to reproduce the problem.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug