We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86b6060 commit 7b47b45Copy full SHA for 7b47b45
kotlin-service/src/test/kotlin/com/microservice/kotlin/TestcontainersConfiguration.kt
@@ -0,0 +1,16 @@
1
+package com.microservice.kotlin
2
+
3
+import org.springframework.boot.test.context.TestConfiguration
4
+import org.springframework.boot.testcontainers.service.connection.ServiceConnection
5
+import org.springframework.context.annotation.Bean
6
+import org.testcontainers.mongodb.MongoDBContainer
7
+import org.testcontainers.utility.DockerImageName
8
9
+@TestConfiguration(proxyBeanMethods = false)
10
+class TestcontainersConfiguration {
11
+ @Bean
12
+ @ServiceConnection
13
+ fun mongoDbContainer(): MongoDBContainer {
14
+ return MongoDBContainer(DockerImageName.parse("mongo:latest"))
15
+ }
16
+}
0 commit comments