> +      assertEquals(webhook.getLinks().size(), 2);
> +   }
> +
> +   public void testGetWebhookFail() {
> +      URI endpoint = 
> URI.create("https://dfw.autoscale.api.rackspacecloud.com/v1.0/888888/groups/1234567890/policies/321456/webhooks/5555";);
> +      WebhookApi api = requestsSendResponses(
> +            keystoneAuthWithUsernameAndPasswordAndTenantName,
> +            responseWithKeystoneAccess,
> +            authenticatedGET().endpoint(endpoint).build(),
> +            
> HttpResponse.builder().statusCode(404).payload(payloadFromResource("/autoscale_webhook_get_response.json")).build()
> +            ).getWebhookApiForGroupAndPolicyInZone("1234567890", "321456", 
> "DFW");
> +
> +      WebhookResponse webhook = api.get("5555");
> +      assertNull(webhook);
> +   }
> +}

I'm not sure that is a good idea. If we pospose this refactor, does anyone know 
when it will be addressed (or if it will just happen)? In my opinion, if we 
have decided to implement unit tests in a certain way, we should do that 
directly when we add a new test class. Adding tests to an already existing 
class is different, but when writing an entire class form scratch, we should do 
it the right way. My main worries about leaving this out of this PR is that we 
are introducing more technical debt to the project, and we already have an 
important an amount of it (trove is part of that technical debt, but IMO that 
does not justify not implementing tests here the right way).

There are also several open pull requests where we asked to implement the tests 
using `mockwebserver` (see the Joyen blob store one, for example), and we 
should be consistent with that in other pull requests.

No offense :) I'm just trying to make this PR follow what we thought was a 
better way to implement unit tests, but we can discuss that :) If we are asking 
people to do so, we'd better give them some examples and do it ourselves too.

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

Reply via email to