diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/RegisterForReflectionITCase.java b/integration-tests/main/src/test/java/io/quarkus/it/main/RegisterForReflectionITCase.java index 53fb22ecfc1b7..ef72c927992f2 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/RegisterForReflectionITCase.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/RegisterForReflectionITCase.java @@ -5,6 +5,9 @@ import org.junit.jupiter.api.Test; +import io.quarkus.test.junit.DisableIfBuiltWithGraalVMNewerThan; +import io.quarkus.test.junit.DisableIfBuiltWithGraalVMOlderThan; +import io.quarkus.test.junit.GraalVMVersion; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; @@ -56,14 +59,21 @@ public void testTargetWithoutNested() { } @Test - public void testLambdaCapturing() { - final String resourceLambda = BASE_PKG + ".ResourceLambda"; - + @DisableIfBuiltWithGraalVMNewerThan(GraalVMVersion.GRAALVM_23_1_0) + public void testLambdaCapturingPre24_0() { // Starting with GraalVM 22.1 support Lambda functions serialization // (see https://github.com/oracle/graal/issues/3756) RestAssured.given().when().get("/reflection/lambda").then().body(startsWith("Comparator$$Lambda$")); } + @Test + @DisableIfBuiltWithGraalVMOlderThan(GraalVMVersion.GRAALVM_24_0_0) + public void testLambdaCapturingPost23_1() { + // Starting with GraalVM 24.0 lambda class names match the ones from HotSpot + // (see https://github.com/oracle/graal/pull/7775) + RestAssured.given().when().get("/reflection/lambda").then().body(startsWith("Comparator$$Lambda/")); + } + private void assertRegistration(String expected, String queryParam) { RestAssured.given().queryParam("className", queryParam).when().get(ENDPOINT).then().body(is(expected)); } diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/GraalVMVersion.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/GraalVMVersion.java index c157cfbdb0ff2..df95a13f166b9 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/GraalVMVersion.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/GraalVMVersion.java @@ -3,7 +3,8 @@ import io.quarkus.deployment.pkg.steps.GraalVM; public enum GraalVMVersion { - GRAALVM_23_1_0(GraalVM.Version.VERSION_23_1_0); + GRAALVM_23_1_0(GraalVM.Version.VERSION_23_1_0), + GRAALVM_24_0_0(GraalVM.Version.VERSION_24_0_0); private final GraalVM.Version version;