diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java index be895cd1977ea..93047b9d68ee7 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java @@ -336,6 +336,9 @@ public void handleCustomAnnotatedMethods( generated.getGeneratedClassName()) .setRegisterAsBean(false)// it has already been made a bean .setPriority(generated.getPriority()); + if (!generated.getNameBindingNames().isEmpty()) { + builder.setNameBindingNames(generated.getNameBindingNames()); + } additionalContainerResponseFilters.produce(builder.build()); } } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/CustomFiltersTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/CustomFiltersTest.java index fa010c71be852..e92475042209a 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/CustomFiltersTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/CustomFiltersTest.java @@ -31,13 +31,14 @@ public JavaArchive get() { @Test public void testFilters() { - Headers headers = RestAssured.given().header("some-input", "bar").get("/custom/req") + Headers responseHeaders = RestAssured.given().header("some-input", "bar").get("/custom/req") .then().statusCode(200).body(Matchers.containsString("/custom/req-bar-null")).extract().headers(); - assertThat(headers.getValues("java-method")).containsOnly("filters"); + assertThat(responseHeaders.getValues("java-method")).containsOnly("filters"); Assertions.assertEquals(3, AssertContainerFilter.COUNT.get()); + assertThat(responseHeaders.getValues("very")).isEmpty(); - headers = RestAssured.given().header("some-input", "bar").get("/custom/metal") + responseHeaders = RestAssured.given().header("some-input", "bar").get("/custom/metal") .then().statusCode(200).body(Matchers.containsString("/custom/metal-bar-metal")).extract().headers(); - assertThat(headers.getValues("java-method")).containsOnly("metal"); + assertThat(responseHeaders.getValues("very")).containsOnly("heavy"); } } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/MetalFilter.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/MetalFilter.java index f23d62aa2dfef..62335776d3343 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/MetalFilter.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/MetalFilter.java @@ -1,14 +1,22 @@ package io.quarkus.resteasy.reactive.server.test.customproviders; import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; import org.jboss.resteasy.reactive.server.ServerRequestFilter; +import org.jboss.resteasy.reactive.server.ServerResponseFilter; public class MetalFilter { @Metal @ServerRequestFilter - public void headBang(ContainerRequestContext requestContext) { + public void headBangIn(ContainerRequestContext requestContext) { requestContext.getHeaders().putSingle("heavy", "metal"); } + + @Metal + @ServerResponseFilter + public void headBangOut(ContainerResponseContext responseContext) { + responseContext.getHeaders().putSingle("very", "heavy"); + } }