Use Testcontainers BOM
* Rework `MongoDbContainerTest` to explicit `MongoDBContainer`
This commit is contained in:
@@ -164,6 +164,7 @@ allprojects {
|
||||
mavenBom "io.micrometer:micrometer-bom:$micrometerVersion"
|
||||
mavenBom "io.micrometer:micrometer-tracing-bom:$micrometerTracingVersion"
|
||||
mavenBom "org.apache.camel:camel-bom:$camelVersion"
|
||||
mavenBom "org.testcontainers:testcontainers-bom:$testcontainersVersion"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -268,7 +269,7 @@ configure(javaProjects) { subproject ->
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"
|
||||
testImplementation 'org.testcontainers:junit-jupiter'
|
||||
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
@@ -719,7 +720,7 @@ project('spring-integration-jdbc') {
|
||||
testImplementation "org.postgresql:postgresql:$postgresVersion"
|
||||
testImplementation "mysql:mysql-connector-java:$mysqlVersion"
|
||||
testImplementation "org.apache.commons:commons-dbcp2:$commonsDbcp2Version"
|
||||
testImplementation "org.testcontainers:mysql:$testcontainersVersion"
|
||||
testImplementation 'org.testcontainers:mysql'
|
||||
|
||||
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
|
||||
}
|
||||
@@ -801,6 +802,8 @@ project('spring-integration-mongodb') {
|
||||
}
|
||||
optionalApi "org.mongodb:mongodb-driver-sync:$mongoDriverVersion"
|
||||
optionalApi "org.mongodb:mongodb-driver-reactivestreams:$mongoDriverVersion"
|
||||
|
||||
testImplementation 'org.testcontainers:mongodb'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.bson.Document;
|
||||
import org.bson.UuidRepresentation;
|
||||
import org.bson.conversions.Bson;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.MongoDBContainer;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -66,8 +66,7 @@ import com.mongodb.client.MongoCollection;
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
public interface MongoDbContainerTest {
|
||||
|
||||
GenericContainer<?> MONGO_CONTAINER = new GenericContainer<>("mongo:5.0.9")
|
||||
.withExposedPorts(27017);
|
||||
MongoDBContainer MONGO_CONTAINER = new MongoDBContainer("mongo:5.0.9");
|
||||
|
||||
@BeforeAll
|
||||
static void startContainer() {
|
||||
|
||||
Reference in New Issue
Block a user