Questions tagged [testcontainers-junit5]

89 questions
1
vote
2 answers

Parameterized testcontainer image tag with Junit5

In the Testcontainers documentation, there is an example for having the docker image to be parameterized with @ParameterizedTest. This was a junit4…
Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
1
vote
1 answer

How to combine SpringBootTest and Testcontainers with fake-gcs-server container

I am trying to write a test case for testing read/write access to a Google Cloud Bucket using Spring Boot (v2.7.5). For this I tried to use the 'Testcontainer' framework in combination with a fake Google Cloud Storage container…
1
vote
2 answers

How to copy a file from a container to another container using TestContainers?

I use TestContainers for my integration tests. Currently, I use withCopyFileToContainer(MountableFile.forClassPathResource(...)) to copy some files from the host to a test container when starting the test container (so the service in which the tests…
1
vote
1 answer

InternalServerErrorException: Status 500: not a directory with localstack

I'm attempting to run a localstack container as part of a test in a spring boot test. I setup a new spring boot app using the initializr, however I don't understand why I'm getting the following error when calling…
1
vote
0 answers

import bak file to sql server test container

in my scenario, I need to automate the flyway migration testing in the pipelines. before starting flyway for executing DB migration I need to import a bak file to init my database structure how can I import the SQL server backup file to JUnit…
1
vote
1 answer

How do I use JUnit 5 with testcontainers in a custom network?

I can't seem to get the following the following scenario to work. I am trying to create a scenario where two containers talked with each other on a separate network using JUnit 5 constructs. @Testcontainers class TestContainerTests { @BeforeAll …
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
1
vote
1 answer

Quarkus and Selenium TestContainer- how to trigger recording

I am having trouble getting Selenium TestContainers to record the tests for me. I am using TestContainers in Quarkus. The Quarkus way to deal with setting up test resources in a QuarkusTestResourceLifecycleManager class, as…
1
vote
1 answer

Connection refused with Elasticsearch test container even after adding wait

I'm trying to move the application to write tests using Elasticsearch container. The container does come up and checking its elasticsearchContainer.isRunning() status returns true but while making a search request Connection Refused exception is…
A_G
  • 2,260
  • 3
  • 23
  • 56
1
vote
1 answer

TestContainer running a Selenium Chrome Driver, java.lang.NoSuchMethodError

I am trying to run a Selenium test via a TestContainer. This is failing via a NoSuchMethodError on ChromeOptions .addArguments(String...s) However, if I call this directly from a test it passes and the addArguments(String...s) method is found,…
1
vote
0 answers

Gradle JUnit/Jupiter testing - Setup specific contexts per test classes groups?

The application I am working on requires that different contexts are created depending on the JUnit tests to be run. Specifically, say I have five test classes - ClassOneTest.class, ClassTwoTest.class, ..., ClassFiveTest.class. I also use the…
1
vote
0 answers

Why do specific comments cause the init.sql file to fail in a mysql test container when testing with spring boot?

Comments that contain # which are perfectly valid in mysql 5.7 according to: https://dev.mysql.com/doc/refman/5.7/en/comments.html seem to break the init file for a mysql docker test container. When I initialize a datasource in the…
1
vote
1 answer

Jooq native query doesn't use connection information

Inside my integration test I configured my dslContext String connectionURL = mariaDBContainer.getJdbcUrl(); String username = mariaDBContainer.getUsername(); String pw = mariaDBContainer.getPassword(); DSLContext dslContext =…
jcomouth
  • 324
  • 3
  • 16
1
vote
1 answer

Unable to autorun sql scripts via the @Sql annotation

I absolutely need to use non-static methods with annotations @BeforeAll and @AfterAll. But these annotations work on non-static methods only if we have…
skyho
  • 1,438
  • 2
  • 20
  • 47
1
vote
1 answer

Test containers not deleted from docker after JUnit 5 all class tests completed

I am using the test container for integration testing and end-to-end testing of the micronaut application. Here is the configuration for the test container @Testcontainers public abstract class TestContainerFixture { protected static final…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
1
vote
0 answers

Testcontainers custom internal network with exposed port

I want to write integration test in java for spring boot app using hazelcast and mongo database: spring app is using hazelcast - hazelcast has to expose port to spring app, spring app has to know it hazelcast is using mongo database, hazelcast has…