use of org.apache.cxf.jaxrs.provider.json.JSONProvider in project camel by apache.
the class CxfRsEndpointTest method testCxfRsEndpointSetProvider.
@Test
public void testCxfRsEndpointSetProvider() throws Exception {
String endpointUri = "cxfrs://http://localhost:" + CTX + "" + "?resourceClass=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService";
CxfRsComponent component = new CxfRsComponent(context);
CxfRsEndpoint endpoint = (CxfRsEndpoint) component.createEndpoint(endpointUri);
JSONProvider<?> jsonProvider = new JSONProvider<Object>();
jsonProvider.setDropRootElement(true);
jsonProvider.setSupportUnwrapped(true);
endpoint.setProvider(jsonProvider);
JAXRSServerFactoryBean sfb = endpoint.createJAXRSServerFactoryBean();
assertEquals("Get a wrong proider size", 1, sfb.getProviders().size());
JAXRSClientFactoryBean cfb = endpoint.createJAXRSClientFactoryBean();
assertEquals("Get a wrong proider size", 1, cfb.getProviders().size());
}
Aggregations