Skip to content

Commit 7b47b45

Browse files
Update spring boot 4 - build kotlin-service
1 parent 86b6060 commit 7b47b45

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)