use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapCxfServerTest method testFault.
@Test
public void testFault() {
GetCustomersByName request = new GetCustomersByName();
request.setName("none");
try {
customerServiceProxy.getCustomersByName(request);
Assert.fail("NoSuchCustomerException expected");
} catch (NoSuchCustomerException e) {
NoSuchCustomer info = e.getFaultInfo();
Assert.assertEquals("none", info.getCustomerId());
}
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapMarshalTest method testMarshalNormalObject.
/**
* Test Soap marshalling by sending a GetCustomerByName object and checking
* against a xml file.
*
* @throws IOException
* @throws InterruptedException
*/
@Test
public void testMarshalNormalObject() throws IOException, InterruptedException {
InputStream in = this.getClass().getResourceAsStream("SoapMarshalTestExpectedResult.xml");
resultEndpoint.expectedMessageCount(1);
resultEndpoint.expectedBodiesReceived(TestUtil.readStream(in));
GetCustomersByName request = new GetCustomersByName();
request.setName("Smith");
producer.sendBody(request);
resultEndpoint.assertIsSatisfied();
}
Aggregations