Questions tagged [spring-boot-testcontainers]

9 questions
0
votes
1 answer

TestContainers with Spring Boot 3.0 and Keycloak: Should I use Keycloak Container for Unit or Integration Tests?

I'm in the process of exploring TestContainers with Spring Boot 3.0 for my Hello World application which has security-enabled endpoints. In the past, I relied on mocked tokens for unit testing purposes. However, with the integration of…
0
votes
0 answers

How to run docker-compose file using testContainers in spring boot tests?

I have following docker-compose file for local development: version: '3.4' services: samba: image: instantlinux/samba-dc:latest hostname: my.org environment: DOMAIN_ACTION: provision REALM: my.org volumes: -…
0
votes
1 answer

How to use @ServiceConnection with GenericContainer and custom ConnectionDetails

I am using new @ServiceConnection annotation to manage KafkaContainer in my tests and it works as expected - KafkaContainerConnectionDetails is used during auto configuration to override bootstrap servers property. Now, i also want to use custom…
0
votes
1 answer

Testcontainers start before Spring app and shut down after Spring App

I have this integration test: @RunWith(SpringRunner.class) @SpringBootTest(classes = MySpringApplication.class, webEnvironment = DEFINED_PORT) public class UspControllerIT { @Test public void someIntegrationTest() { ... } } My…
0
votes
0 answers

Spring boot testcontainers configured via properties to use r2dbc throws java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

This is my application-it.yml file: spring: r2dbc: url: r2dbc:tc:mysql:///warehouse-db?TC_IMAGE_TAG=latest Here are my dependencies from pom.xml: org.springframework.boot
0
votes
0 answers

Integration tests for spring boot application invoked with aws msk event

We have a spring boot application integrated with AWS managed Kafka. We want to test 2 flows - Event listener on the application. That process event and writes data from it to db. Get API on the application that refers to DB and provides data. We…
0
votes
0 answers

How to configure Testcontainers to work with a discovery service to work both for API Gateway and Feign

I'm building a system test platform with multiple services in Spring Boot 3 with Maven. I'm using reactive services. Junit, the Failsage plugin, and Testcontainers to run the tests I run my tests in an API Gateway service module with…
0
votes
1 answer

Running Spring Boot Application in Dev Mode causes beans to be duplicated

I want to run my Spring Boot application in the dev mode: My main (prod app): fun main(args: Array) { runApplication(args = args, init = { addInitializers(BeansInitializer()) }) } App in the dev mode: import…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
2 answers

Spring Boot TestContainers Create application from an existing main method in Kotlin

I have a Spring Boot application: @SpringBootApplication class MyApp fun main(args: Array) { val initConfig: SpringApplication.() -> Unit = { addInitializers(BeansInitializer()) } runApplication(args = args, init…
pixel
  • 24,905
  • 36
  • 149
  • 251