@Test
public void testCreateDestination() throws Exception {

    CreateDestinationRequest request = new CreateDestinationRequest();
    final String destination = "/foo/bar";
    final String email = "foo@bar.com";
    final int consumedRetention = new Random().nextInt();
    final int unconsumedRetention = new Random().nextInt();
    request.setPath(destination);
    request.setOwnerEmail(email);
    request.setType(DestinationType.PLAIN);
    request.setConsumedMessagesRetention(consumedRetention);
    request.setUnconsumedMessagesRetention(unconsumedRetention);
    DestinationDescription response = client.createDestination(request);
    // Simple test case of creating a Destination with a path and owner email
    assert (response.getPath().equals(destination));
    assert (response.getOwnerEmail().equals(email));
    // Client should not be able to create a duplicate Destination
    thrown.expect(EntityAlreadyExistsError.class);
    client.createDestination(request);
}