Repository: micronaut-projects/micronaut-test
Pull request #1101 (2024-09-17 11:53:13)

Added junit-platform to managed block.
Removed groovy and kotlin versions.
Fix logback for windows.
Minor fixes in dependencies.

dstepanov: @sdelamo @melix Please check
sdelamo: @altro3  can you merge 4.6.x into this PR?
altro3: @sdelamo done

Patch:
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 7022c220..70ece923 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -9,5 +9,4 @@ repositories {
 
 dependencies {
     implementation(libs.micronaut.library.plugin)
-    implementation (libs.kotlin.gradle.plugin)
 }
diff --git a/gradle.properties b/gradle.properties
index e40fd42a..956a133d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,7 +7,6 @@ projectUrl=https://micronaut.io
 githubSlug=micronaut-projects/micronaut-test
 developers=Graeme Rocher
 
-
 spocktests=test-spock/src/test/groovy/io/micronaut/test/spock
 junit5tests=test-junit5/src/test/java/io/micronaut/test/junit5
 kotesttests=test-kotest/src/test/kotlin/io/micronaut/test/kotest
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index aad14bd6..4d49a4b3 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,26 +1,24 @@
 [versions]
-micronaut = "4.7.2"
-micronaut-platform = "4.6.3"
-micronaut-docs = "2.0.0"
-groovy = "4.0.15"
-
 managed-assertj = "3.26.3"
 managed-hamcrest = "3.0"
 managed-mockito = "5.14.2"
 managed-mockk = "1.13.13"
 managed-junit = "5.11.3"
+managed-junit-platform = "1.11.0"
 managed-rest-assured = "5.5.0"
 managed-kotest = "5.9.1"
 managed-spock = "2.3-groovy-4.0"
 managed-bytebuddy = "1.15.10"
 
-kotlin = "1.9.25"
 graal-svm = "24.1.1"
 
+micronaut = "4.7.2"
+micronaut-platform = "4.6.3"
+micronaut-docs = "2.0.0"
 micronaut-test = "4.5.0"
 micronaut-data = "4.9.6"
 micronaut-hibernate-validator = "4.6.0"
-micronaut-logging = "1.3.0"
+micronaut-logging = "1.4.0"
 micronaut-r2dbc = "5.6.1"
 micronaut-serde = "2.12.0"
 micronaut-spring = "5.9.0"
@@ -34,9 +32,9 @@ micronaut-gradle-plugin = "4.4.4"
 # Core
 micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
 micronaut-platform = { module = 'io.micronaut.platform:micronaut-platform', version.ref = 'micronaut-platform' }
-
+micronaut-logging = { module = "io.micronaut.logging:micronaut-logging-bom", version.ref = "micronaut-logging" }
 micronaut-data = { module = "io.micronaut.data:micronaut-data-bom", version.ref = "micronaut-data" }
-micronaut-hibernate-validator = { module = "io.micronaut.beanvalidation:micronaut-hibernate-validator", version.ref = "micronaut-hibernate-validator" }
+micronaut-hibernate-validator = { module = "io.micronaut.beanvalidation:micronaut-hibernate-validator-bom", version.ref = "micronaut-hibernate-validator" }
 micronaut-r2dbc = { module = "io.micronaut.r2dbc:micronaut-r2dbc-bom", version.ref = "micronaut-r2dbc" }
 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" }
@@ -59,6 +57,14 @@ managed-junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-param
 managed-junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "managed-junit" }
 managed-junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "managed-junit" }
 
+managed-junit-platform-suite-engine = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-suite = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-suite-api = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-launcher = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-runner = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-engine = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+managed-junit-platform-console = { module = "org.junit.platform:junit-platform-suite-engine", version.ref = "managed-junit-platform" }
+
 managed-bytebuddy = { module = "net.bytebuddy:byte-buddy", version.ref = "managed-bytebuddy" }
 managed-bytebuddy-agent = { module = "net.bytebuddy:byte-buddy-agent", version.ref = "managed-bytebuddy" }
 
