> +      try {
> +         Image image = api.getImage(id);
> +         assertRequestHasCommonProperties(server.takeRequest());
> +         assertNotNull(image);
> +         assertEquals(image.id(), id);
> +      } finally {
> +         pbApi.close();
> +         server.shutdown();
> +      }
> +
> +   }
> +
> +   @Test
> +   public void testGetNonExistingImage() throws Exception {
> +      MockWebServer server = mockWebServer();
> +      server.enqueue(new 
> MockResponse().setResponseCode(500).setBody(payloadFromResource("/image/image-not-found.xml")));

Hmmm this test depends on the 
`ResponseStatusFromPayloadHttpCommandExecutorService` fixing the response code. 
Even if the *real* provider returns a 500, I'd just configure a 404 response to 
make sure the API works, without coupling it to that class.
The `ResponseStatusFromPayloadHttpCommandExecutorService` tests should take 
care the status is properly fixed and that should be enough.

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

Reply via email to