use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method doTestTextJsonImplicitListAsyncStream.
private void doTestTextJsonImplicitListAsyncStream(String address) throws Exception {
List<HelloWorldBean> holder = new ArrayList<>();
ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request("application/json").rx(ReactorInvoker.class).getFlux(HelloWorldBean.class).doOnNext(holder::add).subscribe();
Thread.sleep(500);
assertEquals(2, holder.size());
assertEquals("Hello", holder.get(0).getGreeting());
assertEquals("World", holder.get(0).getAudience());
assertEquals("Ciao", holder.get(1).getGreeting());
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class MonoReactorTest method testGetHelloWorldJson.
@Test
public void testGetHelloWorldJson() throws Exception {
String address = "http://localhost:" + PORT + "/reactor/mono/textJson";
StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get(HelloWorldBean.class)).expectNextMatches(r -> "Hello".equals(r.getGreeting()) && "World".equals(r.getAudience())).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testFluxErrors.
@Test
public void testFluxErrors() 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).getFlux(HelloWorldBean.class)).expectNextMatches(b -> "Person 1".equalsIgnoreCase(b.getGreeting())).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testFluxErrorsResponseWithMapper.
@Test
public void testFluxErrorsResponseWithMapper() throws Exception {
String address = "http://localhost:" + PORT + "/reactor2/flux/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() == 400).expectComplete().verify();
}
use of org.apache.cxf.jaxrs.reactor.client.ReactorInvokerProvider in project cxf by apache.
the class FluxReactorTest method testGetHelloWorldJson.
@Test
public void testGetHelloWorldJson() throws Exception {
String address = "http://localhost:" + PORT + "/reactor/flux/textJson";
StepVerifier.create(ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ReactorInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ReactorInvoker.class).get(HelloWorldBean.class)).expectNextMatches(bean -> "Hello".equals(bean.getGreeting()) && "World".equals(bean.getAudience())).expectComplete().verify();
}
Aggregations