doTestMathsService("vm://address-dynamic-endpoint-bridge.in", Collections.singletonMap("bridgeTarget", "maths-service.in"));
}
private void doJmsBasedTest(final String jmsDestinationUri, final String ftcName) throws Exception, MuleException, InterruptedException {
final FunctionalTestComponent ftc = getFunctionalTestComponent(ftcName);
final Latch latch = new Latch();
ftc.setEventCallback(new EventCallback() {
public void eventReceived(final MuleEventContext context, final Object component) throws Exception {
latch.countDown();
}
});
final String payload = RandomStringUtils.randomAlphabetic(10);
muleClient.dispatch(jmsDestinationUri, payload, null);
latch.await(getTestTimeoutSecs(), TimeUnit.SECONDS);
assertEquals(1, ftc.getReceivedMessagesCount());
assertEquals(payload, byteArrayOrStringtoString(ftc.getReceivedMessage(1)));
}