Questions tagged [testcontainers]

TestContainers is a Java library that supports (JUnit) tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.

Define your test dependencies as code, then simply run your tests and containers will be created and then deleted.

https://www.testcontainers.org/

881 questions
0
votes
1 answer

Testcontainer Keycloak does not connect to Testcontainer PostgreSQL

I am deploying two Testcontainers, one with an image of PostgreSQL (12.0) and another one with Keycloak (8.0.0). The PostgreSQL one starts successfully, but when the Keycloak one tries to connect to PostgreSQL returns a connection refused. I put all…
ourobor93
  • 372
  • 1
  • 7
  • 21
0
votes
1 answer

Exclude embedded.mongodb.enabled for certain test

I'm working here on some tests, I start from the bottom, reactiveRepository and successfully wrote all necessary tests with com.playtika.testcontainers.embedded-mongodb and embedded.mongodb.enabled: true in test/resources bootstrap.yml Now I moved…
Bryksin
  • 2,322
  • 3
  • 19
  • 31
0
votes
1 answer

Ubuntu TestContainers unable to connect to Postgis:9.5

I have the following definition of TestContainers (version 1.12.2) module prepared to test liquibase schema in our app. When trying to execute I'm receiving Connection Refused error like it would not exist, however during run of the test I've…
ashur
  • 4,177
  • 14
  • 53
  • 85
0
votes
1 answer

Integration tests with Quorum

I am developing some integration tests (meant to be executed within a dedicated maven goal) for a Java project that relies on jpmorganchase quorum. The project interacts with several other services each running in its own docker container hence I…
João Matos
  • 6,102
  • 5
  • 41
  • 76
0
votes
1 answer

Is it possible to set SpringBootTest properties on the fly?

I have a SpringBoot application which I am trying to test with the help of Testcontainers. I have something like: @SpringBootTest public class DummyIT { @ClassRule public static PostgreSQLContainer postgreSQLContainer = new…
João Matos
  • 6,102
  • 5
  • 41
  • 76
0
votes
1 answer

Start testcontainers before Playframework starts up

I want to start testcontainers from a docker-compose file (postgres and kafka instance), before the play application (with slick) starts up. I want this, so I can write a end to end test. I can not seem to figure out how this is possible with…
ielkhalloufi
  • 652
  • 1
  • 10
  • 27
0
votes
1 answer

Why does mysql testcontainers require jdbc connection properties to run?

Clone the problematic repo All I want to do is use testcontainers to gin up a dockerized mysql instance to run integration tests with. Is that too much to ask? High level, I want to hit a GET endpoint, and confirm that the response is in line with…
notacorn
  • 3,526
  • 4
  • 30
  • 60
0
votes
1 answer

MySQL: java.sql.SQLException: Referencing column and referenced column in foreign key constraint 'INCORRECT_ANSWER_FK01' are incompatible

I have been working with a MySQL test container for my integration tests, and recently, it stopped working, claiming there was an issue with one of my foreign keys (and I don't believe I made any SQL changes since the last time I ran the tests, in…
0
votes
1 answer

Silence Exceptions on closing ssl connection with mysql and spring boot

I have (spring boot) integration tests that use a test container for a (mysql)database. When the tests end (even if they are successful), I get an ssl exception (see below). I've looked around, and it seems this is an error with the mysql driver. …
Connor Butch
  • 648
  • 1
  • 10
  • 28
0
votes
0 answers

Getting java.lang.ClassNotFoundException: com.sun.jna.Platform , with TestContainers GenericContainer

Am getting below exception when trying to run integration test which has TestCOntainers GenerciContainer for redis public GenericContainer redis = new GenericContainer<>("redis:3.0.6") …
Bravo
  • 8,589
  • 14
  • 48
  • 85
0
votes
0 answers

Arquillian & Testcontainers: Invalid Oracle URL

I'm trying to embed a Database-Testcontainer in an existing arquillian-test with embedded-glassfish as a container. I'm using a JNDI-datasource defined in a glassfish-resources.xml- and a persistence.xml-File. That's why I'm trying to use the…
Ben
  • 447
  • 4
  • 13
0
votes
2 answers

Issue using @Transactional annotation above integration test class for multithreading environment

When I run the integration test for code which calls JPA repository within a new thread, I'm getting data that was populated during starting PostgreSQLContainer and I can't receive data from the script above class test( @Sql(scripts ="data.sql"). …
arakorno
  • 3
  • 1
  • 4
0
votes
1 answer

Why testcontainers restarts contener between test classess

I've noticed that test containers is restarting container. It happens when I am executing tests, between Test classes. First test class tests connects to container without issue, but then in next class port which is bind to host is incremented…
masterdany88
  • 5,041
  • 11
  • 58
  • 132
0
votes
1 answer

Failed to evaluate condition [org.testcontainers.junit.jupiter.TestcontainersExtension]

I am getting such error with test containers org.junit.jupiter.engine.execution.ConditionEvaluationException: Failed to evaluate condition [org.testcontainers.junit.jupiter.TestcontainersExtension]: Illegal state: required test class is not present…
masterdany88
  • 5,041
  • 11
  • 58
  • 132
0
votes
2 answers

Docker-Compose version is unsupported

I'm using TestContainers to run dgraph. Here is my test code: package net.dgraph.java.client import io.dgraph.DgraphAsyncClient import io.dgraph.DgraphClient import org.testcontainers.containers.DockerComposeContainer import…
ai.jennetta
  • 1,076
  • 2
  • 10
  • 25