> + 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); > + } > +}
We said that the preferred way to unit test the APIs was to use `mockwebserver` instead of the Expect tests. As this is a new test class, could it be refactored to a *MockTest that uses `mockwebserver`? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/48/files#r7513413