You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2015/06/26 14:44:53 UTC

[18/50] [abbrv] jclouds git commit: MockTests now support PATCH semantics

MockTests now support PATCH semantics


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/47725877
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/47725877
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/47725877

Branch: refs/heads/master
Commit: 4772587722d9d1cba14ae4acd720b88f275be96f
Parents: e4cc728
Author: Daniel Broudy <br...@google.com>
Authored: Mon Dec 15 14:59:50 2014 -0800
Committer: Ignasi Barrera <na...@apache.org>
Committed: Tue Dec 16 00:44:33 2014 +0100

----------------------------------------------------------------------
 providers/google-compute-engine/pom.xml         |  6 ++
 .../features/BackendServiceApiExpectTest.java   | 73 ------------------
 .../features/BackendServiceApiMockTest.java     | 18 ++++-
 .../features/FirewallApiExpectTest.java         | 64 ----------------
 .../features/FirewallApiMockTest.java           | 18 +++++
 .../features/HttpHealthCheckApiExpectTest.java  | 55 --------------
 .../features/HttpHealthCheckApiMockTest.java    | 12 +++
 .../features/UrlMapApiExpectTest.java           | 79 --------------------
 .../features/UrlMapApiMockTest.java             |  4 +-
 .../BaseGoogleComputeEngineApiMockTest.java     |  5 +-
 10 files changed, 57 insertions(+), 277 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/pom.xml
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/pom.xml b/providers/google-compute-engine/pom.xml
index 4c01bbc..c5837ff 100644
--- a/providers/google-compute-engine/pom.xml
+++ b/providers/google-compute-engine/pom.xml
@@ -99,6 +99,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.jclouds.driver</groupId>
+            <artifactId>jclouds-okhttp</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiExpectTest.java
deleted file mode 100644
index 79fd5f7..0000000
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiExpectTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class BackendServiceApiExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> {
-
-   private static final String ENDPOINT_BASE = "https://www.googleapis.com/"
-            + "compute/v1/projects/party/global/backendServices";
-
-   private org.jclouds.http.HttpRequest.Builder<? extends HttpRequest.Builder<?>> getBasicRequest() {
-      return HttpRequest.builder().addHeader("Accept", "application/json")
-                                  .addHeader("Authorization", "Bearer " + TOKEN);
-   }
-
-   private HttpResponse createResponse(String payloadFile) {
-      return HttpResponse.builder().statusCode(200)
-                                   .payload(payloadFromResource(payloadFile))
-                                   .build();
-   }
-
-   public void testPatchBackendServiceResponseIs2xx() throws IOException {
-      HttpRequest request = getBasicRequest().method("PATCH")
-               .endpoint(ENDPOINT_BASE + "/jclouds-test")
-               .payload(payloadFromResourceWithContentType("/backend_service_insert.json",
-                                                           APPLICATION_JSON))
-               .build();
-      HttpResponse response = createResponse("/operation.json");
-
-      BackendServiceApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
-              TOKEN_RESPONSE, request, response).backendServices();
-
-      List<URI> healthChecks = ImmutableList.of(URI.create("https://www.googleapis.com/compute/v1/projects/"
-                          + "myproject/global/httpHealthChecks/jclouds-test"));
-      assertEquals(api.patch("jclouds-test", new BackendServiceOptions().name("jclouds-test")
-                                                                         .protocol("HTTP")
-                                                                         .port(80)
-                                                                         .timeoutSec(30)
-                                                                         .healthChecks(healthChecks)),
-                   new ParseOperationTest().expected());
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
index ba5bfe0..1cc8400 100644
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
+++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
@@ -85,6 +85,23 @@ public class BackendServiceApiMockTest extends BaseGoogleComputeEngineApiMockTes
             stringFromResource("/backend_service_insert.json"));
    }
 
+   public void patch() throws Exception {
+      server.enqueue(jsonResponse("/operation.json"));
+
+      List<URI> healthChecks = ImmutableList.of(URI.create(url("/projects/"
+            + "myproject/global/httpHealthChecks/jclouds-test")));
+
+      assertEquals(backendServiceApi().patch("jclouds-test",
+            new BackendServiceOptions().name("jclouds-test")
+               .protocol("HTTP")
+               .port(80)
+               .timeoutSec(30)
+               .healthChecks(healthChecks)),
+            new ParseOperationTest().expected(url("/projects")));
+      assertSent(server, "PATCH", "/projects/party/global/backendServices/jclouds-test",
+            stringFromResource("/backend_service_insert.json"));
+   }
+
    public void delete() throws Exception {
       server.enqueue(jsonResponse("/operation.json"));
 
@@ -102,7 +119,6 @@ public class BackendServiceApiMockTest extends BaseGoogleComputeEngineApiMockTes
       assertSent(server, "DELETE", "/projects/party/global/backendServices/jclouds-test");
    }
 
