// Act
service.createMessage(TEST_QUEUE_FOR_MESSAGES_5, "message1");
service.createMessage(TEST_QUEUE_FOR_MESSAGES_5, "message2");
service.createMessage(TEST_QUEUE_FOR_MESSAGES_5, "message3");
service.createMessage(TEST_QUEUE_FOR_MESSAGES_5, "message4");
PeekMessagesResult result = service.peekMessages(
TEST_QUEUE_FOR_MESSAGES_5,
new PeekMessagesOptions().setNumberOfMessages(4));
// Assert
assertNotNull(result);
assertEquals(4, result.getQueueMessages().size());
for (int i = 0; i < 4; i++) {
com.microsoft.windowsazure.services.queue.models.PeekMessagesResult.QueueMessage entry = result
.getQueueMessages().get(i);
assertNotNull(entry.getMessageId());
assertNotNull(entry.getMessageText());
assertEquals(0, entry.getDequeueCount());