> +
> +   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");

That's what I tried initially, but the exception gets wrapped in an 
UncheckedExecutionException and it seemed unclear to use that as the expected 
exception in the Test annotation.

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

Reply via email to