@@ -76,8 +82,3 @@ graal-svm = { module = "org.graalvm.nativeimage:svm", version.ref = "graal-svm"
 spock-core = { module = "org.spockframework:spock-core" }
 jakarta-inject-api = { module = "jakarta.inject:jakarta.inject-api" }
 rest-assured = { module = "io.rest-assured:rest-assured" }
-kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
-kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
-groovy = { module = "org.apache.groovy:groovy" }
-
-kotlin-gradle-plugin = { module = 'org.jetbrains.kotlin:kotlin-gradle-plugin', version.ref = 'kotlin' }
diff --git a/settings.gradle b/settings.gradle
index 4a7e8315..e31cd665 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -22,6 +22,7 @@ micronautBuild {
     importMicronautCatalog("micronaut-reactor")
     importMicronautCatalog("micronaut-test")
     importMicronautCatalog("micronaut-test-resources")
+    importMicronautCatalog("micronaut-hibernate-validator")
 }
 
 rootProject.name = 'test-parent'


Test patch:
diff --git a/test-core/src/main/java/io/micronaut/test/support/sql/TestSqlAnnotationHandler.java b/test-core/src/main/java/io/micronaut/test/support/sql/TestSqlAnnotationHandler.java
index 4417f55b..ccd13593 100644
--- a/test-core/src/main/java/io/micronaut/test/support/sql/TestSqlAnnotationHandler.java
+++ b/test-core/src/main/java/io/micronaut/test/support/sql/TestSqlAnnotationHandler.java
@@ -31,7 +31,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
-import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Optional;
@@ -59,7 +58,6 @@ public final class TestSqlAnnotationHandler {
      * @param applicationContext The application context
      * @param phase The {@link Sql.Phase} to run the scripts in
      *
-     * @throws SQLException If an error occurs executing the SQL
      * @throws IOException If an error occurs reading the SQL
      */
     public static void handle(BeanDefinition<?> specDefinition, ApplicationContext applicationContext, Sql.Phase phase) throws IOException {
diff --git a/test-junit5/build.gradle b/test-junit5/build.gradle
index aac010e4..6c9c6ae1 100644
--- a/test-junit5/build.gradle
+++ b/test-junit5/build.gradle
@@ -37,14 +37,12 @@ dependencies {
 
     compileOnly(libs.graal.svm)
 
-    api projects.micronautTestCore
+    api(projects.micronautTestCore)
     api(mn.micronaut.inject)
     api(libs.managed.junit.jupiter.api)
 
     implementation(mn.micronaut.context)
 
-    testCompileOnly(mn.micronaut.inject)
-
     testAnnotationProcessor(mn.micronaut.inject.java)
     testAnnotationProcessor(mn.micronaut.graal)
 
@@ -55,8 +53,8 @@ dependencies {
     testImplementation(libs.managed.hamcrest)
     testImplementation(mnData.micronaut.data.tx)
     testImplementation(mnData.micronaut.data.hibernate.jpa)
-    testImplementation(mn.snakeyaml)
 
+    testRuntimeOnly(mn.snakeyaml)
     testRuntimeOnly(mnLogging.logback.classic)
     testRuntimeOnly(mnSql.micronaut.jdbc.tomcat)
     testRuntimeOnly(mnSql.h2)
diff --git a/test-junit5/src/main/java/io/micronaut/test/extensions/junit5/annotation/MicronautTest.java b/test-junit5/src/main/java/io/micronaut/test/extensions/junit5/annotation/MicronautTest.java
index 27136dca..72a667e6 100644
--- a/test-junit5/src/main/java/io/micronaut/test/extensions/junit5/annotation/MicronautTest.java
+++ b/test-junit5/src/main/java/io/micronaut/test/extensions/junit5/annotation/MicronautTest.java
@@ -112,7 +112,6 @@ public @interface MicronautTest {
      * By default, with JUnit 5 the test method parameters will be resolved to beans if possible.
      * This behaviour can be problematic if in combination with the {@code ParameterizedTest} annotation.
      * Setting this member to {@code false} will completely disable bean resolution for method parameters.
-     * <p>
      *
      * @return Whether to resolve test method parameters as beans.
      */
diff --git a/test-junit5/src/test/resources/logback.xml b/test-junit5/src/test/resources/logback.xml
index f75b890d..5cdabbd8 100644
--- a/test-junit5/src/test/resources/logback.xml
+++ b/test-junit5/src/test/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-kotest5/build.gradle b/test-kotest5/build.gradle
index 3d780707..622555c9 100644
--- a/test-kotest5/build.gradle
+++ b/test-kotest5/build.gradle
@@ -1,7 +1,7 @@
 plugins {
     id "io.micronaut.build.internal.micronaut-test-module"
-    id "org.jetbrains.kotlin.jvm"
-    id "org.jetbrains.kotlin.kapt"
+    alias(mn.plugins.kotlin.jvm)
+    alias(mn.plugins.kotlin.kapt)
 }
 
 dependencies {
@@ -14,9 +14,9 @@ dependencies {
     api(libs.managed.kotest.runner.junit5.jvm)
 
     implementation(mn.micronaut.inject)
-    implementation projects.micronautTestJunit5
-    implementation(libs.kotlin.stdlib.jdk8)
-    implementation(libs.kotlin.reflect)
+    implementation(projects.micronautTestJunit5)
+    implementation(mn.kotlin.stdlib.jdk8)
+    implementation(mn.kotlin.reflect)
 
     kaptTest(platform(mn.micronaut.core.bom))
     kaptTest(mn.micronaut.inject.java)
diff --git a/test-kotest5/src/test/resources/logback.xml b/test-kotest5/src/test/resources/logback.xml
index f75b890d..5cdabbd8 100644
--- a/test-kotest5/src/test/resources/logback.xml
+++ b/test-kotest5/src/test/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-rest-assured/build.gradle b/test-rest-assured/build.gradle
index 2cc1a9e6..3958c5ce 100644
--- a/test-rest-assured/build.gradle
+++ b/test-rest-assured/build.gradle
@@ -12,7 +12,7 @@ dependencies {
         exclude group:"org.codehaus.groovy", module:"groovy"
     }
     implementation(mn.micronaut.context)
-    implementation(libs.groovy)
+    implementation(mn.groovy)
 
     testAnnotationProcessor(mn.micronaut.inject.java)
 
diff --git a/test-rest-assured/src/test/resources/logback.xml b/test-rest-assured/src/test/resources/logback.xml
index 44b79c40..0be9287c 100644
--- a/test-rest-assured/src/test/resources/logback.xml
+++ b/test-rest-assured/src/test/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-spock/build.gradle b/test-spock/build.gradle
index 333089de..a601811d 100644
--- a/test-spock/build.gradle
+++ b/test-spock/build.gradle
@@ -7,7 +7,7 @@ dependencies {
     compileOnly(libs.jakarta.inject.api)
 
     api(platform(libs.boms.spock))
-    api projects.micronautTestCore
+    api(projects.micronautTestCore)
     api(mn.micronaut.inject)
     api(libs.spock.core) {
         exclude group: "org.codehaus.groovy", module: "groovy-all"
@@ -21,11 +21,11 @@ dependencies {
     testImplementation(mn.micronaut.http.server.netty)
     testImplementation(mn.micronaut.http.client)
     testImplementation(mnSql.micronaut.jdbc.hikari)
-    testImplementation(libs.micronaut.hibernate.validator)
+    testImplementation(mnHibernateValidator.micronaut.hibernate.validator)
     testImplementation(mnSpring.micronaut.spring)
-    testImplementation(mn.snakeyaml)
     testImplementation(mnReactor.micronaut.reactor)
 
+    testRuntimeOnly(mn.snakeyaml)
     testRuntimeOnly(mnLogging.logback.classic)
     testRuntimeOnly(mnSerde.micronaut.serde.jackson)
     testRuntimeOnly(mnSql.h2)
diff --git a/test-spock/src/test/resources/logback.xml b/test-spock/src/test/resources/logback.xml
index d11b56fa..e9d7309b 100644
--- a/test-spock/src/test/resources/logback.xml
+++ b/test-spock/src/test/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-suite-at-sql-jpa/build.gradle.kts b/test-suite-at-sql-jpa/build.gradle.kts
index 432d35f2..fef92dd4 100644
--- a/test-suite-at-sql-jpa/build.gradle.kts
+++ b/test-suite-at-sql-jpa/build.gradle.kts
@@ -23,6 +23,7 @@ dependencies {
     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/main/resources/logback.xml b/test-suite-at-sql-jpa/src/main/resources/logback.xml
index f75b890d..5cdabbd8 100644
--- a/test-suite-at-sql-jpa/src/main/resources/logback.xml
+++ b/test-suite-at-sql-jpa/src/main/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-suite-sql-r2dbc/src/test/resources/logback.xml b/test-suite-sql-r2dbc/src/test/resources/logback.xml
index f75b890d..5cdabbd8 100644
--- a/test-suite-sql-r2dbc/src/test/resources/logback.xml
+++ b/test-suite-sql-r2dbc/src/test/resources/logback.xml
@@ -3,6 +3,7 @@
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <withJansi>false</withJansi>
         <encoder>
             <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
         </encoder>
diff --git a/test-type-pollution/build.gradle.kts b/test-type-pollution/build.gradle.kts
index e64b2cdb..d3a5fd80 100644
--- a/test-type-pollution/build.gradle.kts
+++ b/test-type-pollution/build.gradle.kts
@@ -23,8 +23,7 @@ tasks.withType<Test> {
 }
 
 micronautBuild {
-    // todo: enable after 4.4.0
     binaryCompatibility {
-        enabled.set(false)
+        enabled.set(true)
     }
 }