@Test
public void testCreateAndDeleteHostedZone() {
String name = System.getProperty("user.name").replace('.', '-') + ".zone.route53test.jclouds.org.";
String nonce = name + " @ " + new Date();
String comment = name + " for " + JcloudsVersion.get();
NewHostedZone newHostedZone = api().createWithReferenceAndComment(name, nonce, comment);
getAnonymousLogger().info("created zone: " + newHostedZone);
try {
checkHostedZone(newHostedZone.getZone());
assertEquals(newHostedZone.getChange().getStatus(), PENDING, "invalid status on zone " + newHostedZone);
assertTrue(newHostedZone.getNameServers().size() > 0, "no name servers for zone " + newHostedZone);
assertEquals(newHostedZone.getZone().getName(), name);
assertEquals(newHostedZone.getZone().getCallerReference(), nonce);
assertEquals(newHostedZone.getZone().getComment().get(), comment);
assertTrue(inSync.apply(newHostedZone.getChange()), "zone didn't sync " + newHostedZone);
} finally {
Change delete = api().delete(newHostedZone.getZone().getId());
assertTrue(inSync.apply(delete), "delete didn't sync " + delete);
}
}