Skip to content

Commit

Permalink
refactor: remove trailing usage of @substratetest
Browse files Browse the repository at this point in the history
follows up quarkusio#5007
  • Loading branch information
machi1990 committed Nov 16, 2019
1 parent 7619f75 commit 865088e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down

0 comments on commit 865088e

Please sign in to comment.