diff --git a/independent-projects/tools/common/src/test/resources/templates/basic-rest/java/native-test-resource-template.ftl b/independent-projects/tools/common/src/test/resources/templates/basic-rest/java/native-test-resource-template.ftl index c228cd1d785cc..3e798bfaa4cc5 100644 --- a/independent-projects/tools/common/src/test/resources/templates/basic-rest/java/native-test-resource-template.ftl +++ b/independent-projects/tools/common/src/test/resources/templates/basic-rest/java/native-test-resource-template.ftl @@ -1,8 +1,8 @@ package ${package_name}; -import io.quarkus.test.junit.SubstrateTest; +import io.quarkus.test.junit.NativeImageTest; -@SubstrateTest +@NativeImageTest public class Native${class_name}IT extends ${class_name}Test { // Execute the same tests but in native mode. diff --git a/independent-projects/tools/common/src/test/resources/templates/basic-rest/kotlin/native-test-resource-template.ftl b/independent-projects/tools/common/src/test/resources/templates/basic-rest/kotlin/native-test-resource-template.ftl index f22e57bc5c388..b8b34d4176740 100644 --- a/independent-projects/tools/common/src/test/resources/templates/basic-rest/kotlin/native-test-resource-template.ftl +++ b/independent-projects/tools/common/src/test/resources/templates/basic-rest/kotlin/native-test-resource-template.ftl @@ -1,6 +1,6 @@ package ${package_name} -import io.quarkus.test.junit.SubstrateTest +import io.quarkus.test.junit.NativeImageTest -@SubstrateTest +@NativeImageTest open class Native${class_name}IT : ${class_name}Test() diff --git a/independent-projects/tools/common/src/test/resources/templates/basic-rest/scala/native-test-resource-template.ftl b/independent-projects/tools/common/src/test/resources/templates/basic-rest/scala/native-test-resource-template.ftl index 67dc6137903c7..ee89a757a96a7 100644 --- a/independent-projects/tools/common/src/test/resources/templates/basic-rest/scala/native-test-resource-template.ftl +++ b/independent-projects/tools/common/src/test/resources/templates/basic-rest/scala/native-test-resource-template.ftl @@ -1,6 +1,6 @@ package ${package_name} -import io.quarkus.test.junit.SubstrateTest +import io.quarkus.test.junit.NativeImageTest -@SubstrateTest +@NativeImageTest class Native${class_name}IT extends ${class_name}Test diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/HealthCheckTestCase.java b/integration-tests/main/src/test/java/io/quarkus/it/main/HealthCheckTestCase.java index b1391391f9e6c..a4936598f6c5b 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/HealthCheckTestCase.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/HealthCheckTestCase.java @@ -4,26 +4,24 @@ import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Liveness; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.wildfly.common.Assert; import io.quarkus.it.health.SimpleHealthCheck; -import io.quarkus.test.junit.NativeImageTest; +import io.quarkus.test.junit.DisabledOnNativeImage; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.SubstrateTest; @QuarkusTest +@DisabledOnNativeImage("This test is not meant to be ran in native mode as Quarkus does not yet support injection " + + "in native " + "tests - see https://quarkus.io/guides/getting-started-testing#native-executable-testing") public class HealthCheckTestCase { @Inject @Liveness - SimpleHealthCheck checkks; + SimpleHealthCheck simpleHealthCheck; @Test public void testInjection() { - Assumptions.assumeFalse(getClass().isAnnotationPresent(SubstrateTest.class)); - Assumptions.assumeFalse(getClass().isAnnotationPresent(NativeImageTest.class)); - Assert.assertTrue(checkks.call().getState() == HealthCheckResponse.State.UP); + Assert.assertTrue(simpleHealthCheck.call().getState() == HealthCheckResponse.State.UP); } } diff --git a/integration-tests/test-extension/src/test/java/io/quarkus/it/extension/FinalFieldReflectionInGraalITCase.java b/integration-tests/test-extension/src/test/java/io/quarkus/it/extension/FinalFieldReflectionInGraalITCase.java index 04fc9902e52bf..0b66bc415d678 100644 --- a/integration-tests/test-extension/src/test/java/io/quarkus/it/extension/FinalFieldReflectionInGraalITCase.java +++ b/integration-tests/test-extension/src/test/java/io/quarkus/it/extension/FinalFieldReflectionInGraalITCase.java @@ -7,11 +7,13 @@ import io.quarkus.test.junit.SubstrateTest; import io.restassured.RestAssured; +// TODO replace with @NativeImageTest once @SubstrateTest is removed. +// Use @SubstrateTest for now to ensure backward compatibility. @SubstrateTest public class FinalFieldReflectionInGraalITCase { @Test - public void testFieldAndGetterReflectionOnEntityFromServlet() throws Exception { + public void testFieldAndGetterReflectionOnEntityFromServlet() { RestAssured.when().get("/core/reflection/final").then() .body(is("OK")); }