diff --git a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/it/ITDnsTest.java b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/it/ITDnsTest.java index 38273cff49d6..c9070f2eddde 100644 --- a/gcloud-java-dns/src/test/java/com/google/gcloud/dns/it/ITDnsTest.java +++ b/gcloud-java-dns/src/test/java/com/google/gcloud/dns/it/ITDnsTest.java @@ -650,10 +650,11 @@ public void testInvalidChangeRequest() { assertEquals(400, ex.code()); } } finally { - assertTrue(recordAdded); - 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(); } }