-
    public void list() throws Exception {
       server.enqueue(jsonResponse("/backend_service_list.json"));
 

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java
deleted file mode 100644
index b5ed9a1..0000000
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "FirewallApiExpectTest")
-public class FirewallApiExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> {
-
-   public void testPatchFirewallResponseIs2xx() throws IOException {
-      HttpRequest update = HttpRequest
-              .builder()
-              .method("PATCH")
-              .endpoint(BASE_URL + "/party/global/firewalls/myfw")
-              .addHeader("Accept", "application/json")
-              .addHeader("Authorization", "Bearer " + TOKEN)
-              .payload(payloadFromResource("/firewall_insert.json"))
-              .build();
-
-      HttpResponse updateFirewallResponse = HttpResponse.builder().statusCode(200)
-              .payload(payloadFromResource("/operation.json")).build();
-
-      FirewallApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
-              TOKEN_RESPONSE, update,
-              updateFirewallResponse).firewalls();
-
-      assertEquals(api.patch("myfw",
-              new FirewallOptions()
-                      .name("myfw")
-                      .network(URI.create(BASE_URL + "/party/global/networks/default"))
-                      .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22", "23-24")))
-                      .addSourceTag("tag1")
-                      .addSourceRange("10.0.1.0/32")
-                      .addTargetTag("tag2")), new ParseOperationTest().expected());
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
index ba8afef..bae4f72 100644
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
+++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
@@ -115,6 +115,24 @@ public class FirewallApiMockTest extends BaseGoogleComputeEngineApiMockTest {
             stringFromResource("/firewall_insert.json"));
    }
 
+   public void patch() throws Exception {
+      server.enqueue(jsonResponse("/operation.json"));
+
+      FirewallOptions options = new FirewallOptions()
+         .name("myfw")
+         .network(URI.create(url("/projects/party/global/networks/default")))
+         .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22", "23-24")))
+         .addSourceTag("tag1")
+         .addSourceRange("10.0.1.0/32")
+         .addTargetTag("tag2");
+
+      assertEquals(firewallApi().patch("myfw", options),
+            new ParseOperationTest().expected(url("/projects")));
+
+      assertSent(server, "PATCH", "/projects/party/global/firewalls/myfw",
+            stringFromResource("/firewall_insert.json"));
+   }
+
    FirewallApi firewallApi(){
       return api().firewalls();
    }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java
deleted file mode 100644
index 2b50537..0000000
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "HttpHealthCheckApiExpectTest")
-public class HttpHealthCheckApiExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> {
-
-   public void testPatchHttpHealthChecksResponseIs2xx() {
-      String healthCheckName = "http-health-check";
-      HttpRequest patch = HttpRequest
-            .builder()
-            .method("PATCH")
-            .endpoint(BASE_URL + "/party/global/httpHealthChecks/" + healthCheckName)
-            .addHeader("Accept", "application/json")
-            .addHeader("Authorization", "Bearer " + TOKEN)
-            .payload(payloadFromResourceWithContentType("/httphealthcheck_patch.json", MediaType.APPLICATION_JSON))
-            .build();
-
-       HttpResponse insertHttpHealthCheckResponse = HttpResponse.builder().statusCode(200)
-               .payload(payloadFromResource("/global_operation.json")).build();
-
-       HttpHealthCheckApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
-               TOKEN_RESPONSE, patch,
-               insertHttpHealthCheckResponse).httpHeathChecks();
-       HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder().timeoutSec(0).unhealthyThreshold(0).buildNoDefaults();
-       assertEquals(api.patch(healthCheckName, options), new ParseGlobalOperationTest().expected());
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
index 2943a33..ebc86fe 100644
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
+++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
@@ -87,6 +87,18 @@ public class HttpHealthCheckApiMockTest extends BaseGoogleComputeEngineApiMockTe
             stringFromResource("/httphealthcheck_insert.json"));
    }
 
