From 80268f7f4de379ff03f0b4dabea99d167f5084b2 Mon Sep 17 00:00:00 2001 From: Ajay Kannan Date: Wed, 30 Mar 2016 09:10:35 -0700 Subject: [PATCH] allow cleanup if record not added --- .../test/java/com/google/gcloud/dns/it/ITDnsTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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(); } }