@@ -52,11 +52,10 @@ public class ITDnsTest {
5252
5353 public static final String PREFIX = "gcldjvit-" ;
5454 public static final Dns DNS = DnsOptions .builder ().build ().service ();
55- public static final String PROJECT_ID = DNS .options ().projectId ();
5655 public static final String ZONE_NAME1 = (PREFIX + UUID .randomUUID ()).substring (0 , 32 );
5756 public static final String ZONE_NAME_EMPTY_DESCRIPTION =
58- ("gcldjvit-" + UUID .randomUUID ()).substring (0 , 32 );
59- public static final String ZONE_NAME_TOO_LONG = ( PREFIX + UUID .randomUUID () );
57+ (PREFIX + UUID .randomUUID ()).substring (0 , 32 );
58+ public static final String ZONE_NAME_TOO_LONG = PREFIX + UUID .randomUUID ();
6059 public static final String ZONE_DESCRIPTION1 = "first zone" ;
6160 public static final String ZONE_DNS_NAME1 = ZONE_NAME1 + ".com." ;
6261 public static final String ZONE_DNS_EMPTY_DESCRIPTION = ZONE_NAME_EMPTY_DESCRIPTION + ".com." ;
@@ -727,37 +726,43 @@ public void testGetChange() {
727726 ChangeRequest created = zone .applyChangeRequest (CHANGE_ADD_ZONE1 );
728727 ChangeRequest retrieved = DNS .getChangeRequest (zone .name (), created .id ());
729728 assertEqChangesIgnoreStatus (created , retrieved );
729+ waitUntilComplete (zone .name (), created .id ());
730730 zone .applyChangeRequest (CHANGE_DELETE_ZONE1 );
731731 // with options
732732 created = zone .applyChangeRequest (CHANGE_ADD_ZONE1 ,
733733 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .ID ));
734734 retrieved = DNS .getChangeRequest (zone .name (), created .id (),
735735 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .ID ));
736736 assertEqChangesIgnoreStatus (created , retrieved );
737+ waitUntilComplete (zone .name (), created .id ());
737738 zone .applyChangeRequest (CHANGE_DELETE_ZONE1 );
738739 created = zone .applyChangeRequest (CHANGE_ADD_ZONE1 ,
739740 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .STATUS ));
740741 retrieved = DNS .getChangeRequest (zone .name (), created .id (),
741742 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .STATUS ));
742743 assertEqChangesIgnoreStatus (created , retrieved );
744+ waitUntilComplete (zone .name (), created .id ());
743745 zone .applyChangeRequest (CHANGE_DELETE_ZONE1 );
744746 created = zone .applyChangeRequest (CHANGE_ADD_ZONE1 ,
745747 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .START_TIME ));
746748 retrieved = DNS .getChangeRequest (zone .name (), created .id (),
747749 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .START_TIME ));
748750 assertEqChangesIgnoreStatus (created , retrieved );
751+ waitUntilComplete (zone .name (), created .id ());
749752 zone .applyChangeRequest (CHANGE_DELETE_ZONE1 );
750753 created = zone .applyChangeRequest (CHANGE_ADD_ZONE1 ,
751754 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .ADDITIONS ));
752755 retrieved = DNS .getChangeRequest (zone .name (), created .id (),
753756 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .ADDITIONS ));
754757 assertEqChangesIgnoreStatus (created , retrieved );
758+ waitUntilComplete (zone .name (), created .id ());
755759 // finishes with delete otherwise we cannot delete the zone
756760 created = zone .applyChangeRequest (CHANGE_DELETE_ZONE1 ,
757761 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .DELETIONS ));
758762 retrieved = DNS .getChangeRequest (zone .name (), created .id (),
759763 Dns .ChangeRequestOption .fields (Dns .ChangeRequestField .DELETIONS ));
760764 assertEqChangesIgnoreStatus (created , retrieved );
765+ waitUntilComplete (zone .name (), created .id ());
761766 } finally {
762767 clear ();
763768 }
0 commit comments