assertTrue(testjclouds.getCreated().before(now));
assertTrue(testjclouds.getUpdated().before(now));
assertEquals(jclouds.getRecords().size(), 4); // 2 created above + 2 nameserver (NS) records
RecordDetail mxRecord = null;
RecordDetail aRecord = null;
RecordDetail nsRecord = null;
for (RecordDetail record: jclouds.getRecords()) {
if (record.getType().equals("MX")) {
mxRecord = record;
} else if (record.getType().equals("A")) {
aRecord = record;
} else if (record.getType().equals("NS")) {
nsRecord = record; // don't care which one we get
}
}
assertNotNull(mxRecord.getId());
assertEquals(mxRecord.getType(), "MX");
assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
assertEquals(mxRecord.getPriority().intValue(), 11235);
assertEquals(mxRecord.getComment(), "MX Record");
assertEquals(mxRecord.getTTL(), 60000);
assertTrue(mxRecord.getCreated().before(now));
assertTrue(mxRecord.getUpdated().before(now));
assertNotNull(aRecord.getId());
assertEquals(aRecord.getType(), "A");
assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
assertNull(aRecord.getPriority());
assertEquals(aRecord.getComment(), "A Record");
assertEquals(aRecord.getTTL(), 60000);
assertTrue(aRecord.getCreated().before(now));
assertTrue(aRecord.getUpdated().before(now));
assertNotNull(nsRecord.getId());
assertEquals(nsRecord.getType(), "NS");
assertEquals(nsRecord.getName(), JCLOUDS_EXAMPLE);
assertEquals(nsRecord.getTTL(), 600001);
assertTrue(nsRecord.getCreated().before(now));
assertTrue(nsRecord.getUpdated().before(now));
}