@Test(
     expectedExceptions = ResourceNotFoundException.class,
     expectedExceptionsMessageRegExp = "Directional Pool Record does not exist in the system")
 public void testUpdateRecordWhenResponseNotFound() {
   UltraDNSWSApi notFound = requestSendsResponse(updateRecord, recordDoesntExist);
   notFound.getDirectionalPoolApiForZone("jclouds.org.").updateRecord("04053D8E57C7931F", record);
 }
  public void testListWhenResponseIs2xx() {
    UltraDNSWSApi success = requestSendsResponse(list, listResponse);

    assertEquals(
        success.getDirectionalPoolApiForZone("jclouds.org.").list().toString(),
        new GetDirectionalPoolsByZoneResponseTest().expected().toString());
  }
 public void testCreateWhenResponseIs2xx() {
   UltraDNSWSApi success = requestSendsResponse(create, createResponse);
   assertEquals(
       success
           .getDirectionalPoolApiForZone("jclouds.org.")
           .createForDNameAndType("foo", "www.jclouds.org.", IPV4.getCode()),
       "06063DC355055E68");
 }
 public void testAddRecordIntoExistingGroupWhenResponseIs2xx() {
   UltraDNSWSApi success = requestSendsResponse(addRecordIntoExistingGroup, recordCreatedResponse);
   assertEquals(
       success
           .getDirectionalPoolApiForZone("jclouds.org.")
           .addRecordIntoExistingGroup("06063DC355055E68", record, "AAABBBCCCDDDEEE"),
       "06063DC355058294");
 }
 public void testAddFirstRecordInNonConfiguredGroupWhenResponseIs2xx() {
   UltraDNSWSApi success =
       requestSendsResponse(addFirstRecordInNonConfiguredGroup, recordCreatedResponse);
   assertEquals(
       success
           .getDirectionalPoolApiForZone("jclouds.org.")
           .addFirstRecordInNonConfiguredGroup("06063DC355055E68", record),
       "06063DC355058294");
 }
 @Test(
     expectedExceptions = ResourceAlreadyExistsException.class,
     expectedExceptionsMessageRegExp =
         "Pool already created for this host name : www.jclouds.org.")
 public void testCreateWhenResponseError2912() {
   UltraDNSWSApi already = requestSendsResponse(create, alreadyCreated);
   already
       .getDirectionalPoolApiForZone("jclouds.org.")
       .createForDNameAndType("foo", "www.jclouds.org.", IPV4.getCode());
 }
  public void testListRecordsWhenResponseIs2xx() {
    UltraDNSWSApi success = requestSendsResponse(listRecords, listRecordsResponse);

    assertEquals(
        success
            .getDirectionalPoolApiForZone("jclouds.org.")
            .listRecordsByDNameAndType("www.jclouds.org.", 1)
            .toString(),
        new GetDirectionalDNSRecordsForHostResponseTest().expected().toString());
  }
 @Test(
     expectedExceptions = ResourceAlreadyExistsException.class,
     expectedExceptionsMessageRegExp = "Resource Record already exists.")
 public void testAddFirstRecordInNonConfiguredGroupWhenResponseError1802() {
   UltraDNSWSApi already =
       requestSendsResponse(addFirstRecordInNonConfiguredGroup, recordAlreadyCreated);
   already
       .getDirectionalPoolApiForZone("jclouds.org.")
       .addFirstRecordInNonConfiguredGroup("06063DC355055E68", record);
 }
 /** in UltraDNS, zones are scoped to an account. */
 @Override
 public Iterator<String> list() {
   return api.getZoneApi()
       .listByAccount(account.get().getId())
       .transform(ZoneName.INSTANCE)
       .iterator();
 }
 public void testDeleteRecordWhenResponseNotFound() {
   UltraDNSWSApi notFound = requestSendsResponse(deleteRecord, recordDoesntExist);
   notFound.getDirectionalPoolApiForZone("jclouds.org.").deleteRecord("04053D8E57C7931F");
 }
 public void testDeleteRecordWhenResponseIs2xx() {
   UltraDNSWSApi success = requestSendsResponse(deleteRecord, deleteRecordResponse);
   success.getDirectionalPoolApiForZone("jclouds.org.").deleteRecord("04053D8E57C7931F");
 }
 public void testUpdateRecordAndGroupWhenResponseIs2xx() {
   UltraDNSWSApi success = requestSendsResponse(updateRecordAndGroup, updateRecordResponse);
   success
       .getDirectionalPoolApiForZone("jclouds.org.")
       .updateRecordAndGroup("04053D8E57C7931F", record, group);
 }