Skip to content

Commit

Permalink
Micronaut Tests to latest versions (#1081)
Browse files Browse the repository at this point in the history
Disable tests which require docker if docker is not available. 

* Hamcrest 3.0
* JUnit5 5.11.0

#### Micronaut Modules

##### Micronaut Core

* Micronaut Core 4.6.1

##### Micronaut Serialization
* Micronaut Serde 2.11.0

##### Micronaut Data

* Micronaut Data 4.9.0

##### Micronaut Logging
* Micronaut Logging 1.3.0

##### Micronaut R2DBC
* Micronaut R2DBC 5.6.1

##### Micronaut Spring
* Micronaut Spring 5.8.0

##### Micronaut SQL
* Micronaut SQL 5.8.1

##### Micronaut Reactor
* Micronaut Reactor 3.5.0
  • Loading branch information
sdelamo authored Aug 19, 2024
1 parent 84f582e commit a369038
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
23 changes: 12 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
micronaut = "4.5.4"
micronaut = "4.6.1"
micronaut-platform = "4.5.1"
micronaut-docs = "2.0.0"
groovy = "4.0.15"

managed-assertj = "3.26.3"
managed-hamcrest = "2.2"
managed-hamcrest = "3.0"
managed-mockito = "5.12.0"
managed-mockk = "1.13.12"
managed-junit = "5.10.3"
managed-junit = "5.11.0"
managed-rest-assured = "5.5.0"
managed-kotest = "5.9.1"
managed-spock = "2.3-groovy-4.0"
Expand All @@ -17,15 +17,15 @@ managed-bytebuddy = "1.14.19"
kotlin = "1.9.25"
graal-svm = "24.0.2"

micronaut-test = "4.3.0"
micronaut-data = "4.8.5"
micronaut-test = "4.4.0"
micronaut-data = "4.9.0"
micronaut-hibernate-validator = "4.4.0"
micronaut-logging = "1.1.2"
micronaut-r2dbc = "5.5.0"
micronaut-serde = "2.10.2"
micronaut-spring = "5.7.0"
micronaut-sql = "5.7.0"
micronaut-reactor = "3.4.1"
micronaut-logging = "1.3.0"
micronaut-r2dbc = "5.6.1"
micronaut-serde = "2.11.0"
micronaut-spring = "5.8.0"
micronaut-sql = "5.8.1"
micronaut-reactor = "3.5.0"
micronaut-test-resources = "2.5.4"

micronaut-gradle-plugin = "4.4.2"
Expand Down Expand Up @@ -62,6 +62,7 @@ managed-junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engin
managed-bytebuddy = { module = "net.bytebuddy:byte-buddy", version.ref = "managed-bytebuddy" }
managed-bytebuddy-agent = { module = "net.bytebuddy:byte-buddy-agent", version.ref = "managed-bytebuddy" }

testcontainers-junit-jupiter = { module = "org.testcontainers:junit-jupiter"}
# BOMs
boms-junit = { module = "org.junit:junit-bom", version.ref = "managed-junit" }
boms-kotest = { module = "io.kotest:kotest-bom", version.ref = "managed-kotest" }
Expand Down
2 changes: 2 additions & 0 deletions test-suite-at-sql-jpa/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ dependencies {
testImplementation(libs.managed.junit.jupiter.api)
testImplementation(projects.micronautTestJunit5)
testImplementation(mnTestResources.testcontainers.postgres)
testImplementation(platform(mnTestResources.boms.testcontainers))
testImplementation(libs.testcontainers.junit.jupiter)
testRuntimeOnly(libs.managed.junit.jupiter.engine)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import io.micronaut.test.support.TestPropertyProvider;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.testcontainers.junit.jupiter.Testcontainers;

@Sql(scripts = "classpath:threeproducts.sql")
@Sql(scripts = "classpath:rollbackthreeproducts.sql", phase = Sql.Phase.AFTER_ALL)
@MicronautTest(startApplication = false)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Testcontainers(disabledWithoutDocker = true)
class ThreeProductsTest implements TestPropertyProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.Map;

Expand All @@ -16,6 +17,7 @@
@Sql(scripts = "classpath:rollbackallproducts.sql", phase = Sql.Phase.AFTER_ALL)
@MicronautTest(startApplication = false)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Testcontainers(disabledWithoutDocker = true)
class TwoProductsEachTest implements TestPropertyProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.micronaut.test.support.TestPropertyProvider;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.Map;

Expand All @@ -15,6 +16,7 @@
@Sql(scripts = "classpath:rollbacktwoproducts.sql", phase = Sql.Phase.AFTER_ALL)
@MicronautTest(startApplication = false)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Testcontainers(disabledWithoutDocker = true)
class TwoProductsTest implements TestPropertyProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.Map;

Expand All @@ -18,6 +19,7 @@
// end::rollback[]
@MicronautTest(startApplication = false)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Testcontainers(disabledWithoutDocker = true)
class TwoProductsThenNoneTest implements TestPropertyProvider {

@Override
Expand Down
3 changes: 2 additions & 1 deletion test-suite-sql-r2dbc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ dependencies {

testRuntimeOnly(mnLogging.logback.classic)
testRuntimeOnly(mnR2dbc.r2dbc.mysql)

testImplementation(platform(mnTestResources.boms.testcontainers))
testImplementation(libs.testcontainers.junit.jupiter)
testResourcesService(mnSql.mysql.connector.java)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.r2dbc.spi.ConnectionFactory;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
import reactor.core.publisher.Flux;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -14,6 +15,7 @@
@MicronautTest
@Property(name = "r2dbc.datasources.default.db-type", value = "mysql")
@Sql(value = {"classpath:create.sql", "classpath:datasource_1_insert.sql"}, resourceType = ConnectionFactory.class)
@Testcontainers(disabledWithoutDocker = true)
class MySqlConnectionTest {

@Inject
Expand Down

0 comments on commit a369038

Please sign in to comment.