Skip to content

Commit

Permalink
Testcontainers via test-resources version catalog (#1258)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
  • Loading branch information
wetted and sdelamo authored Feb 9, 2024
1 parent 00ae342 commit 4328f36
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ micronaut {
testRuntime "junit"
testResources {
clientTimeout = 180
version = libs.versions.micronaut.testresources.get()
version = libs.versions.micronaut.test.resources.get()
}
}

dependencies {
runtimeOnly mnLogging.logback.classic
implementation mn.micronaut.http.client
testImplementation mnTest.micronaut.test.core
testImplementation(libs.testcontainers.jdbc)
testImplementation(platform(libs.testcontainers.bom))
testImplementation(mnTestResources.testcontainers.jdbc)

micronautBoms(platform(mn.micronaut.core.bom))
micronautBoms(platform(mnData.micronaut.data.bom))
Expand Down
25 changes: 4 additions & 21 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
micronaut = "4.3.4"
micronaut-docs = "2.0.0"
micronaut-gradle-plugin = "4.3.2"
micronaut-testresources = "2.3.3"
micronaut-test-resources = "2.3.3"

# Platform dependencies
micronaut-cache = "4.2.1"
micronaut-data = "4.6.0"
micronaut-hibernate-validator = "4.2.0"
micronaut-logging = "1.2.3"
micronaut-micrometer = "5.4.0"
micronaut-r2dbc = "5.3.0"
micronaut-reactor = "3.2.1"
Expand Down Expand Up @@ -57,23 +58,15 @@ sfm-reflect = "8.2.3"
# Needed for vertx pg client and micronaut-data hibernate reactive
managed-ongres-scram = "2.1"

# Logback

logback = "1.4.6"

# Testing

groovy = "4.0.11"
testcontainers = "1.19.4"
sonar-gradle-plugin = "4.4.1.3373"

micronaut-logging = "1.2.3"
[libraries]
# Core
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }

micronaut-logging = { module = "io.micronaut.logging:micronaut-logging-bom", version.ref = "micronaut-logging" }

# Platform catalogs

micronaut-cache = { module = "io.micronaut.cache:micronaut-cache-bom", version.ref = "micronaut-cache" }
Expand All @@ -84,6 +77,7 @@ micronaut-r2dbc = { module = "io.micronaut.r2dbc:micronaut-r2dbc-bom", version.r
micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" }
micronaut-spring = { module = "io.micronaut.spring:micronaut-spring-bom", version.ref = "micronaut-spring" }
micronaut-test = { module = "io.micronaut.test:micronaut-test-bom", version.ref = "micronaut-test" }
micronaut-test-resources = { module = "io.micronaut.testresources:micronaut-test-resources-bom", version.ref = "micronaut-test-resources" }
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }

# Switch to BOM and catalog import when there's a bom
Expand Down Expand Up @@ -155,20 +149,9 @@ managed-jakarta-transaction-api = { module = "jakarta.transaction:jakarta.transa
sfm-reflect = { module = "org.simpleflatmapper:sfm-reflect", version.ref = "sfm-reflect" }
managed-ongres-scram-client = { module = "com.ongres.scram:client", version.ref = "managed-ongres-scram" }

# Testcontainers

testcontainers-bom = { module = "org.testcontainers:testcontainers-bom", version.ref = "testcontainers" }
testcontainers-jdbc = { module = "org.testcontainers:jdbc" }
testcontainers-mariadb = { module = "org.testcontainers:mariadb" }
testcontainers-mssqlserver = { module = "org.testcontainers:mssqlserver" }
testcontainers-mysql = { module = "org.testcontainers:mysql" }
testcontainers-oracle-xe = { module = "org.testcontainers:oracle-xe" }
testcontainers-postgresql = { module = "org.testcontainers:postgresql" }
testcontainers-spock = { module = "org.testcontainers:spock" }

# Testresources

micronaut-testresources-client = { module = 'io.micronaut.testresources:micronaut-test-resources-client', version.ref = "micronaut-testresources" }
micronaut-testresources-client = { module = 'io.micronaut.testresources:micronaut-test-resources-client', version.ref = "micronaut-test-resources" }

#PLUGINS

Expand Down
6 changes: 2 additions & 4 deletions hibernate-reactive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ dependencies {
testRuntimeOnly projects.micronautJdbcTomcat
testRuntimeOnly(libs.managed.h2)

testImplementation(platform(libs.testcontainers.bom))
testImplementation libs.testcontainers.spock
testImplementation libs.testcontainers.jdbc
testImplementation libs.testcontainers.postgresql
testImplementation(mnTestResources.testcontainers.jdbc)
testImplementation(mnTestResources.testcontainers.postgres)
testImplementation libs.managed.vertx.pg.client
testImplementation(mnData.micronaut.data.tx.hibernate)
}
4 changes: 1 addition & 3 deletions jasync-sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ dependencies {
compileOnly(libs.managed.jasync.postgresql)
compileOnly(mn.micronaut.management)

testImplementation(platform(libs.testcontainers.bom))
testImplementation(mn.micronaut.management)
testImplementation(libs.testcontainers.spock)
testImplementation(libs.testcontainers.postgresql)
testImplementation(mnTestResources.testcontainers.postgres)
testImplementation(libs.managed.jasync.postgresql)
testImplementation(mn.micronaut.management)
testImplementation(mn.micronaut.http.client)
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ micronautBuild {
importMicronautCatalog("micronaut-r2dbc")
importMicronautCatalog("micronaut-serde")
importMicronautCatalog("micronaut-spring")
importMicronautCatalog("micronaut-test-resources")
importMicronautCatalog("micronaut-validation")
}

Expand Down
4 changes: 1 addition & 3 deletions vertx-mysql-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ dependencies {

compileOnly(mn.micronaut.management)

testImplementation(platform(libs.testcontainers.bom))
testImplementation(mn.micronaut.management)
testImplementation(libs.testcontainers.spock)
testImplementation(libs.testcontainers.mysql)
testImplementation(mnTestResources.testcontainers.mysql)
testImplementation(libs.managed.mysql.connector.j)
}
4 changes: 1 addition & 3 deletions vertx-pg-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ dependencies {
compileOnly(mn.micronaut.management)
runtimeOnly libs.managed.ongres.scram.client

testImplementation(platform(libs.testcontainers.bom))
testImplementation(mn.micronaut.management)
testImplementation(libs.testcontainers.spock)
testImplementation(libs.testcontainers.postgresql)
testImplementation(mnTestResources.testcontainers.postgres)
}

0 comments on commit 4328f36

Please sign in to comment.