use of org.apache.camel.component.cxf.jaxrs.testbean.CustomException in project camel by apache.
the class CxfRsSpringConsumerTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() throws Exception {
final Processor testProcessor = new Processor() {
public void process(Exchange exchange) throws Exception {
// just throw the CustomException here
throw new CustomException("Here is the exception");
}
};
final Processor responseProcessor = new Processor() {
public void process(Exchange exchange) throws Exception {
// do something else with the request properties as usual
// do something else with the response
exchange.getOut().getBody(Customer.class).setId(246);
}
};
return new RouteBuilder() {
public void configure() {
errorHandler(new NoErrorHandlerBuilder());
from("cxfrs://bean://rsServer").process(testProcessor);
from("cxfrs://bean://rsServer2").process(testProcessor);
from("cxfrs://bean://rsServerInvoke?performInvocation=true").process(responseProcessor);
}
};
}
Aggregations