Date year2010 = calendar.getTime();
// Act
service.createMessage(TEST_QUEUE_FOR_MESSAGES_8, "message1");
ListMessagesResult listResult1 = service
.listMessages(TEST_QUEUE_FOR_MESSAGES_8);
UpdateMessageResult updateResult = service.updateMessage(
TEST_QUEUE_FOR_MESSAGES_8, listResult1.getQueueMessages()
.get(0).getMessageId(), listResult1.getQueueMessages()
.get(0).getPopReceipt(), "new text", 0);
ListMessagesResult listResult2 = service
.listMessages(TEST_QUEUE_FOR_MESSAGES_8);
// Assert
assertNotNull(updateResult);
assertNotNull(updateResult.getPopReceipt());
assertNotNull(updateResult.getTimeNextVisible());
assertTrue(year2010.before(updateResult.getTimeNextVisible()));
assertNotNull(listResult2);
QueueMessage entry = listResult2.getQueueMessages().get(0);
assertEquals(listResult1.getQueueMessages().get(0).getMessageId(),
entry.getMessageId());
assertEquals("new text", entry.getMessageText());
assertNotNull(entry.getPopReceipt());