diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/TestResource.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/TestResource.java index d5102e3fdbd08..f0231eb501670 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/TestResource.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/TestResource.java @@ -1,5 +1,6 @@ package io.quarkus.resteasy.reactive.links.deployment; +import java.time.Duration; import java.util.Arrays; import java.util.LinkedList; import java.util.List; @@ -15,6 +16,7 @@ import io.quarkus.resteasy.reactive.links.InjectRestLinks; import io.quarkus.resteasy.reactive.links.RestLink; import io.quarkus.resteasy.reactive.links.RestLinkType; +import io.smallrye.mutiny.Uni; @Path("/records") public class TestResource { @@ -29,8 +31,8 @@ public class TestResource { @Produces(MediaType.APPLICATION_JSON) @RestLink(entityType = TestRecord.class, rel = "list") @InjectRestLinks - public List getAll() { - return RECORDS; + public Uni> getAll() { + return Uni.createFrom().item(RECORDS).onItem().delayIt().by(Duration.ofMillis(100)); } @GET diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/RestLinksHandler.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/RestLinksHandler.java index 10c2e24571c8e..4799bf83a5227 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/RestLinksHandler.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/RestLinksHandler.java @@ -24,6 +24,7 @@ public void setRestLinkData(RestLinkData restLinkData) { @Override public void handle(ResteasyReactiveRequestContext context) { + context.requireCDIRequestScope(); Response response = context.getResponse().get(); for (Link link : getLinks(response)) { response.getHeaders().add("Link", link);