Skip to content

Commit

Permalink
Use Testcontainers BOM
Browse files Browse the repository at this point in the history
* Rework `MongoDbContainerTest` to explicit `MongoDBContainer`
  • Loading branch information
artembilan committed Sep 20, 2022
1 parent 036b319 commit ab7b579
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

}
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
}
Expand Down Expand Up @@ -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'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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;
Expand Down Expand Up @@ -66,8 +66,7 @@
@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() {
Expand Down

0 comments on commit ab7b579

Please sign in to comment.