> +      List<ServiceKey> possibleServiceKeys = api().listServiceKeys();
> +      assertNotNull(possibleServiceKeys, "possibleServiceKeys was not set");
> +      assertTrue(possibleServiceKeys.size() > 0, "Expected at least 1 
> ServiceKey but list was empty");
> +      boolean serviceKeyFound = false;
> +      for (ServiceKey possibleKey : possibleServiceKeys) {
> +         if (possibleKey.key().equals(serviceKey)) {
> +            serviceKeyFound = true;
> +         }
> +      }
> +      assertTrue(serviceKeyFound, "Expected but could not find ServiceKey 
> amongst " + possibleServiceKeys.size() + " found");
> +   }
> +   
> +   @Test (expectedExceptions = HttpResponseException.class)
> +   public void testRemoveNonExistentServiceKey() throws Exception {
> +      DeleteServiceKey deleteServiceKey = 
> DeleteServiceKey.create(UUID.randomUUID().toString().replaceAll("-", ""));
> +      api().deleteServiceKey(deleteServiceKey);

Given the exception from the provider can you determine if it is a "Not Found" 
exception? If you can, I'd create a custom fallback or configure the error 
handler to propagate a `ResourceNotFoundException` instead of the generic 
`HttpResponseException`. That's how all other jclouds providers behave.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/149/files#r26168241

Reply via email to