Repository: micronaut-projects/micronaut-test
Pull request #1081 (2024-08-19 07:09:24)

Micronaut Tests to latest versions
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


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=micronaut-projects_micronaut-test&pullRequest=1081) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=micronaut-projects_micronaut-test&pullRequest=1081&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=micronaut-projects_micronaut-test&pullRequest=1081&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=micronaut-projects_micronaut-test&pullRequest=1081&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=micronaut-projects_micronaut-test&pullRequest=1081&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=micronaut-projects_micronaut-test&pullRequest=1081&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=micronaut-projects_micronaut-test&pullRequest=1081)



Patch:
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index cc133286..531bb2d0 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -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"
@@ -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"
@@ -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" }


Test patch:
diff --git a/test-suite-at-sql-jpa/build.gradle.kts b/test-suite-at-sql-jpa/build.gradle.kts
index e9b52047..432d35f2 100644
--- a/test-suite-at-sql-jpa/build.gradle.kts
+++ b/test-suite-at-sql-jpa/build.gradle.kts
@@ -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)
 }
 
diff --git a/test-suite-at-sql-jpa/src/test/java/example/micronaut/ThreeProductsTest.java b/test-suite-at-sql-jpa/src/test/java/example/micronaut/ThreeProductsTest.java
index 8f110207..01cfbe3a 100644
--- a/test-suite-at-sql-jpa/src/test/java/example/micronaut/ThreeProductsTest.java
+++ b/test-suite-at-sql-jpa/src/test/java/example/micronaut/ThreeProductsTest.java
@@ -7,15 +7,15 @@ import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
 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
diff --git a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsEachTest.java b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsEachTest.java
index cffd88b1..2f5ba283 100644
--- a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsEachTest.java
+++ b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsEachTest.java
@@ -7,6 +7,7 @@ import io.micronaut.test.support.TestPropertyProvider;
 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;
 
@@ -16,6 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 @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
diff --git a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsTest.java b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsTest.java
index d442d7c1..644bd661 100644
--- a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsTest.java
+++ b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsTest.java
@@ -6,6 +6,7 @@ import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
 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;
 
@@ -15,6 +16,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 @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
diff --git a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsThenNoneTest.java b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsThenNoneTest.java
index 613ec8f6..37b081a6 100644
--- a/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsThenNoneTest.java
+++ b/test-suite-at-sql-jpa/src/test/java/example/micronaut/TwoProductsThenNoneTest.java
@@ -7,6 +7,7 @@ import io.micronaut.test.support.TestPropertyProvider;
 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;
 
@@ -18,6 +19,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 // end::rollback[]
 @MicronautTest(startApplication = false)
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
+@Testcontainers(disabledWithoutDocker = true)
 class TwoProductsThenNoneTest implements TestPropertyProvider {
 
     @Override
diff --git a/test-suite-sql-r2dbc/build.gradle.kts b/test-suite-sql-r2dbc/build.gradle.kts
index a81064c1..96f2c18b 100644
--- a/test-suite-sql-r2dbc/build.gradle.kts
+++ b/test-suite-sql-r2dbc/build.gradle.kts
@@ -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)
 }
 
diff --git a/test-suite-sql-r2dbc/src/test/java/io/micronaut/test/r2dbc/MySqlConnectionTest.java b/test-suite-sql-r2dbc/src/test/java/io/micronaut/test/r2dbc/MySqlConnectionTest.java
index 4afce002..642e1ea5 100644
--- a/test-suite-sql-r2dbc/src/test/java/io/micronaut/test/r2dbc/MySqlConnectionTest.java
+++ b/test-suite-sql-r2dbc/src/test/java/io/micronaut/test/r2dbc/MySqlConnectionTest.java
@@ -6,6 +6,7 @@ import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
 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;
@@ -14,6 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 @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