Search in sources :

Example 36 with FlowableRxInvokerProvider

use of org.apache.cxf.jaxrs.rx3.client.FlowableRxInvokerProvider in project cxf by apache.

the class JAXRSRxJava3FlowableTest method testGetHelloWorldAsyncObservable404.

@Test
public void testGetHelloWorldAsyncObservable404() throws Exception {
    String address = "http://localhost:" + PORT + "/rx3/flowable/textAsync404";
    Invocation.Builder b = ClientBuilder.newClient().register(new FlowableRxInvokerProvider()).target(address).request();
    final TestSubscriber<String> subscriber = new TestSubscriber<>();
    b.rx(FlowableRxInvoker.class).get(String.class).subscribe(subscriber);
    subscriber.await(1, TimeUnit.SECONDS);
    subscriber.assertError(NotFoundException.class);
}
Also used : FlowableRxInvokerProvider(org.apache.cxf.jaxrs.rx3.client.FlowableRxInvokerProvider) Invocation(javax.ws.rs.client.Invocation) TestSubscriber(io.reactivex.rxjava3.subscribers.TestSubscriber) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)36 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)30 TimeUnit (java.util.concurrent.TimeUnit)26 InternalServerErrorException (javax.ws.rs.InternalServerErrorException)26 ClientBuilder (javax.ws.rs.client.ClientBuilder)26 MediaType (javax.ws.rs.core.MediaType)26 AbstractResourceInfo (org.apache.cxf.jaxrs.model.AbstractResourceInfo)26 AbstractBusClientServerTestBase (org.apache.cxf.testutil.common.AbstractBusClientServerTestBase)26 Assert.assertTrue (org.junit.Assert.assertTrue)26 BeforeClass (org.junit.BeforeClass)26 Response (javax.ws.rs.core.Response)22 TestSubscriber (io.reactivex.rxjava3.subscribers.TestSubscriber)18 TestSubscriber (io.reactivex.subscribers.TestSubscriber)18 LinkedList (java.util.LinkedList)18 Invocation (javax.ws.rs.client.Invocation)18 WebClient (org.apache.cxf.jaxrs.client.WebClient)18 FlowableRxInvokerProvider (org.apache.cxf.jaxrs.rx2.client.FlowableRxInvokerProvider)18 FlowableRxInvokerProvider (org.apache.cxf.jaxrs.rx3.client.FlowableRxInvokerProvider)18 FlowableRxInvoker (org.apache.cxf.jaxrs.rx2.client.FlowableRxInvoker)17 FlowableRxInvoker (org.apache.cxf.jaxrs.rx3.client.FlowableRxInvoker)17