use of com.example.customerservice.GetCustomersByNameResponse 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.GetCustomersByNameResponse 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.GetCustomersByNameResponse in project camel by apache.
the class CustomerServiceImpl method getCustomersByName.
/**
* If the request.name is "none" a NoSuchCustomerException is thrown in any
* other case a dummy customer is returned that has the same name as the
* request
*/
public GetCustomersByNameResponse getCustomersByName(GetCustomersByName request) throws NoSuchCustomerException {
if ("none".equals(request.getName())) {
NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
noSuchCustomer.setCustomerId(request.getName());
throw new NoSuchCustomerException("Customer not found", noSuchCustomer);
}
GetCustomersByNameResponse response = new GetCustomersByNameResponse();
Customer customer = new Customer();
customer.setName(request.getName());
customer.setRevenue(100000);
response.getReturn().add(customer);
return response;
}
use of com.example.customerservice.GetCustomersByNameResponse in project camel by apache.
the class SoapCxfClientTest method testSuccess.
@Test
public void testSuccess() throws NoSuchCustomerException {
GetCustomersByName request = new GetCustomersByName();
request.setName("test");
GetCustomersByNameResponse response = customerService.getCustomersByName(request);
Assert.assertNotNull(response);
List<Customer> customers = response.getReturn();
Assert.assertEquals(1, customers.size());
Assert.assertEquals("test", customers.get(0).getName());
}
Aggregations