Search in sources :

Example 21 with Zone

use of com.google.cloud.dns.Zone in project google-cloud-java by GoogleCloudPlatform.

the class ITDnsTest method testDeleteZoneBatch.

@Test
public void testDeleteZoneBatch() {
    try {
        Zone created = DNS.create(ZONE1);
        assertEquals(created, DNS.getZone(ZONE1.getName()));
        DnsBatch batch = DNS.batch();
        DnsBatchResult<Boolean> result = batch.deleteZone(ZONE1.getName());
        batch.submit();
        assertNull(DNS.getZone(ZONE1.getName()));
        assertTrue(result.get());
    } finally {
        DNS.delete(ZONE1.getName());
    }
}
Also used : Zone(com.google.cloud.dns.Zone) DnsBatch(com.google.cloud.dns.DnsBatch) Test(org.junit.Test)

Aggregations

Zone (com.google.cloud.dns.Zone)21 Test (org.junit.Test)17 DnsBatch (com.google.cloud.dns.DnsBatch)9 ChangeRequest (com.google.cloud.dns.ChangeRequest)8 DnsException (com.google.cloud.dns.DnsException)6 RecordSet (com.google.cloud.dns.RecordSet)6 Page (com.google.api.gax.paging.Page)3 ChangeRequestInfo (com.google.cloud.dns.ChangeRequestInfo)3 Dns (com.google.cloud.dns.Dns)3 ZoneInfo (com.google.cloud.dns.ZoneInfo)2 LinkedList (java.util.LinkedList)2 ProjectInfo (com.google.cloud.dns.ProjectInfo)1