final String type = "test";
engine.addMessageListener(type, listener);
engine.send(new TestMessage<String>(type, expectedBody));
lock.tryAcquire(3, TimeUnit.SECONDS);
assertEquals(expectedBody, actualBody.toString());
engine.stop();
}
@Test(timeout = 1000)
public void shouldListen1000FooMessages() throws Exception {
final Semaphore lock = new Semaphore(0);