use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testFluxEmpty2.
@Test
public void testFluxEmpty2() throws Exception {
String address = "http://localhost:" + PORT + "/reactor2/flux/empty";
StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).getFlux(HelloWorldBean.class)).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testGetHelloWorldJsonMany.
@Test
public void testGetHelloWorldJsonMany() throws Exception {
String address = "http://localhost:" + PORT + "/reactor2/flux/textJsonMany";
StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).getFlux(HelloWorldBean.class)).expectNextMatches(bean -> "Hello 1".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectNextMatches(bean -> "Hello 2".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectNextMatches(bean -> "Hello 3".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectNextMatches(bean -> "Hello 4".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectNextMatches(bean -> "Hello 5".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testFluxErrorWithWebException.
@Test
public void testFluxErrorWithWebException() throws Exception {
String address = "http://localhost:" + PORT + "/reactor2/flux/web/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() == 403 && !r.readEntity(String.class).contains("stackTrace")).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testFluxEmpty.
@Test
public void testFluxEmpty() throws Exception {
String address = "http://localhost:" + PORT + "/reactor/flux/empty";
StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).getFlux(HelloWorldBean.class)).expectComplete().verify();
}
Aggregations