use of org.apache.cxf.rs.security.jose.jaxrs.JwsJsonClientResponseFilter in project cxf by apache.
the class JAXRSJwsJsonTest method createBookStore.
private BookStore createBookStore(String address, Map<String, Object> mapProperties, List<?> extraProviders, boolean encodePayload) throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
SpringBusFactory bf = new SpringBusFactory();
URL busFile = JAXRSJwsJsonTest.class.getResource("client.xml");
Bus springBus = bf.createBus(busFile.toString());
bean.setBus(springBus);
bean.setServiceClass(BookStore.class);
bean.setAddress(address);
List<Object> providers = new LinkedList<>();
JwsJsonWriterInterceptor writer = new JwsJsonWriterInterceptor();
writer.setUseJwsJsonOutputStream(true);
writer.setEncodePayload(encodePayload);
providers.add(writer);
providers.add(new JwsJsonClientResponseFilter());
if (extraProviders != null) {
providers.addAll(extraProviders);
}
bean.setProviders(providers);
bean.getProperties(true).putAll(mapProperties);
return bean.create(BookStore.class);
}
Aggregations