use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapSpringRoundtripTest 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);
Assert.assertNotNull(received);
Assert.assertEquals("Mueller", received.getName());
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class SoapUnMarshalTest 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 Soap12MarshalTest method testMarshalNormalObject.
/**
* Test Soap marshalling by sending a GetCustomerByName object and checking
* against a xml file.
*
* @throws java.io.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();
}
use of com.example.customerservice.GetCustomersByName in project camel by apache.
the class Soap12SpringRoundtripTest 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);
Assert.assertNotNull(received);
Assert.assertEquals("Mueller", received.getName());
}
use of com.example.customerservice.GetCustomersByName 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