> +      assertEquals(server.getRequestCount(), 1);
> +      assertSent(server, "GET", requestUrl + "/jcloudstest" + version);
> +   }
> +
> +   public void testGetResourceGroupReturns404() throws InterruptedException {
> +      server.enqueue(response404());
> +
> +      ResourceGroup resourceGroup = 
> api.getResourceGroupApi(subscriptionid).get("jcloudstest");
> +
> +      assertNull(resourceGroup);
> +
> +      assertEquals(server.getRequestCount(), 1);
> +      assertSent(server, "GET", requestUrl + "/jcloudstest" + version);
> +   }
> +
> +   // Commenting this out due to this error during CI run: Command not 
> considered safe to retry because request method is PATCH

> How come the mock tests and live tests all work for PATCH when I run this 
> locally when the default java driver does not support PATCH?

Perhaps because the code is reaching [this 
workaround](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java#L222-L270)?
 However (and despite that code works), I recall other errors at later stages 
of the HTTP request when using the java default driver with PATCH requests that 
also had a body. To have a proper patch support we'd better configure a driver 
that supports it by default.

> What is a good way to test this locally to ensure this is really using OkHttp 
> instead of the default java driver?

I don't think you need to test that. If you declare the module in the default 
module list in the api metadata, it is the one that will be used. When the 
[context builder creates the Guice 
injector](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/ContextBuilder.java#L396),
 it configures the Java default driver *only if no other HTTP driver module has 
been configured. So as long as you declare the http driver module in the 
metadata's default module list, you're good to go. In any case, you can always 
call `injector.getInstance(HttpCommandExecutorService.class)` and check the 
implementation you get.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/250/files/f7cc1b437f11378e105bba552e3cfee9d7491872#r57584713

Reply via email to