public class StompConsumerUriTest extends StompBaseTest {
@Test
public void testConsume() throws Exception {
Stomp stomp = new Stomp("tcp://localhost:" + getPort());
final BlockingConnection producerConnection = stomp.connectBlocking();
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(numberOfMessages);
for (int i = 0; i < numberOfMessages; i++) {
StompFrame frame = new StompFrame(SEND);
frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
frame.addHeader(MESSAGE_ID, StompFrame.encodeHeader("msg:" + i));
frame.content(utf8("Important Message " + i));
producerConnection.send(frame);
}
mock.await(5, TimeUnit.SECONDS);
mock.assertIsSatisfied();
}