Category : testcontainers

I’m trying to run Couchbase v.5.1.1 docker container for test purposes via Test container with fixed exposed ports, like: trait CouchbaseTestEnvironment extends ForAllTestContainer { this: Suite => def couchbaseContainer: FixedHostPortGenericContainer = { val consumer = new Slf4jLogConsumer(LoggerFactory.getLogger(getClass)) /* * Couchbase should know which ports are exposed for client, because this is how it exposes services. ..

Read more

I wrote a web service using Spring Boot listening at port 8443. I expose the port 8443 in the Dockerfile and start the container using docker run –name container-name -it image-name -p 127.0.0.1:8443:8443 option. Despite this I can’t reach the app using curl https://127.0.0.1:8443/endpoint -k -v even though the same command works when run inside ..

Read more

I’m doing integration testing with TestContainers and trying to enable SASL so I can keep the same configuration file and not duplicate code. public static KafkaContainer kafka = new KafkaContainer(DockerImageName.parse(KAFKA_TEST_IMAGE)) .withNetwork(Network.newNetwork()) .withEnv("KAFKA_AUTO_CREATE_TOPICS_ENABLE", "false") .withEnv("KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND", "true") .withEnv("KAFKA_SUPER_USERS", "User:OnlySuperUser") // .withEnv("KAFKA_CFG_SASL_ENABLED_MECHANISMS", "PLAIN") // .withEnv("KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL", "SASL_PLAINTEXT") .withEnv("KAFKA_SASL_ENABLED_MECHANISMS", "PLAIN,SASL_PLAINTEXT") .withEnv("KAFKA_SASL_JAAS_CONFIG", JAAS_CONFIG); Here is what I’m playing with, but I ..

Read more

I am using testcontainers for the integration test where I create a container. But its failing with following error: Step failed org.testcontainers.containers.ContainerLaunchException: Container startup failed ….. Caused by: org.testcontainers.containers.ContainerFetchException: Can’t get Docker image: RemoteDockerImage(imageName=<my-docker-image>:latest, imagePullPolicy=DefaultPullPolicy()) at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1282) at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:616) at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:321) at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:312) …. By looking at the error it looks like it is not ..

Read more

Here’s the thing – trying to handle the case when during a test, which involves sending something to a kafka topic through KafkaTemplate, trips over the "Rebalancing topic something" and looses the message. The configuration is rather simple: KafkaContainer KafkaAdmin -> AdminClient -> create topics SchemaRegistry ProducerFactory ConsumerFactory KafkaTemplate and there go the tests. The ..

Read more

I’m using the following library to initiate embedded maria DB container from a Java Spring app: com.playtika.testcontainers.embedded-mariadb https://mvnrepository.com/artifact/com.playtika.testcontainers/embedded-mariadb This class from the 3rd party is used to initiate the container as a Spring bean: @Slf4j @Configuration @ConditionalOnExpression("${embedded.containers.enabled:true}") @AutoConfigureAfter(DockerPresenceBootstrapConfiguration.class) @ConditionalOnProperty(name = "embedded.mariadb.enabled", matchIfMissing = true) @EnableConfigurationProperties(MariaDBProperties.class) public class EmbeddedMariaDBBootstrapConfiguration { @Bean(name = BEAN_NAME_EMBEDDED_MARIADB, destroyMethod = "stop") ..

Read more