Search in sources :

Example 1 with ReactorInvokerProvider

use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.

the class FluxReactorTest method testFluxErrorsResponse.

@Test
public void testFluxErrorsResponse() throws Exception {
    String address = "http://localhost:" + PORT + "/reactor2/flux/errors";
    StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get()).expectNextMatches(r -> r.getStatus() == 500).expectComplete().verify();
}
Also used : ReactorInvokerProvider(org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) ReactorInvoker(org.apache.cxf.jaxrs.reactor.client.ReactorInvoker) Test(org.junit.Test)

Example 2 with ReactorInvokerProvider

use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.

the class FluxReactorTest method testFluxImmediateErrorsResponse.

@Test
public void testFluxImmediateErrorsResponse() throws Exception {
    String address = "http://localhost:" + PORT + "/reactor2/flux/immediate/errors";
    StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get()).expectNextMatches(r -> r.getStatus() == 500).expectComplete().verify();
}
Also used : ReactorInvokerProvider(org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) ReactorInvoker(org.apache.cxf.jaxrs.reactor.client.ReactorInvoker) Test(org.junit.Test)

Example 3 with ReactorInvokerProvider

use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.

the class FluxReactorTest method testFluxImmediateErrors.

@Test
public void testFluxImmediateErrors() throws Exception {
    String address = "http://localhost:" + PORT + "/reactor2/flux/immediate/errors";
    StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).getFlux(HelloWorldBean.class)).expectError().verify();
}
Also used : ReactorInvokerProvider(org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) Test(org.junit.Test)

Example 4 with ReactorInvokerProvider

use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.

the class FluxReactorTest method testFluxErrorWithExceptionMapperReturnsNoExceptionPayload.

@Test
public void testFluxErrorWithExceptionMapperReturnsNoExceptionPayload() throws Exception {
    String address = "http://localhost:" + PORT + "/reactor2/flux/mixed/error";
    StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get()).expectNextMatches(r -> r.getStatus() == 409 && !r.readEntity(String.class).contains("stackTrace")).expectComplete().verify();
}
Also used : ReactorInvokerProvider(org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) ReactorInvoker(org.apache.cxf.jaxrs.reactor.client.ReactorInvoker) Test(org.junit.Test)

Example 5 with ReactorInvokerProvider

use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.

the class FluxReactorTest method testFluxImmediateErrorsWithExceptionMapper.

@Test
public void testFluxImmediateErrorsWithExceptionMapper() throws Exception {
    String address = "http://localhost:" + PORT + "/reactor2/flux/immediate/mapper/errors";
    StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get()).expectNextMatches(r -> r.getStatus() == 409 && r.readEntity(String.class).contains("stackTrace")).expectComplete().verify();
}
Also used : ReactorInvokerProvider(org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider) JacksonJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider) ReactorInvoker(org.apache.cxf.jaxrs.reactor.client.ReactorInvoker) Test(org.junit.Test)

Aggregations

ReactorInvokerProvider (org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider)19 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)18 Test (org.junit.Test)18 ReactorInvoker (org.apache.cxf.jaxrs.reactor.client.ReactorInvoker)15 List (java.util.List)2 ClientBuilder (javax.ws.rs.client.ClientBuilder)2 GenericType (javax.ws.rs.core.GenericType)2 MediaType (javax.ws.rs.core.MediaType)2 AbstractResourceInfo (org.apache.cxf.jaxrs.model.AbstractResourceInfo)2 AbstractBusClientServerTestBase (org.apache.cxf.testutil.common.AbstractBusClientServerTestBase)2 Assert.assertTrue (org.junit.Assert.assertTrue)2 BeforeClass (org.junit.BeforeClass)2 StepVerifier (reactor.test.StepVerifier)2 ArrayList (java.util.ArrayList)1 InternalServerErrorException (javax.ws.rs.InternalServerErrorException)1