@Test
public void peekLockMessageWorks() throws Exception {
// Arrange
String queueName = "TestPeekLockMessageWorks";
service.createQueue(new QueueInfo(queueName));
service.sendQueueMessage(queueName, new BrokeredMessage("Hello Again"));
// Act
BrokeredMessage message = service.receiveQueueMessage(queueName,
PEEK_LOCK_5_SECONDS).getValue();
// Assert
byte[] data = new byte[100];
int size = message.getBody().read(data);
assertEquals(11, size);
assertEquals("Hello Again", new String(data, 0, size));
}