Skip to content

Commit

Permalink
Merge pull request #822 from ajkannan/improve-dns-it
Browse files Browse the repository at this point in the history
Check if record added in ITDnsTest
  • Loading branch information
aozarov committed Mar 30, 2016
2 parents 6747274 + 80268f7 commit 45c4665
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,11 @@ public void testInvalidChangeRequest() {
RecordSet.builder("subdomain." + zone.dnsName(), RecordSet.Type.A)
.records(ImmutableList.of("0.255.1.5"))
.build();
boolean recordAdded = false;
try {
ChangeRequestInfo validChange = ChangeRequest.builder().add(validA).build();
zone.applyChangeRequest(validChange);
recordAdded = true;
try {
zone.applyChangeRequest(validChange);
fail("Created a record set which already exists.");
Expand Down Expand Up @@ -648,9 +650,11 @@ public void testInvalidChangeRequest() {
assertEquals(400, ex.code());
}
} finally {
ChangeRequestInfo deletion = ChangeRequest.builder().delete(validA).build();
ChangeRequest request = zone.applyChangeRequest(deletion);
waitForChangeToComplete(zone.name(), request.id());
if (recordAdded) {
ChangeRequestInfo deletion = ChangeRequest.builder().delete(validA).build();
ChangeRequest request = zone.applyChangeRequest(deletion);
waitForChangeToComplete(zone.name(), request.id());
}
zone.delete();
}
}
Expand Down

0 comments on commit 45c4665

Please sign in to comment.