use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class Soap12UnMarshalTest method testUnMarshalSoap.
@Test
public void testUnMarshalSoap() throws IOException, InterruptedException {
resultEndpoint.expectedMessageCount(1);
InputStream in = this.getClass().getResourceAsStream("request.xml");
producer.sendBody(in);
resultEndpoint.assertIsSatisfied();
Exchange exchange = resultEndpoint.getExchanges().get(0);
Object body = exchange.getIn().getBody();
assertEquals(GetCustomersByName.class, body.getClass());
GetCustomersByName request = (GetCustomersByName) body;
assertEquals("Smith", request.getName());
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapClientTest method testRoundTripGetCustomersByName.
@Test
public void testRoundTripGetCustomersByName() throws Exception {
GetCustomersByNameResponse response = customerService.getCustomersByName(new GetCustomersByName());
assertEquals(1, response.getReturn().size());
Customer firstCustomer = response.getReturn().get(0);
assertEquals(100000.0, firstCustomer.getRevenue(), 0.0D);
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapCxfClientTest method testFault.
@Test
public void testFault() {
GetCustomersByName request = new GetCustomersByName();
request.setName("none");
try {
customerService.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 SoapCxfServerTest method testSuccess.
@Test
public void testSuccess() throws NoSuchCustomerException {
GetCustomersByName request = new GetCustomersByName();
request.setName("test");
GetCustomersByNameResponse response = customerServiceProxy.getCustomersByName(request);
Assert.assertNotNull(response);
List<Customer> customers = response.getReturn();
Assert.assertEquals(1, customers.size());
Assert.assertEquals("test", customers.get(0).getName());
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapRoundtripTest method testRoundTrip.
@Test
public void testRoundTrip() throws IOException, InterruptedException {
resultEndpoint.expectedMessageCount(1);
GetCustomersByName request = new GetCustomersByName();
request.setName("Mueller");
producer.sendBody(request);
resultEndpoint.assertIsSatisfied();
Exchange exchange = resultEndpoint.getExchanges().get(0);
GetCustomersByName received = exchange.getIn().getBody(GetCustomersByName.class);
assertNotNull(received);
assertEquals("Mueller", received.getName());
}
Aggregations