return new ClassPathXmlApplicationContext("META-INF/spring/fault-context.xml");
}
@Test
public void testFaultSpring() {
TransferRequest request = new TransferRequest();
request.setBank("Bank of Camel");
request.setFrom("Jakub");
request.setTo("Scott");
request.setAmount("1");
TransferResponse response = template.requestBody(String.format("cxf:http://localhost:%d/paymentFaultService?serviceClass=org.camelcookbook.ws.payment_service.Payment", port1), request, TransferResponse.class);
assertNotNull(response);
assertEquals("OK", response.getReply());
request.setAmount("10000");
try {
response = template.requestBody(String.format("cxf:http://localhost:%d/paymentFaultService?serviceClass=org.camelcookbook.ws.payment_service.Payment", port1), request, TransferResponse.class);
fail("Request should have failed");
} catch (CamelExecutionException e) {