AbstractMessageListener.reset();
observer.reset();
producer.sendTopicMessage();
new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
public boolean isSatisfied() {
return AbstractMessageListener.getProcessedMessages() >= 1;
}
}).start();
assertEquals(1, AbstractMessageListener.getProcessedMessages());
assertTrue(AbstractMessageListener.isInitializedEventObserver());
// wait for the request scope for the message delivery to be destroyed and verify that the event was delivered
new Timer().setDelay(2000l).addStopCondition(new StopCondition() {
public boolean isSatisfied() {
return observer.isDestroyedCalled();
}
}).start();