diff --git a/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingAbstractResource.java b/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingAbstractResource.java new file mode 100644 index 000000000..484db1f29 --- /dev/null +++ b/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingAbstractResource.java @@ -0,0 +1,14 @@ +package io.quarkus.ts.http.advanced.reactive; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/greeting") +public abstract class GreetingAbstractResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public abstract String hello(); +} diff --git a/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingResource.java b/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingResource.java new file mode 100644 index 000000000..7d4a99884 --- /dev/null +++ b/http/http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/GreetingResource.java @@ -0,0 +1,8 @@ +package io.quarkus.ts.http.advanced.reactive; + +public class GreetingResource extends GreetingAbstractResource { + @Override + public String hello() { + return "Hello from Quarkus REST"; + } +} diff --git a/http/http-advanced-reactive/src/main/resources/application.properties b/http/http-advanced-reactive/src/main/resources/application.properties index d0ff80adb..ab80dc955 100644 --- a/http/http-advanced-reactive/src/main/resources/application.properties +++ b/http/http-advanced-reactive/src/main/resources/application.properties @@ -42,6 +42,8 @@ quarkus.keycloak.policy-enforcer.paths.multipart-form-data.path=/api/multipart-f quarkus.keycloak.policy-enforcer.paths.multipart-form-data.enforcement-mode=DISABLED quarkus.keycloak.policy-enforcer.paths.hello.path=/api/hello/* quarkus.keycloak.policy-enforcer.paths.hello.enforcement-mode=DISABLED +quarkus.keycloak.policy-enforcer.paths.greeting.path=/api/greeting/* +quarkus.keycloak.policy-enforcer.paths.greeting.enforcement-mode=DISABLED quarkus.keycloak.policy-enforcer.paths.grpc.path=/api/grpc/* quarkus.keycloak.policy-enforcer.paths.grpc.enforcement-mode=DISABLED quarkus.keycloak.policy-enforcer.paths.client.path=/api/client/* diff --git a/http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/BaseHttpAdvancedReactiveIT.java b/http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/BaseHttpAdvancedReactiveIT.java index fd8f9168a..c1f582705 100644 --- a/http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/BaseHttpAdvancedReactiveIT.java +++ b/http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/BaseHttpAdvancedReactiveIT.java @@ -62,6 +62,7 @@ import io.quarkus.test.bootstrap.Protocol; import io.quarkus.test.bootstrap.RestService; +import io.quarkus.test.scenarios.annotations.DisabledOnNative; import io.quarkus.test.scenarios.annotations.EnabledOnQuarkusVersion; import io.quarkus.test.security.certificate.CertificateBuilder; import io.restassured.http.Header; @@ -79,6 +80,7 @@ public abstract class BaseHttpAdvancedReactiveIT { private static final String ROOT_PATH = "/api"; private static final String HELLO_ENDPOINT = ROOT_PATH + "/hello"; + private static final String GREETING_ENDPOINT = ROOT_PATH + "/greeting"; private static final int TIMEOUT_SEC = 3; private static final int RETRY = 3; private static final String PASSWORD = "password"; @@ -95,6 +97,15 @@ public void httpServer() { .body("content", is("Hello, World!")); } + @Test + @DisplayName("Test Quarkus REST abstract resource with @Path") + @DisabledOnNative(reason = "https://github.com/quarkusio/quarkus/issues/42976") + public void abstractResourceWithPath() { + getApp().given().get(GREETING_ENDPOINT) + .then().statusCode(SC_OK) + .body(is("Hello from Quarkus REST")); + } + @Test @DisplayName("GRPC Server test") public void testGrpc() {