Search in sources :

Example 56 with JacksonJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider 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 57 with JacksonJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider 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 58 with JacksonJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider 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 59 with JacksonJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider 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 60 with JacksonJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider 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

JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)225 WebClient (org.apache.cxf.jaxrs.client.WebClient)152 Response (javax.ws.rs.core.Response)129 ArrayList (java.util.ArrayList)112 HashMap (java.util.HashMap)104 URL (java.net.URL)103 Book (org.apache.cxf.systest.jaxrs.security.Book)76 Test (org.junit.Test)66 JwtAuthenticationClientFilter (org.apache.cxf.rs.security.jose.jaxrs.JwtAuthenticationClientFilter)50 JwtClaims (org.apache.cxf.rs.security.jose.jwt.JwtClaims)50 JwtToken (org.apache.cxf.rs.security.jose.jwt.JwtToken)45 List (java.util.List)31 ClientBuilder (javax.ws.rs.client.ClientBuilder)28 Number (org.apache.coheigea.cxf.jaxrs.json.common.Number)28 LinkedList (java.util.LinkedList)27 GenericType (javax.ws.rs.core.GenericType)27 JwsWriterInterceptor (org.apache.cxf.rs.security.jose.jaxrs.JwsWriterInterceptor)27 MediaType (javax.ws.rs.core.MediaType)26 AbstractResourceInfo (org.apache.cxf.jaxrs.model.AbstractResourceInfo)26 AbstractBusClientServerTestBase (org.apache.cxf.testutil.common.AbstractBusClientServerTestBase)26