-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
4.0.0.Final
-
None
-
None
AsyncClientResponseProvider should be able to map any resource method that returns CompletionStage to return some other type but this doesn't seems to be respected when the provider is registered with the client.
Provider:
@Provider public class DummyAsyncClientResponseProvider implements AsyncClientResponseProvider<String> { @Override public String fromCompletionStage(CompletionStage<?> completionStage) { return "injected response"; } }
Resource:
@Path("/") public class PingResource { @Context private UriInfo uriInfo; @GET @Path("async") public String async() { Client client = ClientBuilder.newClient(); client.register(DummyAsyncClientResponseProvider.class); Response response = client.target(uriInfo.getBaseUriBuilder().path("async-client").build()) .request().get(); return response.readEntity(String.class); } @GET @Path("async-client") public CompletionStage<String> asyncClient() { return CompletableFuture.supplyAsync(() -> "original string"); } }
I am not sure whether I use it in a right way so can someone confirm that this is expected to trigger DummyAsyncClientResponseProvider when calling GET /async please?
- is related to
-
RESTEASY-2163 @Provider annotation should work with all client filters
- Closed