+   public void patch() throws Exception {
+      server.enqueue(jsonResponse("/global_operation.json"));
+
+      HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder()
+         .timeoutSec(0).unhealthyThreshold(0).buildNoDefaults();
+      assertEquals(httpHealthCheckApi().patch("http-health-check", options),
+            new ParseGlobalOperationTest().expected(url("/projects")));
+
+      assertSent(server, "PATCH", "/projects/party/global/httpHealthChecks/http-health-check",
+            stringFromResource("/httphealthcheck_patch.json"));
+   }
+
    public void list() throws Exception {
       server.enqueue(jsonResponse("/httphealthcheck_list.json"));
 

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiExpectTest.java
deleted file mode 100644
index 885ab88..0000000
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiExpectTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.domain.UrlMap.HostRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher.PathRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class UrlMapApiExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> {
-
-
-   public void patch() throws IOException {
-      HttpRequest request = HttpRequest.builder()
-            .addHeader("Accept", "application/json")
-            .addHeader("Authorization", "Bearer " + TOKEN)
-            .method("PATCH")
-            .endpoint("https://www.googleapis.com/compute/v1/projects"
-                     + "/party/global/urlMaps/jclouds-test")
-            .payload(payloadFromResourceWithContentType("/url_map_insert.json", MediaType.APPLICATION_JSON))
-            .build();
-
-      HttpResponse response = HttpResponse.builder().statusCode(200)
-            .payload(payloadFromResource("/operation.json"))
-            .build();
-
-      UrlMapApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
-              TOKEN_RESPONSE, request, response).urlMaps();
-
-      assertEquals(api.patch("jclouds-test", createBasicMap()), new ParseOperationTest().expected());
-   }
-
-   private UrlMapOptions createBasicMap() {
-      URI service = URI.create("https://www.googleapis.com/compute/v1/projects/"
-               + "myproject/global/backendServices/jclouds-test");
-      return new UrlMapOptions().name("jclouds-test")
-                                .description("Sample url map")
-                                .hostRule(HostRule.create(null, ImmutableList.of("jclouds-test"), "path"))
-                                .pathMatcher(PathMatcher.create("path",
-                                                                null,
-                                                                service,
-                                                                ImmutableList.of(
-                                                                      PathRule.create(ImmutableList.of("/"),
-                                                                                      service))))
-                                .test(UrlMap.UrlMapTest.create(null, "jclouds-test", "/test/path", service))
-                                .defaultService(service);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
index b0de3d8..1107557 100644
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
+++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
@@ -70,9 +70,7 @@ public class UrlMapApiMockTest extends BaseGoogleComputeEngineApiMockTest {
             stringFromResource("/url_map_insert.json"));
    }
 
-/*
    public void patch() throws Exception {
-      // PATCH not yet supported
       server.enqueue(jsonResponse("/operation.json"));
 
       assertEquals(urlMapApi().patch("jclouds-test", createBasicMap()),
@@ -80,7 +78,7 @@ public class UrlMapApiMockTest extends BaseGoogleComputeEngineApiMockTest {
       assertSent(server, "PATCH", "/projects/party/global/urlMaps/jclouds-test",
             stringFromResource("/url_map_insert.json"));
    }
-*/
+
    public void delete() throws Exception {
       server.enqueue(jsonResponse("/operation.json"));
 

http://git-wip-us.apache.org/repos/asf/jclouds/blob/47725877/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
----------------------------------------------------------------------
diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
index a9f4483..8907be9 100644
--- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
+++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
@@ -36,6 +36,7 @@ import org.jclouds.ContextBuilder;
 import org.jclouds.compute.ComputeService;
 import org.jclouds.compute.ComputeServiceContext;
 import org.jclouds.concurrent.config.ExecutorServiceModule;
+import org.jclouds.http.okhttp.config.OkHttpCommandExecutorServiceModule;
 import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.GoogleComputeEngineProviderMetadata;
 import org.testng.annotations.AfterMethod;
@@ -49,7 +50,7 @@ import com.squareup.okhttp.mockwebserver.MockWebServer;
 import com.squareup.okhttp.mockwebserver.RecordedRequest;
 
 /**
- * Tests need to run {@code singleThreaded = true) as otherwise tests will clash on the server field.
+ * Tests need to run {@code singleThreaded = true} as otherwise tests will clash on the server field.
  * Sharing the server field means less code to write.
  */
 public class BaseGoogleComputeEngineApiMockTest {
@@ -80,7 +81,7 @@ public class BaseGoogleComputeEngineApiMockTest {
    }
 
    private final Set<Module> modules = ImmutableSet
-         .of(new ExecutorServiceModule(sameThreadExecutor()), GoogleComputeEngineTestModule.INSTANCE);
+         .of(new ExecutorServiceModule(sameThreadExecutor()), GoogleComputeEngineTestModule.INSTANCE, new OkHttpCommandExecutorServiceModule());
 
    final AtomicInteger suffix = new AtomicInteger();