> +
> +   public void testNonExistentVersion() throws Exception {
> +      // The referenced resource only an endpoint for v999.999 of the 
> GlanceApi
> +      HttpResponse localVersionNegotiationResponse = 
> HttpResponse.builder().statusCode(300).message("HTTP/1.1 300 Multiple 
> Choices").payload(
> +            
> payloadFromResourceWithContentType("/glanceVersionResponseVersionUnavailable.json",
>  "application/json")).build();
> +
> +      GlanceApi apiWhenExist = 
> requestsSendResponses(keystoneAuthWithUsernameAndPassword,
> +            responseWithKeystoneAccess, versionNegotiationRequest, 
> localVersionNegotiationResponse);
> +
> +      try {
> +         apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").list();
> +      } catch (UncheckedExecutionException e) {
> +          if (e.getCause().getClass() == HttpException.class)
> +              return;
> +      }
> +      fail("Did not throw expected HttpException");

Ah, OK, thanks for explaining. In that case, how about using the 
`@Test(expected = ...)` annotation in combination with:
```
try {
  ...
} catch (Unche... e) {
  // extract the actual, expected exception from the UncheckedEE wrapper
  throw e.getCause();
}
```

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

Reply via email to