use of org.apache.cxf.jaxrs.rx3.client.ObservableRxInvokerProvider in project cxf by apache.
the class JAXRSRxJava3ObservableTest method testObservableImmediateErrors.
@Test
public void testObservableImmediateErrors() throws Exception {
String address = "http://localhost:" + PORT + "/rx3/observable/immediate/errors";
final Observable<HelloWorldBean> obs = ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ObservableRxInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ObservableRxInvoker.class).get(HelloWorldBean.class);
final TestObserver<HelloWorldBean> subscriber = new TestObserver<>();
obs.subscribe(subscriber);
subscriber.await(3, TimeUnit.SECONDS);
subscriber.assertError(InternalServerErrorException.class);
}
use of org.apache.cxf.jaxrs.rx3.client.ObservableRxInvokerProvider in project cxf by apache.
the class JAXRSRxJava2ObservableTest method testObservableImmediateErrors.
@Test
public void testObservableImmediateErrors() throws Exception {
String address = "http://localhost:" + PORT + "/rx2/observable/immediate/errors";
final Observable<HelloWorldBean> obs = ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ObservableRxInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ObservableRxInvoker.class).get(HelloWorldBean.class);
final TestObserver<HelloWorldBean> subscriber = new TestObserver<>();
obs.subscribe(subscriber);
subscriber.await(3, TimeUnit.SECONDS);
subscriber.assertError(InternalServerErrorException.class);
}
use of org.apache.cxf.jaxrs.rx3.client.ObservableRxInvokerProvider in project cxf by apache.
the class JAXRSRxJava3ObservableTest method testGetHelloWorldEmpty.
@Test
public void testGetHelloWorldEmpty() throws Exception {
String address = "http://localhost:" + PORT + "/rx3/observable/empty";
final Observable<Response> obs = ClientBuilder.newClient().register(new JacksonJsonProvider()).register(new ObservableRxInvokerProvider()).target(address).request(MediaType.APPLICATION_JSON).rx(ObservableRxInvoker.class).get();
final TestObserver<Response> subscriber = new TestObserver<>();
obs.subscribe(subscriber);
subscriber.await(3, TimeUnit.SECONDS);
subscriber.assertValue(r -> "[]".equals(r.readEntity(String.class))).assertComplete();
}
Aggregations