use of org.switchyard.Exchange in project quickstarts by jboss-switchyard.
the class CamelJpaBindingReceiveTest method receiveEntity.
@Test
public void receiveEntity() throws Exception {
_testKit.removeService("GreetingService");
_testKit.removeService("StoreReference");
service = _testKit.registerInOnlyService("GreetingService");
PreparedStatement statement = connection.prepareStatement("insert into events (createdAt,sender,receiver) values(now(), ?, ?)");
statement.setString(1, SENDER);
statement.setString(2, RECEIVER);
statement.execute();
service.waitForOKMessage();
final LinkedBlockingQueue<Exchange> receivedMessages = service.getMessages();
assertNotNull(receivedMessages);
final Exchange recievedExchange = receivedMessages.iterator().next();
Greet receiver = recievedExchange.getMessage().getContent(Greet.class);
assertEquals(SENDER, receiver.getSender());
assertEquals(RECEIVER, receiver.getReceiver());
}
Aggregations