Questions tagged [testcontainers-junit5]
89 questions
2
votes
5 answers
Spring Boot Integration Testing with TestContainers with MySql - BeanDefinitionStoreException
I'm trying to implement an integration test using TestContainers. But I'm continuously getting BeanDefinitionStoreException.
My Test Class
@SpringBootTest
@AutoConfigureMockMvc
class OrderServiceApplicationTests {
@Container
static…

codezoner
- 1,054
- 2
- 13
- 32
2
votes
1 answer
How Do I Override the Bootstrap Servers' Configuration Dynamically when Using Kafka Testcontainers in Spring Boot?
I'm working on integration tests using Kafka Testcontainers. The container starts up, and reads the bootstrap servers' configuration that is set in the application.yml.
Since the Testcontainers port is created dynamically, I'm using…

Tony Langworthy
- 130
- 2
- 8
2
votes
0 answers
How can I create container in azurite running from test container in java?
I am trying to test azure file upload using azurite docker image from test container below is code I am using for the same
public class AzureContainer {
public static AzureContainer INSTANCE = new AzureContainer();
private static final…

user13906258
- 161
- 1
- 13
2
votes
1 answer
Speed up Elasticsearch Test Containers
I have moved the java integration tests to use elasticsearch test containers instead of using embedded elasticsearch. The tests have become slower by 1 hour which is a huge productivity hit. I am looking for ways to speed that up.
I tried using…

A_G
- 2,260
- 3
- 23
- 56
2
votes
2 answers
Testcontainers do not start after replacing Docker Desktop with minikube
I want to make my testcontainers in Java integration tests work with minikube replacing Docker Desktop.
I followed below article to get started:
https://www.atomicjar.com/2021/10/docker-on-windows-and-macos/#minikube
This is what I've got in…

tyro
- 577
- 8
- 17
2
votes
2 answers
Test Containers work normally locally Windows but not when Jenkins is running the tests
I have some testcontainers running for my junit intergration tests (Spring Boot, Junit 5)
public static PostgreSQLContainer> postgresContainer= new PostgreSQLContainer<>("postgres:13")
.withDatabaseName("test")
…

Newboz
- 69
- 6
2
votes
1 answer
How to make a common @Testcontainer for multiple Jupiter tests?
I have an abstract controller test class and its inheritor with units, but I want to separate tests into different classes according to the controller method they are testing. Every time I create the second test-class and put a test in it I get the…

Nikita Kozhukharov
- 21
- 2
2
votes
1 answer
How do we skip executing init script on reusable container?
When using reusable container with init script, it runs the script every time the test start even though same DB is being reused. In init script I have create and insert statements so every time I run the test, it tries to execute the sql statements…

tejas jethva
- 35
- 3
2
votes
3 answers
Testcontainers loss of connection after some tests running
I'm using testcontainer in my oss software but i think there is a problem in my configurations or in the docker/testcontainer runtime...
I have some tests and when they are running separated, everything works fine but when I try to run all tests the…

Arthur
- 73
- 7
2
votes
1 answer
Wait till container starts in testcontainers with GenericContainer for custom PostgreSQL image
I'm developing system/integration tests based on Testcontainers solution. It is required for me to use our own database PostgreSQL image with already applied database schema.
For this reason I'm using Testcontainers GenericContainer.
private static…

Bohdan Myslyvchuk
- 1,657
- 3
- 24
- 39
2
votes
1 answer
cannot get docker image while using TestContainer
I am having a junit test written using test container (https://www.testcontainers.org/). when I run my test I get the following stack trace.
com.github.dockerjava.api.exception.UnauthorizedException: Status 401: {"message":"Get…

Starbucks Admin
- 585
- 1
- 8
- 21
2
votes
1 answer
testcontainers: can't initialize DockerComposeContainer
I'm using testcontainers (https://www.testcontainers.org) to perform integration tests. The test case requires an Oracle database and an Eclipse Microprofile compliant platform which, in my case, is Wildfly 20. I have the following…

Seymour Glass
- 81
- 2
- 15
1
vote
0 answers
Spring Boot integration test failing with Testcontainers and Gradle in Docker container
I have the following integration test setup for Kafka producer consumer application.
@Testcontainer
@DirtiesContext
@SpringBootTest
@ExtendWith(SpringExtension.class)
public class KafkaIntegrationTest {
@Container
private static final…

Dave
- 25
- 5
1
vote
0 answers
Issues with test container when running integration tests gradle task
I have this integration test base that test classes extend from, running one test class or a single test works without issues but if I try to run gradle task to run all tests I'm having this…

dev-rifaii
- 217
- 2
- 9
1
vote
1 answer
Tests using Postgres images via Testcontainers time out
I'm working on a Spring Boot project with a Postgres database backend where JUnit 5 and Testcontainers is used for integration tests that involve database access.
Testcontainers is set up by modifying the JDBC URL like this:
spring:
datasource:
…

anothernode
- 5,100
- 13
- 43
- 62