CreateMessage createMessage2 = CreateMessage.builder().ttl(120).body(json2).build();
String json3 = "{\"event\":{\"name\":\"HK Java User Group\",\"attendees\":[\"bob\",\"jim\",\"sally\"]}}";
CreateMessage createMessage3 = CreateMessage.builder().ttl(120).body(json3).build();
List<CreateMessage> createMessages = ImmutableList.of(createMessage1, createMessage2, createMessage3);
MessagesCreated messagesCreated = messageApi.create(createMessages);
assertNotNull(messagesCreated);
assertEquals(messagesCreated.getMessageIds().size(), 3);
assertTrue(messagesCreated.getMessageIds().contains("5265540ef4919b655da1760a"));
assertTrue(messagesCreated.getMessageIds().contains("5265540ef4919b655da1760b"));
assertTrue(messagesCreated.getMessageIds().contains("5265540ef4919b655da1760c"));
assertEquals(server.getRequestCount(), 2);
assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
assertEquals(server.takeRequest().getRequestLine(), "POST /v1/123123/queues/jclouds-test/messages HTTP/1.1");
}