diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/stork/StorkResponseTimeLoadBalancerTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/stork/StorkResponseTimeLoadBalancerTest.java index db76c2dddb7af..507ca9eb31b1a 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/stork/StorkResponseTimeLoadBalancerTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/stork/StorkResponseTimeLoadBalancerTest.java @@ -34,7 +34,7 @@ public class StorkResponseTimeLoadBalancerTest { @BeforeAll public static void setUp() { server = new WireMockServer(options().port(8766)); - server.stubFor(WireMock.post("/hello") + server.stubFor(WireMock.post("/hello/") .willReturn(aResponse().withFixedDelay(1000) .withBody(SLOW_RESPONSE).withStatus(200))); server.start(); diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java index df55a77fe4f08..ddbbef4fda35c 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java @@ -392,7 +392,7 @@ protected List createEndpoints(ClassInfo currentClassInfo, methodPath = "/" + methodPath; } if (methodPath.endsWith("/")) { - methodPath = methodPath.substring(0, methodPath.length() - 1); + methodPath = handleTrailingSlash(methodPath); } } else { methodPath = ""; @@ -451,6 +451,10 @@ protected List createEndpoints(ClassInfo currentClassInfo, return ret; } + protected String handleTrailingSlash(String path) { + return path; + } + private void validateHttpAnnotations(MethodInfo info) { List annotationInstances = info.annotations(); Set allMethodAnnotations = new HashSet<>(annotationInstances.size()); diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java index 7ec7a11e268c1..71f97a2232fad 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java @@ -385,6 +385,11 @@ protected void handlePathSegmentParam(ServerIndexedParameter builder) { builder.setConverter(new PathSegmentParamConverter.Supplier()); } + @Override + protected String handleTrailingSlash(String path) { + return path.substring(0, path.length() - 1); + } + protected void handleTemporalParam(ServerIndexedParameter builder, DotName paramType, Map parameterAnnotations, MethodInfo currentMethodInfo) {