You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/10/06 07:39:44 UTC

[6/7] JCLOUDS-152 remove RestContext and its dependencies.

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/config/BindRestContextWithWildcardExtendsExplicitAndRawTypeTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/config/BindRestContextWithWildcardExtendsExplicitAndRawTypeTest.java b/core/src/test/java/org/jclouds/config/BindRestContextWithWildcardExtendsExplicitAndRawTypeTest.java
deleted file mode 100644
index 3ccf54a..0000000
--- a/core/src/test/java/org/jclouds/config/BindRestContextWithWildcardExtendsExplicitAndRawTypeTest.java
+++ /dev/null
@@ -1,123 +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.config;
-
-import static com.google.common.base.Suppliers.ofInstance;
-import static org.easymock.EasyMock.createMock;
-import static org.testng.Assert.assertEquals;
-
-import javax.inject.Inject;
-
-import org.jclouds.Context;
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.IntegrationTestAsyncClient;
-import org.jclouds.http.IntegrationTestClient;
-import org.jclouds.providers.AnonymousProviderMetadata;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.config.BindProviderMetadataContextAndCredentials;
-import org.jclouds.rest.RestApiMetadata;
-import org.jclouds.rest.RestContext;
-import org.jclouds.rest.Utils;
-import org.jclouds.rest.internal.BaseRestApiTest.MockModule;
-import org.testng.annotations.Test;
-
-import com.google.common.reflect.TypeToken;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-
-@Test(groups = "unit", testName = "BindRestContextWithWildcardExtendsExplicitAndRawTypeTest")
-public class BindRestContextWithWildcardExtendsExplicitAndRawTypeTest {
-
-   @SuppressWarnings("rawtypes")
-   private static class ExpectedBindings {
-
-      private final RestContext raw;
-      private final RestContext<IntegrationTestClient, IntegrationTestAsyncClient> explicit;
-
-      @Inject
-      public ExpectedBindings(RestContext raw,
-               RestContext<IntegrationTestClient, IntegrationTestAsyncClient> explicit) {
-         this.raw = raw;
-         this.explicit = explicit;
-      }
-
-   }
-
-   @Test
-   public void testRawAndExplicit() {
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
-
-      ExpectedBindings bindings = injectorFor(md).getInstance(ExpectedBindings.class);
-      assertEquals(bindings.raw, bindings.explicit);
-   }
-
-   private Injector injectorFor(ProviderMetadata md) {
-      return Guice.createInjector(
-               new BindNameToContext("test"),
-               new BindProviderMetadataContextAndCredentials(md, ofInstance(new Credentials("user", "pass"))),
-               new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class.cast(md
-                                 .getApiMetadata())),
-                                 
-               // stuff needed for RestContextImpl
-               new MockModule(),
-               new AbstractModule() {
-                  
-                  @Override
-                  protected void configure() {
-                     bind(Utils.class).toInstance(createMock(Utils.class));
-                     bind(IntegrationTestClient.class).toInstance(createMock(IntegrationTestClient.class));
-                     bind(IntegrationTestAsyncClient.class).toInstance(createMock(IntegrationTestAsyncClient.class));
-                  }
-               });
-   }
-
-   @SuppressWarnings("rawtypes")
-   private static class ExpectedBindingsWithWildCardExtends {
-
-      private final RestContext raw;
-      private final RestContext<IntegrationTestClient, IntegrationTestAsyncClient> explicit;
-      private final RestContext<? extends IntegrationTestClient, ? extends IntegrationTestAsyncClient> wildcardExtends;
-
-      @Inject
-      public ExpectedBindingsWithWildCardExtends(RestContext raw,
-               RestContext<IntegrationTestClient, IntegrationTestAsyncClient> explicit,
-               RestContext<? extends IntegrationTestClient, ? extends IntegrationTestAsyncClient> wildcardExtends) {
-         this.raw = raw;
-         this.explicit = explicit;
-         this.wildcardExtends = wildcardExtends;
-      }
-
-   }
-
-   @Test
-   public void testRawExplicitAndWildCardExtends() {
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
-
-      TypeToken<? extends Context> wildCardExtendsType = new TypeToken<RestContext<? extends IntegrationTestClient, ? extends IntegrationTestAsyncClient>>() {
-         private static final long serialVersionUID = 1L;
-      };
-      
-      md = md.toBuilder().apiMetadata(md.getApiMetadata().toBuilder().context(wildCardExtendsType).build()).build();
-
-      ExpectedBindingsWithWildCardExtends bindings = injectorFor(md).getInstance(ExpectedBindingsWithWildCardExtends.class);
-      assertEquals(bindings.raw, bindings.explicit);
-      assertEquals(bindings.explicit, bindings.wildcardExtends);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/http/BaseJettyTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/http/BaseJettyTest.java b/core/src/test/java/org/jclouds/http/BaseJettyTest.java
index ee2b031..2e28cd0 100644
--- a/core/src/test/java/org/jclouds/http/BaseJettyTest.java
+++ b/core/src/test/java/org/jclouds/http/BaseJettyTest.java
@@ -27,6 +27,7 @@ import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterrup
 import static javax.servlet.http.HttpServletResponse.SC_OK;
 import static org.jclouds.Constants.PROPERTY_RELAX_HOSTNAME;
 import static org.jclouds.Constants.PROPERTY_TRUST_ALL_CERTS;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.jclouds.util.Closeables2.closeQuietly;
 import static org.jclouds.util.Strings2.toStringAndClose;
 
@@ -52,7 +53,6 @@ import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.jclouds.ContextBuilder;
 import org.jclouds.io.ByteStreams2;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.utils.TestUtils;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -248,9 +248,7 @@ public abstract class BaseJettyTest {
       properties.setProperty(PROPERTY_TRUST_ALL_CERTS, "true");
       properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true");
       return ContextBuilder
-            .newBuilder(
-                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
-                        IntegrationTestAsyncClient.class, "http://localhost:" + testPort))
+            .newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "http://localhost:" + testPort))
             .modules(ImmutableSet.<Module> copyOf(connectionModules)).overrides(properties);
    }
 

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/http/IntegrationTestAsyncClient.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/http/IntegrationTestAsyncClient.java b/core/src/test/java/org/jclouds/http/IntegrationTestAsyncClient.java
deleted file mode 100644
index 9265488..0000000
--- a/core/src/test/java/org/jclouds/http/IntegrationTestAsyncClient.java
+++ /dev/null
@@ -1,209 +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.http;
-
-import static com.google.common.util.concurrent.Futures.immediateFuture;
-
-import java.io.Closeable;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.inject.Singleton;
-import javax.ws.rs.GET;
-import javax.ws.rs.HEAD;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
-import org.jclouds.http.functions.ParseSax;
-import org.jclouds.http.options.HttpRequestOptions;
-import org.jclouds.io.Payload;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.XMLResponseParser;
-import org.jclouds.rest.binders.BindToJsonPayload;
-import org.jclouds.rest.binders.BindToStringPayload;
-import org.jclouds.util.Strings2;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.inject.Provides;
-
-/**
- * Sample test for the behaviour of our Integration Test jetty server.
- * 
- * @see IntegrationTestClient
- */
-public interface IntegrationTestAsyncClient extends Closeable {
-   @Target({ ElementType.METHOD })
-   @Retention(RetentionPolicy.RUNTIME)
-   @HttpMethod("ROWDY")
-   public @interface ROWDY {
-   }
-
-   @ROWDY
-   @Path("/objects/{id}")
-   ListenableFuture<String> rowdy(@PathParam("id") String path);
-
-   @HEAD
-   @Path("/objects/{id}")
-   @Fallback(FalseOnNotFoundOr404.class)
-   ListenableFuture<Boolean> exists(@PathParam("id") String path);
-
-   @GET
-   @Path("/objects/{id}")
-   ListenableFuture<String> download(@PathParam("id") String id);
-
-   ListenableFuture<HttpResponse> invoke(HttpRequest request);
-   
-   @GET
-   @Path("/{path}")
-   ListenableFuture<String> synch(@PathParam("path") String id);
-
-   @GET
-   @Path("/objects/{id}")
-   @Fallback(FooOnException.class)
-   ListenableFuture<String> downloadException(@PathParam("id") String id, HttpRequestOptions options);
-
-   static class FooOnException implements org.jclouds.Fallback<String> {
-      public ListenableFuture<String> create(Throwable t) throws Exception {
-         return immediateFuture("foo");
-      }
-
-      public String createOrPropagate(Throwable t) throws Exception {
-         return "foo";
-      }
-   }
-
-   @GET
-   @Path("/objects/{id}")
-   @Fallback(FooOnException.class)
-   ListenableFuture<String> synchException(@PathParam("id") String id, @HeaderParam("Range") String header);
-
-   @PUT
-   @Path("/objects/{id}")
-   ListenableFuture<String> upload(@PathParam("id") String id, @BinderParam(BindToStringPayload.class) String toPut);
-
-   @POST
-   @Path("/objects/{id}")
-   ListenableFuture<String> post(@PathParam("id") String id, @BinderParam(BindToStringPayload.class) String toPut);
-
-   @POST
-   @Path("/objects/{id}")
-   ListenableFuture<String> postAsInputStream(@PathParam("id") String id,
-         @BinderParam(BindToInputStreamPayload.class) String toPut);
-
-   static class BindToInputStreamPayload extends BindToStringPayload {
-      @Override
-      public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
-         request.setPayload(Strings2.toInputStream(payload.toString()));
-         request.getPayload().getContentMetadata().setContentLength((long) payload.toString().getBytes().length);
-         return request;
-      }
-   }
-
-   @Singleton
-   static class ResponsePayload implements Function<HttpResponse, Multimap<String, String>> {
-
-      public Multimap<String, String> apply(HttpResponse from) {
-         return from.getHeaders();
-      }
-
-   }
-
-   @POST
-   @Path("/objects/{id}")
-   @ResponseParser(ResponsePayload.class)
-   ListenableFuture<Multimap<String, String>> postPayloadAndReturnHeaders(@PathParam("id") String id, Payload payload);
-
-   @POST
-   @Path("/objects/{id}")
-   @MapBinder(BindToJsonPayload.class)
-   ListenableFuture<String> postJson(@PathParam("id") String id, @PayloadParam("key") String toPut);
-
-   @GET
-   @Path("/objects/{id}")
-   @RequestFilters(Filter.class)
-   ListenableFuture<String> downloadFilter(@PathParam("id") String id, @HeaderParam("filterme") String header);
-
-   static class Filter implements HttpRequestFilter {
-      public HttpRequest filter(HttpRequest request) throws HttpException {
-         if (request.getHeaders().containsKey("filterme")) {
-            request = request.toBuilder().replaceHeader("test", "test").build();
-         }
-         return request;
-      }
-   }
-
-   @GET
-   @Path("/objects/{id}")
-   ListenableFuture<String> download(@PathParam("id") String id, @HeaderParam("test") String header);
-
-   @GET
-   @Path("/objects/{id}")
-   @XMLResponseParser(BarHandler.class)
-   ListenableFuture<String> downloadAndParse(@PathParam("id") String id);
-
-   public static class BarHandler extends ParseSax.HandlerWithResult<String> {
-
-      private String bar = null;
-      private StringBuilder currentText = new StringBuilder();
-
-      @Override
-      public void endElement(String uri, String name, String qName) {
-         if (qName.equals("bar")) {
-            bar = currentText.toString();
-         }
-         currentText = new StringBuilder();
-      }
-
-      @Override
-      public void characters(char ch[], int start, int length) {
-         currentText.append(ch, start, length);
-
-      }
-
-      @Override
-      public String getResult() {
-         return bar;
-      }
-
-   }
-
-   @POST
-   @Path("/objects/{id}")
-   ListenableFuture<Void> postNothing(@PathParam("id") String id);
-   
-   @PUT
-   @Path("/objects/{id}")
-   ListenableFuture<Void> putNothing(@PathParam("id") String id);
-
-   @Provides
-   StringBuilder newStringBuilder();
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java b/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java
index 56b0f9d..f421016 100644
--- a/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java
+++ b/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.jclouds.http.handlers;
+
 import static org.jclouds.reflect.Reflection2.method;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -26,7 +27,6 @@ import org.jclouds.ContextBuilder;
 import org.jclouds.http.HttpCommand;
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.HttpResponse;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
 import org.jclouds.io.Payloads;
 import org.jclouds.providers.AnonymousProviderMetadata;
@@ -129,7 +129,7 @@ public class BackoffLimitedRetryHandlerTest {
    
 
    private HttpCommand createCommand() throws SecurityException, NoSuchMethodException {
-      Invokable<IntegrationTestAsyncClient, String> method = method(IntegrationTestAsyncClient.class, "download", String.class);
+      Invokable<IntegrationTestClient, String> method = method(IntegrationTestClient.class, "download", String.class);
 
       return new HttpCommand(processor.apply(Invocation.create(method, ImmutableList.<Object> of("1"))));
    }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/http/handlers/RedirectionRetryHandlerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/http/handlers/RedirectionRetryHandlerTest.java b/core/src/test/java/org/jclouds/http/handlers/RedirectionRetryHandlerTest.java
index eb9686b..e7df0f8 100644
--- a/core/src/test/java/org/jclouds/http/handlers/RedirectionRetryHandlerTest.java
+++ b/core/src/test/java/org/jclouds/http/handlers/RedirectionRetryHandlerTest.java
@@ -22,14 +22,13 @@ import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 
 import org.jclouds.ContextBuilder;
 import org.jclouds.http.HttpCommand;
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.HttpResponse;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.rest.internal.BaseRestApiTest.MockModule;
 import org.testng.annotations.Test;
 
@@ -42,10 +41,8 @@ import com.google.inject.Module;
  */
 @Test(groups = "unit")
 public class RedirectionRetryHandlerTest {
-   Injector injector = ContextBuilder.newBuilder(
-            AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
-                     IntegrationTestAsyncClient.class, "http://localhost")).modules(
-            ImmutableSet.<Module> of(new MockModule())).buildInjector();
+   Injector injector = ContextBuilder.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "http://localhost"))
+         .modules(ImmutableSet.<Module>of(new MockModule())).buildInjector();
 
    @Test
    public void test302DoesNotRetry() {

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/providers/config/BindProviderMetadataContextAndCredentialsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/providers/config/BindProviderMetadataContextAndCredentialsTest.java b/core/src/test/java/org/jclouds/providers/config/BindProviderMetadataContextAndCredentialsTest.java
index 32b7b00..22cc9f8 100644
--- a/core/src/test/java/org/jclouds/providers/config/BindProviderMetadataContextAndCredentialsTest.java
+++ b/core/src/test/java/org/jclouds/providers/config/BindProviderMetadataContextAndCredentialsTest.java
@@ -16,6 +16,7 @@
  */
 package org.jclouds.providers.config;
 
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.testng.Assert.assertEquals;
 
 import java.util.Properties;
@@ -28,13 +29,11 @@ import org.jclouds.Context;
 import org.jclouds.apis.ApiMetadata;
 import org.jclouds.domain.Credentials;
 import org.jclouds.domain.LoginCredentials;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
 import org.jclouds.internal.FilterStringsBoundToInjectorByName;
 import org.jclouds.javax.annotation.Nullable;
 import org.jclouds.location.Iso3166;
 import org.jclouds.location.Provider;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.providers.ProviderMetadata;
 import org.jclouds.rest.annotations.Api;
 import org.jclouds.rest.annotations.ApiVersion;
@@ -94,9 +93,8 @@ public class BindProviderMetadataContextAndCredentialsTest {
 
    @Test
    public void testExpectedBindingsWhenCredentialIsNotNull() {
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
       Supplier<Credentials> creds = Suppliers.<Credentials> ofInstance(LoginCredentials.builder().user("user")
             .password("password").build());
 
@@ -108,9 +106,8 @@ public class BindProviderMetadataContextAndCredentialsTest {
 
    @Test
    public void testExpectedBindingsWhenCredentialIsNull() {
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
       Supplier<Credentials> creds = Suppliers.<Credentials> ofInstance(LoginCredentials.builder().user("user").build());
 
       ExpectedBindings bindings = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds))
@@ -121,9 +118,8 @@ public class BindProviderMetadataContextAndCredentialsTest {
    
    @Test
    public void testExpectedBindingsWhenBuildVersionAbsent() {
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
       ApiMetadata apiMd = md.getApiMetadata().toBuilder().buildVersion(null).build();
       md = md.toBuilder().apiMetadata(apiMd).build();
       Supplier<Credentials> creds = Suppliers.<Credentials> ofInstance(LoginCredentials.builder().user("user").build());
@@ -135,9 +131,8 @@ public class BindProviderMetadataContextAndCredentialsTest {
 
    @Test
    public void testProviderOverridesApiMetadataProperty() {
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
       Properties defaultProps = md.getDefaultProperties();
       defaultProps.setProperty(Constants.PROPERTY_SESSION_INTERVAL, Integer.MAX_VALUE + "");
       md = md.toBuilder().defaultProperties(defaultProps).build();

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/providers/internal/UpdateProviderMetadataFromPropertiesTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/providers/internal/UpdateProviderMetadataFromPropertiesTest.java b/core/src/test/java/org/jclouds/providers/internal/UpdateProviderMetadataFromPropertiesTest.java
index d5a4f1a..8c92002 100644
--- a/core/src/test/java/org/jclouds/providers/internal/UpdateProviderMetadataFromPropertiesTest.java
+++ b/core/src/test/java/org/jclouds/providers/internal/UpdateProviderMetadataFromPropertiesTest.java
@@ -17,14 +17,13 @@
 package org.jclouds.providers.internal;
 
 import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.testng.Assert.assertEquals;
 
 import java.util.Properties;
 
 import org.jclouds.Constants;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.providers.ProviderMetadata;
 import org.testng.annotations.Test;
 
@@ -35,8 +34,7 @@ public class UpdateProviderMetadataFromPropertiesTest {
 
    @Test
    public void testProviderMetadataWithUpdatedEndpointUpdatesAndRetainsAllDefaultPropertiesExceptEndpoint() {
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
       Properties props = new Properties();
       props.putAll(md.getDefaultProperties());
@@ -50,8 +48,7 @@ public class UpdateProviderMetadataFromPropertiesTest {
    
    @Test
    public void testProviderMetadataWithUpdatedIso3166CodesUpdatesAndRetainsAllDefaultPropertiesExceptIso3166Codes() {
-      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
-               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
+      ProviderMetadata md = forApiOnEndpoint(IntegrationTestClient.class, "http://localhost");
 
       Properties props = new Properties();
       props.putAll(md.getDefaultProperties());

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/InputParamValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/InputParamValidatorTest.java b/core/src/test/java/org/jclouds/rest/InputParamValidatorTest.java
index 3723035..61f2c5f 100644
--- a/core/src/test/java/org/jclouds/rest/InputParamValidatorTest.java
+++ b/core/src/test/java/org/jclouds/rest/InputParamValidatorTest.java
@@ -16,6 +16,7 @@
  */
 package org.jclouds.rest;
 
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.jclouds.reflect.Reflection2.method;
 
 import javax.ws.rs.POST;
@@ -23,10 +24,8 @@ import javax.ws.rs.PathParam;
 
 import org.jclouds.ContextBuilder;
 import org.jclouds.http.HttpRequest;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
 import org.jclouds.predicates.validators.AllLowerCaseValidator;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.reflect.Invocation;
 import org.jclouds.rest.annotations.ParamValidators;
 import org.jclouds.rest.internal.RestAnnotationProcessor;
@@ -109,10 +108,8 @@ public class InputParamValidatorTest {
 
    @BeforeClass
    void setupFactory() {
-      injector =  ContextBuilder
-            .newBuilder(
-                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class, IntegrationTestAsyncClient.class,
-                        "http://localhost:9999")).buildInjector();
+      injector = ContextBuilder.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "http://localhost:9999"))
+            .buildInjector();
       restAnnotationProcessor = injector.getInstance(RestAnnotationProcessor.class);
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/annotationparsing/ClosableApiTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/ClosableApiTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/ClosableApiTest.java
index 7e10c8e..ea6b5cd 100644
--- a/core/src/test/java/org/jclouds/rest/annotationparsing/ClosableApiTest.java
+++ b/core/src/test/java/org/jclouds/rest/annotationparsing/ClosableApiTest.java
@@ -20,13 +20,13 @@ import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
-import static org.jclouds.providers.AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint;
 
 import java.io.Closeable;
 import java.io.IOException;
 
 import org.jclouds.ContextBuilder;
 import org.jclouds.concurrent.config.ExecutorServiceModule;
+import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.providers.ProviderMetadata;
 import org.testng.annotations.Test;
 
@@ -45,11 +45,7 @@ public class ClosableApiTest {
    interface DelegatingApi extends Closeable {
    }
 
-   interface DelegatingAsyncApi extends Closeable {
-   }
-
-   ProviderMetadata provider = forClientMappedToAsyncClientOnEndpoint(DelegatingApi.class, DelegatingAsyncApi.class,
-         "http://mock");
+   ProviderMetadata provider = AnonymousProviderMetadata.forApiOnEndpoint(DelegatingApi.class, "http://mock");
 
    public void testApiClosesExecutorServiceOnClose() throws IOException {
       ListeningExecutorService executor = createMock(ListeningExecutorService.class);

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java
index 22061c5..03dacec 100644
--- a/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java
+++ b/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java
@@ -16,7 +16,7 @@
  */
 package org.jclouds.rest.annotationparsing;
 
-import static org.jclouds.providers.AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.testng.Assert.assertTrue;
 
 import javax.ws.rs.FormParam;
@@ -29,17 +29,15 @@ import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.HttpResponse;
 import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
 import org.jclouds.rest.annotations.Delegate;
 import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.Payload;
 import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.config.RestClientModule;
+import org.jclouds.rest.config.HttpApiModule;
 import org.jclouds.rest.internal.BaseRestApiExpectTest;
 import org.testng.annotations.Test;
 
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListenableFuture;
 import com.google.inject.Module;
 
 /**
@@ -57,35 +55,18 @@ public class DelegateAnnotationExpectTest extends BaseRestApiExpectTest<Delegate
       DiskApi getDiskApiForProject(@PayloadParam("project") @PathParam("project") String projectName);
    }
 
-   interface DelegatingAsyncApi {
-      @Delegate
-      DiskAsyncApi getDiskApiForProjectForm(@FormParam("project") String projectName);
-
-      @Delegate
-      @Path("/projects/{project}")
-      DiskAsyncApi getDiskApiForProject(@PayloadParam("project") @PathParam("project") String projectName);
-   }
-
    interface DiskApi {
-      void form();
-
-      void syncAll();
-
-      boolean exists(@PathParam("disk") String diskName);
-   }
-
-   interface DiskAsyncApi {
       @POST
-      ListenableFuture<Void> form();
+      void form();
 
       @POST
       @Payload("<Sync>{project}</Sync>")
-      ListenableFuture<Void> syncAll();
-      
+      void syncAll();
+
       @HEAD
       @Path("/disks/{disk}")
       @Fallback(FalseOnNotFoundOr404.class)
-      ListenableFuture<Boolean> exists(@PathParam("disk") String diskName);
+      boolean exists(@PathParam("disk") String diskName);
    }
 
    public void testDelegatingCallTakesIntoConsiderationAndCalleeFormParam() {
@@ -121,22 +102,16 @@ public class DelegateAnnotationExpectTest extends BaseRestApiExpectTest<Delegate
 
    @Override
    public ProviderMetadata createProviderMetadata() {
-      return forClientMappedToAsyncClientOnEndpoint(DelegatingApi.class, DelegatingAsyncApi.class, "http://mock");
+      return forApiOnEndpoint(DelegatingApi.class, "http://mock");
    }
 
    @Override
    protected Module createModule() {
-      return new DelegatingRestClientModule();
+      return new DelegatingHttpApiModule();
    }
 
-   @ConfiguresRestClient
-   static class DelegatingRestClientModule extends RestClientModule<DelegatingApi, DelegatingAsyncApi> {
-
-      public DelegatingRestClientModule() {
-         // right now, we have to define the delegates by hand as opposed to
-         // reflection looking for coordinated annotations
-         super(ImmutableMap.<Class<?>, Class<?>> of(DiskApi.class, DiskAsyncApi.class));
-      }
+   @ConfiguresHttpApi
+   static class DelegatingHttpApiModule extends HttpApiModule<DelegatingApi> {
    }
 
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java
index 337490a..20446bf 100644
--- a/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java
+++ b/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java
@@ -16,7 +16,7 @@
  */
 package org.jclouds.rest.annotationparsing;
 
-import static org.jclouds.providers.AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
@@ -38,7 +38,6 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Function;
 import com.google.common.base.Functions;
-import com.google.common.util.concurrent.ListenableFuture;
 
 /**
  * Tests the use of the {@link JAXBResponseParser} annotation.
@@ -67,36 +66,26 @@ public class JAXBResponseParserAnnotationExpectTest extends
    }
 
    public interface TestJAXBApi extends Closeable {
-      TestJAXBDomain jaxbGetWithAnnotation();
-
-      Object jaxbGetWithAnnotationAndCustomClass();
-
-      TestJAXBDomain jaxbGetWithAcceptHeader();
-
-      String jaxbGetWithTransformer();
-   }
-
-   public interface TestJAXBAsyncApi extends Closeable {
       @GET
       @Path("/jaxb/annotation")
       @JAXBResponseParser
-      ListenableFuture<TestJAXBDomain> jaxbGetWithAnnotation();
+      TestJAXBDomain jaxbGetWithAnnotation();
 
       @GET
       @Path("/jaxb/custom")
       @JAXBResponseParser(TestJAXBDomain.class)
-      ListenableFuture<Object> jaxbGetWithAnnotationAndCustomClass();
+      Object jaxbGetWithAnnotationAndCustomClass();
 
       @GET
       @Path("/jaxb/header")
       @Consumes(MediaType.APPLICATION_XML)
-      ListenableFuture<TestJAXBDomain> jaxbGetWithAcceptHeader();
+      TestJAXBDomain jaxbGetWithAcceptHeader();
 
       @GET
       @Path("/jaxb/transformer")
       @JAXBResponseParser(TestJAXBDomain.class)
       @Transform(ToString.class)
-      ListenableFuture<String> jaxbGetWithTransformer();
+      String jaxbGetWithTransformer();
    }
 
    private static class ToString implements Function<Object, String> {
@@ -150,7 +139,6 @@ public class JAXBResponseParserAnnotationExpectTest extends
 
    @Override
    public ProviderMetadata createProviderMetadata() {
-      return forClientMappedToAsyncClientOnEndpoint(TestJAXBApi.class, TestJAXBAsyncApi.class, "http://mock");
+      return forApiOnEndpoint(TestJAXBApi.class, "http://mock");
    }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/annotationparsing/ProvidesAnnotationExpectTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/ProvidesAnnotationExpectTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/ProvidesAnnotationExpectTest.java
index 19260d8..11f190e 100644
--- a/core/src/test/java/org/jclouds/rest/annotationparsing/ProvidesAnnotationExpectTest.java
+++ b/core/src/test/java/org/jclouds/rest/annotationparsing/ProvidesAnnotationExpectTest.java
@@ -16,7 +16,6 @@
  */
 package org.jclouds.rest.annotationparsing;
 
-import static org.jclouds.providers.AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint;
 import static org.testng.Assert.assertEquals;
 
 import java.io.Closeable;
@@ -27,10 +26,11 @@ import javax.inject.Named;
 
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.HttpResponse;
+import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.providers.ProviderMetadata;
 import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.config.RestClientModule;
+import org.jclouds.rest.ConfiguresHttpApi;
+import org.jclouds.rest.config.HttpApiModule;
 import org.jclouds.rest.internal.BaseRestApiExpectTest;
 import org.testng.annotations.Test;
 
@@ -64,23 +64,6 @@ public class ProvidesAnnotationExpectTest extends BaseRestApiExpectTest<Provides
       Set<String> noSuchElementException();
    }
 
-   interface ProvidingAsyncApi extends Closeable {
-      @Provides
-      Set<String> set();
-
-      @Named("bar")
-      @Provides
-      Set<String> foo();
-
-      @Named("exception")
-      @Provides
-      Set<String> exception();
-
-      @Named("NoSuchElementException")
-      @Provides
-      Set<String> noSuchElementException();
-   }
-
    @Test
    public void testProvidesWithGeneric() {
       ProvidingApi client = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse> of());
@@ -110,16 +93,16 @@ public class ProvidesAnnotationExpectTest extends BaseRestApiExpectTest<Provides
 
    @Override
    public ProviderMetadata createProviderMetadata() {
-      return forClientMappedToAsyncClientOnEndpoint(ProvidingApi.class, ProvidingAsyncApi.class, "http://mock");
+      return AnonymousProviderMetadata.forApiOnEndpoint(ProvidingApi.class, "http://mock");
    }
 
    @Override
    protected Module createModule() {
-      return new ProvidingRestClientModule();
+      return new ProvidingHttpApiModule();
    }
 
-   @ConfiguresRestClient
-   static class ProvidingRestClientModule extends RestClientModule<ProvidingApi, ProvidingAsyncApi> {
+   @ConfiguresHttpApi
+   static class ProvidingHttpApiModule extends HttpApiModule<ProvidingApi> {
 
       @Override
       protected void configure() {

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/config/MappedHttpInvocationModuleTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/config/MappedHttpInvocationModuleTest.java b/core/src/test/java/org/jclouds/rest/config/MappedHttpInvocationModuleTest.java
deleted file mode 100644
index bff7f30..0000000
--- a/core/src/test/java/org/jclouds/rest/config/MappedHttpInvocationModuleTest.java
+++ /dev/null
@@ -1,114 +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.rest.config;
-
-import static com.google.common.base.Predicates.not;
-import static com.google.common.collect.Maps.filterEntries;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jclouds.rest.HttpAsyncClient;
-import org.jclouds.rest.HttpClient;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.reflect.Invokable;
-import com.google.common.reflect.TypeToken;
-import com.google.common.util.concurrent.ListenableFuture;
-
-@Test(groups = "unit")
-public class MappedHttpInvocationModuleTest {
-   interface Sync {
-      String get();
-   }
-
-   private interface Async {
-      ListenableFuture<String> get();
-   }
-
-   public void testPutInvokablesWhenInterfacesMatch() {
-      Cache<Invokable<?, ?>, Invokable<?, ?>> cache = CacheBuilder.newBuilder().build();
-      SyncToAsyncHttpInvocationModule.putInvokables(Sync.class, Async.class, cache);
-
-      assertEquals(cache.size(), 1);
-
-      Invokable<?, ?> sync = cache.asMap().keySet().iterator().next();
-      assertEquals(sync.getOwnerType().getRawType(), Sync.class);
-      assertEquals(sync.getName(), "get");
-      assertEquals(sync.getReturnType(), TypeToken.of(String.class));
-
-      Invokable<?, ?> async = cache.getIfPresent(sync);
-      assertEquals(async.getOwnerType().getRawType(), Async.class);
-      assertEquals(async.getName(), "get");
-      assertEquals(async.getReturnType(), new TypeToken<ListenableFuture<String>>() {
-         private static final long serialVersionUID = 1L;
-      });
-   }
-
-   private interface AsyncWithException {
-      ListenableFuture<String> get() throws IOException;
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".* has different typed exceptions than target .*")
-   public void testPutInvokablesWhenInterfacesMatchExceptExceptions() {
-      Cache<Invokable<?, ?>, Invokable<?, ?>> cache = CacheBuilder.newBuilder().build();
-      SyncToAsyncHttpInvocationModule.putInvokables(Sync.class, AsyncWithException.class, cache);
-   }
-
-   private interface AsyncWithMisnamedMethod {
-      ListenableFuture<String> got();
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "no such method .*")
-   public void testPutInvokablesWhenTargetMethodNotFound() {
-      Cache<Invokable<?, ?>, Invokable<?, ?>> cache = CacheBuilder.newBuilder().build();
-      SyncToAsyncHttpInvocationModule.putInvokables(Sync.class, AsyncWithMisnamedMethod.class, cache);
-   }
-
-   static final Predicate<Entry<Invokable<?, ?>, Invokable<?, ?>>> isHttpInvokable = new Predicate<Map.Entry<Invokable<?, ?>, Invokable<?, ?>>>() {
-      public boolean apply(Map.Entry<Invokable<?, ?>, Invokable<?, ?>> in) {
-         return in.getKey().getOwnerType().getRawType().equals(HttpClient.class)
-               && in.getValue().getOwnerType().getRawType().equals(HttpAsyncClient.class);
-      }
-   };
-
-   public void testSeedKnownSync2AsyncIncludesHttpClientByDefault() {
-      Map<Invokable<?, ?>, Invokable<?, ?>> cache = SyncToAsyncHttpInvocationModule.seedKnownSync2AsyncInvokables(
-            ImmutableMap.<Class<?>, Class<?>> of()).asMap();
-
-      assertEquals(cache.size(), 6);
-      assertEquals(filterEntries(cache, isHttpInvokable), cache);
-   }
-
-   public void testSeedKnownSync2AsyncInvokablesInterfacesMatch() {
-      Map<Invokable<?, ?>, Invokable<?, ?>> cache = SyncToAsyncHttpInvocationModule.seedKnownSync2AsyncInvokables(
-            ImmutableMap.<Class<?>, Class<?>> of(Sync.class, Async.class)).asMap();
-
-      assertEquals(cache.size(), 7);
-
-      cache = filterEntries(cache, not(isHttpInvokable));
-
-      assertEquals(cache.size(), 1);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/internal/BaseAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/internal/BaseAsyncClientTest.java b/core/src/test/java/org/jclouds/rest/internal/BaseAsyncClientTest.java
deleted file mode 100644
index 26c4de5..0000000
--- a/core/src/test/java/org/jclouds/rest/internal/BaseAsyncClientTest.java
+++ /dev/null
@@ -1,25 +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.rest.internal;
-
-import org.testng.annotations.Test;
-
-@Test(groups = "unit")
-// TODO: remove once abiquo no longer uses this.
-public abstract class BaseAsyncClientTest<T> extends BaseRestAnnotationProcessingTest<T> {
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java b/core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java
index fe09a0b..f0b87fc 100644
--- a/core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java
+++ b/core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java
@@ -557,8 +557,6 @@ public abstract class BaseRestApiExpectTest<S> {
       ApiMetadata am = builder.getApiMetadata();
       if (am instanceof HttpApiMetadata) {
          this.api = HttpApiMetadata.class.cast(am).getApi();
-      } else if (am instanceof org.jclouds.rest.RestApiMetadata) {
-         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
       } else {
          throw new UnsupportedOperationException("unsupported base type: " + am);
       }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/internal/BaseRestApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/internal/BaseRestApiMetadataTest.java b/core/src/test/java/org/jclouds/rest/internal/BaseRestApiMetadataTest.java
deleted file mode 100644
index 20f4d75..0000000
--- a/core/src/test/java/org/jclouds/rest/internal/BaseRestApiMetadataTest.java
+++ /dev/null
@@ -1,46 +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.rest.internal;
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.util.Set;
-
-import org.jclouds.View;
-import org.jclouds.apis.ApiMetadata;
-import org.jclouds.apis.Apis;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.jclouds.rest.RestApiMetadata;
-import org.jclouds.rest.RestContext;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-@Test(groups = "unit")
-public abstract class BaseRestApiMetadataTest extends BaseApiMetadataTest {
-
-   public BaseRestApiMetadataTest(RestApiMetadata toTest, Set<TypeToken<? extends View>> views) {
-     super(toTest, views);
-   }
-
-   @Test
-   public void testContextAssignableFromRestContext() {
-      Set<ApiMetadata> all = ImmutableSet.copyOf(Apis.contextAssignableFrom(typeToken(RestContext.class)));
-      assert all.contains(toTest) : String.format("%s not found in %s", toTest, all);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/internal/InvokeMappedHttpMethodTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/internal/InvokeMappedHttpMethodTest.java b/core/src/test/java/org/jclouds/rest/internal/InvokeMappedHttpMethodTest.java
deleted file mode 100644
index 5b56ea2..0000000
--- a/core/src/test/java/org/jclouds/rest/internal/InvokeMappedHttpMethodTest.java
+++ /dev/null
@@ -1,171 +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.rest.internal;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Named;
-
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpCommandExecutorService;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.config.InvocationConfig;
-import org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.InvokeAndTransform;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import com.google.common.util.concurrent.TimeLimiter;
-
-@Test(groups = "unit", singleThreaded = true)
-public class InvokeMappedHttpMethodTest {
-
-   public interface ThingApi {
-      HttpResponse get();
-   }
-
-   public interface ThingAsyncApi {
-      @Named("ns:get")
-      ListenableFuture<HttpResponse> get();
-   }
-
-   private Invocation get;
-   private Invocation asyncGet;
-   private Function<Invocation, Invocation> sync2async;
-   private HttpRequest getRequest = HttpRequest.builder().method("GET").endpoint("http://get").build();
-   private HttpCommand getCommand = new HttpCommand(getRequest);
-   private Function<Invocation, HttpRequest> toRequest;
-
-   @BeforeClass
-   void setupInvocations() throws SecurityException, NoSuchMethodException {
-      get = Invocation.create(method(ThingApi.class, "get"), ImmutableList.of());
-      asyncGet = Invocation.create(method(ThingAsyncApi.class, "get"), ImmutableList.of());
-      sync2async = Functions.forMap(ImmutableMap.of(get, asyncGet));
-      toRequest = Functions.forMap(ImmutableMap.of(asyncGet, getRequest));
-   }
-
-   @SuppressWarnings("unchecked")
-   private Function<HttpRequest, Function<HttpResponse, ?>> transformerForRequest = Function.class.cast(Functions
-         .constant(Functions.identity()));
-   private ListeningExecutorService userThreads = MoreExecutors.sameThreadExecutor();
-
-   private HttpResponse response = HttpResponse.builder().statusCode(200).payload("foo").build();
-   private HttpCommandExecutorService http;
-   private TimeLimiter timeLimiter;
-   @SuppressWarnings("rawtypes")
-   private org.jclouds.Fallback fallback;
-   private InvocationConfig config;
-   private InvokeSyncToAsyncHttpMethod invokeHttpMethod;
-
-   private ListenableFuture<HttpResponse> future;
-
-   @SuppressWarnings("unchecked")
-   @BeforeMethod
-   void createMocks() {
-      http = createMock(HttpCommandExecutorService.class);
-      timeLimiter = createMock(TimeLimiter.class);
-      fallback = createMock(org.jclouds.Fallback.class);
-      config = createMock(InvocationConfig.class);
-      future = createMock(ListenableFuture.class);
-      invokeHttpMethod = new InvokeSyncToAsyncHttpMethod(sync2async, toRequest, http, transformerForRequest, timeLimiter, config,
-            userThreads);
-      expect(config.getCommandName(asyncGet)).andReturn("ns:get");
-      expect(config.getFallback(asyncGet)).andReturn(fallback);
-   }
-
-   @AfterMethod
-   void verifyMocks() {
-      verify(http, timeLimiter, fallback, config, future);
-   }
-
-   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
-      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.of(250000000l));
-      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
-      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
-      replay(http, timeLimiter, fallback, config, future);
-      invokeHttpMethod.apply(get);
-   }
-
-   public void testMethodWithNoTimeoutCallGetDirectly() throws Exception {
-      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.<Long> absent());
-      expect(http.invoke(new HttpCommand(getRequest))).andReturn(response);
-      replay(http, timeLimiter, fallback, config, future);
-      invokeHttpMethod.apply(get);
-   }
-
-   public void testAsyncMethodSubmitsRequest() throws Exception {
-      expect(http.submit(new HttpCommand(getRequest))).andReturn(future);
-      future.addListener(anyObject(Runnable.class), eq(userThreads));
-      replay(http, timeLimiter, fallback, config, future);
-      invokeHttpMethod.apply(asyncGet);
-   }
-
-   private HttpResponse fallbackResponse = HttpResponse.builder().statusCode(200).payload("bar").build();
-
-   public void testDirectCallRunsFallbackCreateOrPropagate() throws Exception {
-      IllegalStateException exception = new IllegalStateException();
-      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.<Long> absent());
-      expect(http.invoke(new HttpCommand(getRequest))).andThrow(exception);
-      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
-      replay(http, timeLimiter, fallback, config, future);
-      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
-   }
-
-   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
-      IllegalStateException exception = new IllegalStateException();
-      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.of(250000000l));
-      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
-      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
-      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
-      replay(http, timeLimiter, fallback, config, future);
-      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
-   }
-
-   @SuppressWarnings("unchecked")
-   public void testSubmitRunsFallbackCreateOnGet() throws Exception {
-      IllegalStateException exception = new IllegalStateException();
-      expect(http.submit(new HttpCommand(getRequest))).andReturn(
-            Futures.<HttpResponse> immediateFailedFuture(exception));
-      expect(fallback.create(exception)).andReturn(Futures.<HttpResponse> immediateFuture(fallbackResponse));
-      // not using the field, as you can see above we are making an immediate
-      // failed future instead.
-      future = createMock(ListenableFuture.class);
-      replay(http, timeLimiter, fallback, config, future);
-      assertEquals(ListenableFuture.class.cast(invokeHttpMethod.apply(asyncGet)).get(), fallbackResponse);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/65d40b44/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java
index 9f6d413..a16eb91 100644
--- a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java
+++ b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java
@@ -18,8 +18,11 @@ package org.jclouds.rest.internal;
 
 import static com.google.common.base.Charsets.UTF_8;
 import static com.google.common.base.Preconditions.checkNotNull;
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
 import static org.jclouds.io.Payloads.newInputStreamPayload;
 import static org.jclouds.io.Payloads.newStringPayload;
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.jclouds.reflect.Reflection2.method;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNull;
@@ -38,6 +41,7 @@ import java.lang.annotation.Target;
 import java.net.URI;
 import java.net.URLEncoder;
 import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -45,6 +49,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
+
 import javax.inject.Named;
 import javax.inject.Qualifier;
 import javax.inject.Singleton;
@@ -90,10 +95,8 @@ import org.jclouds.io.PayloadEnclosing;
 import org.jclouds.io.Payloads;
 import org.jclouds.javax.annotation.Nullable;
 import org.jclouds.logging.config.NullLoggingModule;
-import org.jclouds.providers.AnonymousProviderMetadata;
 import org.jclouds.reflect.Invocation;
-import org.jclouds.reflect.InvocationSuccess;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
 import org.jclouds.rest.InvocationContext;
 import org.jclouds.rest.annotations.BinderParam;
 import org.jclouds.rest.annotations.Delegate;
@@ -119,8 +122,7 @@ import org.jclouds.rest.annotations.WrapWith;
 import org.jclouds.rest.binders.BindAsHostPrefix;
 import org.jclouds.rest.binders.BindToJsonPayload;
 import org.jclouds.rest.binders.BindToStringPayload;
-import org.jclouds.rest.config.RestClientModule;
-import org.jclouds.rest.functions.ImplicitOptionalConverter;
+import org.jclouds.rest.config.HttpApiModule;
 import org.jclouds.util.Strings2;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
@@ -144,7 +146,6 @@ import com.google.common.io.ByteSource;
 import com.google.common.io.Files;
 import com.google.common.net.HttpHeaders;
 import com.google.common.reflect.Invokable;
-import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.inject.AbstractModule;
 import com.google.inject.ConfigurationException;
@@ -152,19 +153,12 @@ import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Provides;
 import com.google.inject.TypeLiteral;
-/**
- * Tests behavior of {@code RestAnnotationProcessor}
- */
-// NOTE:without testName, this will not call @Before* and fail w/NPE during
-// surefire
+
 @Test(groups = "unit", testName = "RestAnnotationProcessorTest")
 public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
-   @ConfiguresRestClient
-   protected static class CallerModule extends RestClientModule<Caller, AsyncCaller> {
-      CallerModule() {
-         super(ImmutableMap.<Class<?>, Class<?>> of(Callee.class, AsyncCallee.class, Callee2.class, AsyncCallee2.class));
-      }
+   @ConfiguresHttpApi
+   protected static class CallerModule extends HttpApiModule<Caller> {
 
       @Override
       protected void configure() {
@@ -176,39 +170,37 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
    }
 
    @Path("/client/{jclouds.api-version}")
-   public interface AsyncCallee extends Closeable {
+   public interface Callee extends Closeable {
       @GET
       @Path("/{path}")
-      ListenableFuture<Void> onePath(@PathParam("path") String path);
+      void onePath(@PathParam("path") String path);
 
       @POST
-      ListenableFuture<Void> testWithoutProducesAndConsumes();
+      void testWithoutProducesAndConsumes();
 
       @POST
-      @Produces(MediaType.APPLICATION_XML)
-      @Consumes(MediaType.APPLICATION_XML)
-      ListenableFuture<Void> testProducesAndConsumesOnMethod();
+      @Produces(APPLICATION_XML)
+      @Consumes(APPLICATION_XML)
+      void testProducesAndConsumesOnMethod();
    }
 
    @Path("/client/{jclouds.api-version}")
-   @Produces(MediaType.APPLICATION_XML)
-   @Consumes(MediaType.APPLICATION_XML)
-   public interface AsyncCalleeWithProducesAndConsumesOnClass extends Closeable {
+   @Produces(APPLICATION_XML)
+   @Consumes(APPLICATION_XML)
+   public interface CalleeWithProducesAndConsumesOnClass extends Closeable {
       @POST
-      ListenableFuture<Void> testProducesAndConsumesOnClass();
+      void testProducesAndConsumesOnClass();
    }
 
    @Path("/client/{jclouds.api-version}")
-   public interface AsyncCallee2 {
+   public interface Callee2 {
       @GET
       @Path("/{path}/2")
-      ListenableFuture<Void> onePath(@PathParam("path") String path);
+      void onePath(@PathParam("path") String path);
    }
 
    @Endpoint(Localhost2.class)
    public interface Caller extends Closeable {
-
-      // tests that we can pull from suppliers
       @Provides
       @Localhost2
       URI getURI();
@@ -233,98 +225,21 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       Callee getCalleeWithHeader(@EndpointParam URI endpoint, @HeaderParam("header") String header);
 
       @Delegate
+      @Produces(APPLICATION_JSON)
+      @Consumes(APPLICATION_JSON)
       Callee getCalleeWithoutProducesAndConsumes();
 
       @Delegate
+      @Produces(APPLICATION_JSON)
+      @Consumes(APPLICATION_JSON)
       Callee getCalleeWithProducesAndConsumesOnMethod();
 
       @Delegate
+      @Produces(APPLICATION_JSON)
+      @Consumes(APPLICATION_JSON)
       CalleeWithProducesAndConsumesOnClass getCalleeWithProducesAndConsumesOnClass();
    }
 
-   public interface Callee extends Closeable {
-      void onePath(String path);
-      void testWithoutProducesAndConsumes();
-      void testProducesAndConsumesOnMethod();
-   }
-
-   public interface CalleeWithProducesAndConsumesOnClass extends Closeable {
-      void testProducesAndConsumesOnClass();
-   }
-
-   public interface Callee2 {
-      void onePath(String path);
-   }
-
-   public interface AsyncCaller extends Closeable {
-      @Provides
-      @Localhost2
-      URI getURI();
-
-      @Delegate
-      AsyncCallee getCallee();
-
-      @Delegate
-      AsyncCallee2 getCallee2();
-
-      @Delegate
-      AsyncCallee getCallee(@EndpointParam URI endpoint);
-
-      @Delegate
-      Optional<AsyncCallee> getOptionalCallee(@EndpointParam URI endpoint);
-
-      @Delegate
-      @Path("/testing/testing/{wibble}")
-      AsyncCallee getCalleeWithPath(@EndpointParam URI endpoint, @PathParam("wibble") String wibble);
-
-      @Delegate
-      AsyncCallee getCalleeWithHeader(@EndpointParam URI endpoint, @HeaderParam("header") String header);
-
-      @Delegate
-      @Produces(MediaType.APPLICATION_JSON)
-      @Consumes(MediaType.APPLICATION_JSON)
-      AsyncCallee getCalleeWithoutProducesAndConsumes();
-
-      @Delegate
-      @Produces(MediaType.APPLICATION_JSON)
-      @Consumes(MediaType.APPLICATION_JSON)
-      AsyncCallee getCalleeWithProducesAndConsumesOnMethod();
-
-      @Delegate
-      @Produces(MediaType.APPLICATION_JSON)
-      @Consumes(MediaType.APPLICATION_JSON)
-      AsyncCalleeWithProducesAndConsumesOnClass getCalleeWithProducesAndConsumesOnClass();
-   }
-
-   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesVersionAndPath() throws InterruptedException,
-         ExecutionException {
-      Injector child = injectorForCaller(new HttpCommandExecutorService() {
-
-         @Override
-         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
-         }
-
-         @Override
-         public HttpResponse invoke(HttpCommand command) {
-            assertEquals(command.getCurrentRequest().getRequestLine(),
-                  "GET http://localhost:9999/client/1/foo HTTP/1.1");
-            return HttpResponse.builder().build();
-         }
-
-      });
-
-      try {
-         child.getInstance(AsyncCallee.class);
-         fail("Callee shouldn't be bound yet");
-      } catch (ConfigurationException e) {
-
-      }
-
-      child.getInstance(AsyncCaller.class).getCallee().onePath("foo").get();
-
-   }
-
    public void testDelegateIsLazyLoadedAndRequestIncludesVersionAndPath() throws InterruptedException,
          ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
@@ -332,7 +247,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError();
          }
 
          @Override
@@ -361,43 +276,13 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       child.getInstance(Caller.class).getCallee().onePath("foo");
    }
 
-   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPath() throws InterruptedException,
-         ExecutionException {
-      Injector child = injectorForCaller(new HttpCommandExecutorService() {
-
-         @Override
-         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
-         }
-
-         @Override
-         public HttpResponse invoke(HttpCommand command) {
-            assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://howdyboys/client/1/foo HTTP/1.1");
-            return HttpResponse.builder().build();
-         }
-
-      });
-
-      try {
-         child.getInstance(AsyncCallee.class);
-         fail("Callee shouldn't be bound yet");
-      } catch (ConfigurationException e) {
-
-      }
-
-      child.getInstance(AsyncCaller.class).getCallee(URI.create("http://howdyboys")).onePath("foo").get();
-
-      assertEquals(child.getInstance(AsyncCaller.class).getURI(), URI.create("http://localhost:1111"));
-
-   }
-
-   public void testAsyncDelegateWithPathParamIsLazyLoadedAndRequestIncludesEndpointVersionAndPath()
+   public void testDelegateWithPathParamIsLazyLoadedAndRequestIncludesEndpointVersionAndPath()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
@@ -410,25 +295,25 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      child.getInstance(AsyncCaller.class).getCalleeWithPath(URI.create("http://howdyboys"), "thepathparam")
-            .onePath("foo").get();
+      child.getInstance(Caller.class).getCalleeWithPath(URI.create("http://howdyboys"), "thepathparam")
+            .onePath("foo");
 
-      assertEquals(child.getInstance(AsyncCaller.class).getURI(), URI.create("http://localhost:1111"));
+      assertEquals(child.getInstance(Caller.class).getURI(), URI.create("http://localhost:1111"));
    }
 
-   public void testAsyncDelegateWithHeaderParamIsLazyLoadedAndRequestIncludesEndpointVersionAndHeader()
+   public void testDelegateWithHeaderParamIsLazyLoadedAndRequestIncludesEndpointVersionAndHeader()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
@@ -440,146 +325,113 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      child.getInstance(AsyncCaller.class).getCalleeWithHeader(URI.create("http://howdyboys"), "theheaderparam")
-            .onePath("foo").get();
+      child.getInstance(Caller.class).getCalleeWithHeader(URI.create("http://howdyboys"), "theheaderparam")
+            .onePath("foo");
    }
 
-   public void testAsyncDelegateWithoutProducesAndConsumes()
+   public void testDelegateWithoutProducesAndConsumes()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
          public HttpResponse invoke(HttpCommand command) {
             assertEquals(
                   command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
-                  MediaType.APPLICATION_JSON);
-            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(MediaType.APPLICATION_JSON));
+                  APPLICATION_JSON);
+            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(APPLICATION_JSON));
             return HttpResponse.builder().build();
          }
 
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      child.getInstance(AsyncCaller.class).getCalleeWithoutProducesAndConsumes()
-            .testWithoutProducesAndConsumes().get();
+      child.getInstance(Caller.class).getCalleeWithoutProducesAndConsumes().testWithoutProducesAndConsumes();
    }
 
-   public void testAsyncDelegateWithProducesAndConsumesOnMethodIsLazyLoaded()
+   public void testDelegateWithProducesAndConsumesOnMethodIsLazyLoaded()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
          public HttpResponse invoke(HttpCommand command) {
             assertEquals(
                   command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
-                  MediaType.APPLICATION_XML);
-            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(MediaType.APPLICATION_XML));
+                  APPLICATION_XML);
+            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(APPLICATION_XML));
             return HttpResponse.builder().build();
          }
 
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      child.getInstance(AsyncCaller.class).getCalleeWithProducesAndConsumesOnMethod()
-            .testProducesAndConsumesOnMethod().get();
+      child.getInstance(Caller.class).getCalleeWithProducesAndConsumesOnMethod().testProducesAndConsumesOnMethod();
    }
 
-   public void testAsyncDelegateWithProducesAndConsumesOnClassIsLazyLoaded()
+   public void testDelegateWithProducesAndConsumesOnClassIsLazyLoaded()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
          public HttpResponse invoke(HttpCommand command) {
             assertEquals(
                   command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
-                  MediaType.APPLICATION_XML);
-            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(MediaType.APPLICATION_XML));
-            return HttpResponse.builder().build();
-         }
-
-      });
-
-      try {
-         child.getInstance(AsyncCallee.class);
-         fail("Callee shouldn't be bound yet");
-      } catch (ConfigurationException e) {
-
-      }
-
-      child.getInstance(AsyncCaller.class).getCalleeWithProducesAndConsumesOnClass()
-            .testProducesAndConsumesOnClass().get();
-   }
-
-   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathOptionalPresent()
-         throws InterruptedException, ExecutionException {
-      Injector child = injectorForCaller(new HttpCommandExecutorService() {
-
-         @Override
-         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
-         }
-
-         @Override
-         public HttpResponse invoke(HttpCommand command) {
-            assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://howdyboys/client/1/foo HTTP/1.1");
+                  APPLICATION_XML);
+            assertTrue(command.getCurrentRequest().getHeaders().get("Accept").contains(APPLICATION_XML));
             return HttpResponse.builder().build();
          }
 
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      child.getInstance(AsyncCaller.class).getOptionalCallee(URI.create("http://howdyboys")).get().onePath("foo").get();
-
-      assertEquals(child.getInstance(AsyncCaller.class).getURI(), URI.create("http://localhost:1111"));
-
+      child.getInstance(Caller.class).getCalleeWithProducesAndConsumesOnClass().testProducesAndConsumesOnClass();
    }
 
-   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathCanOverrideOptionalBehaviour()
+   public void testDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathOptionalPresent()
          throws InterruptedException, ExecutionException {
       Injector child = injectorForCaller(new HttpCommandExecutorService() {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
@@ -588,32 +440,18 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
             return HttpResponse.builder().build();
          }
 
-      }, new AbstractModule() {
-
-         @Override
-         protected void configure() {
-            bind(ImplicitOptionalConverter.class).toInstance(new ImplicitOptionalConverter() {
-
-               @Override
-               public Optional<Object> apply(InvocationSuccess input) {
-                  return Optional.absent();
-               }
-
-            });
-         }
-
       });
 
       try {
-         child.getInstance(AsyncCallee.class);
+         child.getInstance(Callee.class);
          fail("Callee shouldn't be bound yet");
       } catch (ConfigurationException e) {
 
       }
 
-      assert !child.getInstance(AsyncCaller.class).getOptionalCallee(URI.create("http://howdyboys")).isPresent();
+      child.getInstance(Caller.class).getOptionalCallee(URI.create("http://howdyboys")).get().onePath("foo");
 
-      assertEquals(child.getInstance(AsyncCaller.class).getURI(), URI.create("http://localhost:1111"));
+      assertEquals(child.getInstance(Caller.class).getURI(), URI.create("http://localhost:1111"));
 
    }
 
@@ -623,7 +461,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
          @Override
          public ListenableFuture<HttpResponse> submit(HttpCommand command) {
-            return Futures.immediateFuture(invoke(command));
+            throw new AssertionError("jclouds no longer uses the submit method");
          }
 
          @Override
@@ -646,13 +484,12 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
    }
 
    private Injector injectorForCaller(HttpCommandExecutorService service, Module... modules) {
-      return ContextBuilder
-            .newBuilder(
-                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(Caller.class, AsyncCaller.class,
-                        "http://localhost:9999"))
-            .modules(
-                  ImmutableSet.<Module> builder().add(new MockModule(service)).add(new NullLoggingModule())
-                        .add(new CallerModule()).addAll(ImmutableSet.<Module> copyOf(modules)).build()).buildInjector();
+      return ContextBuilder.newBuilder(forApiOnEndpoint(Caller.class, "http://localhost:9999"))
+                           .modules(ImmutableSet.<Module> builder()
+                                                .add(new MockModule(service))
+                                                .add(new NullLoggingModule())
+                                                .add(new CallerModule())
+                                                .addAll(Arrays.asList(modules)).build()).buildInjector();
 
    }
 
@@ -1256,12 +1093,12 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @GET
       @Path("/")
       @Consumes("application/json")
-      ListenableFuture<Map<String, String>> testGeneric2();
+      Map<String, String> testGeneric2();
 
       @GET
       @Path("/")
       @Consumes("application/json")
-      ListenableFuture<? extends Map<String, String>> testGeneric3();
+      Map<String, String> testGeneric3();
 
       @GET
       @Path("/")
@@ -1283,30 +1120,30 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @Path("/")
       @Unwrap
       @Consumes("application/json")
-      ListenableFuture<String> testUnwrap2();
+      String testUnwrap2();
 
       @GET
       @Path("/")
       @Unwrap
       @Consumes("application/json")
-      ListenableFuture<Set<String>> testUnwrap3();
+      Set<String> testUnwrap3();
 
       @GET
       @Path("/")
       @Unwrap
       @Consumes("application/json")
-      ListenableFuture<? extends Set<String>> testUnwrap4();
+      Set<String> testUnwrap4();
 
       @GET
       @Path("/")
       @SelectJson("jobid")
-      ListenableFuture<Long> selectLong();
+      Long selectLong();
 
       @GET
       @Path("/")
       @SelectJson("jobid")
       @Transform(AddOne.class)
-      ListenableFuture<Long> selectLongAddOne();
+      Long selectLongAddOne();
 
       static class AddOne implements Function<Long, Long> {
 
@@ -1321,7 +1158,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @SelectJson("runit")
       @OnlyElement
       @Consumes("application/json")
-      ListenableFuture<String> selectOnlyElement();
+      String selectOnlyElement();
 
       @Target({ ElementType.METHOD })
       @Retention(RetentionPolicy.RUNTIME)
@@ -1331,11 +1168,11 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
       @ROWDY
       @Path("/strings/{id}")
-      ListenableFuture<Boolean> rowdy(@PathParam("id") String path);
+      Boolean rowdy(@PathParam("id") String path);
 
       @ROWDY
       @Path("/ints/{id}")
-      ListenableFuture<Boolean> rowdy(@PathParam("id") int path);
+      Boolean rowdy(@PathParam("id") int path);
    }
 
    static class View {
@@ -1594,9 +1431,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       // Now let's create a new injector with the property set. Use that to create the annotation processor.
       Properties overrides = new Properties();
       overrides.setProperty(Constants.PROPERTY_STRIP_EXPECT_HEADER, "true");
-      Injector injector = ContextBuilder.newBuilder(
-            AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(Callee.class, AsyncCallee.class,
-               "http://localhost:9999"))
+      Injector injector = ContextBuilder.newBuilder(forApiOnEndpoint(Callee.class, "http://localhost:9999"))
          .modules(ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
             protected void configure() {
                bind(new TypeLiteral<Supplier<URI>>() {
@@ -1931,31 +1766,31 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
    public interface TestTransformers {
       @GET
-      ListenableFuture<Integer> noTransformer();
+      Integer noTransformer();
 
       @GET
       @ResponseParser(ReturnStringIf2xx.class)
-      ListenableFuture<Void> oneTransformer();
+      void oneTransformer();
 
       @GET
       @ResponseParser(ReturnStringIf200Context.class)
-      ListenableFuture<Void> oneTransformerWithContext();
+      void oneTransformerWithContext();
 
       @GET
-      ListenableFuture<InputStream> futureInputStream();
+      InputStream futureInputStream();
 
       @GET
-      ListenableFuture<URI> futureUri();
+      URI futureUri();
 
       @PUT
-      ListenableFuture<Void> put(Payload payload);
+      void put(Payload payload);
 
       @PUT
       @Headers(keys = "Transfer-Encoding", values = "chunked")
-      ListenableFuture<Void> putXfer(Payload payload);
+      void putXfer(Payload payload);
 
       @PUT
-      ListenableFuture<Void> put(PayloadEnclosing payload);
+      void put(PayloadEnclosing payload);
    }
 
    public void testPutPayloadEnclosing() throws SecurityException, NoSuchMethodException, IOException {
@@ -2149,48 +1984,48 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @GET
       @VirtualHost
       @Path("/{id}")
-      ListenableFuture<String> get(@PathParam("id") String id, HttpRequestOptions options);
+      String get(@PathParam("id") String id, HttpRequestOptions options);
 
       @GET
       @VirtualHost
       @Path("/{id}")
-      ListenableFuture<String> get(@PathParam("id") String id, HttpRequestOptions... options);
+      String get(@PathParam("id") String id, HttpRequestOptions... options);
 
       @GET
       @Path("/{id}")
       @ResponseParser(ReturnStringIf2xx.class)
-      ListenableFuture<String> get(@PathParam("id") String id, @HeaderParam(HttpHeaders.HOST) String host);
+      String get(@PathParam("id") String id, @HeaderParam(HttpHeaders.HOST) String host);
 
       @GET
       @Path("/{id}")
       @QueryParams(keys = "max-keys", values = "0")
-      ListenableFuture<String> getQuery(@PathParam("id") String id);
+      String getQuery(@PathParam("id") String id);
 
       @GET
       @Path("/{id}")
       @QueryParams(keys = "acl")
-      ListenableFuture<String> getQueryNull(@PathParam("id") String id);
+      String getQueryNull(@PathParam("id") String id);
 
       @GET
       @Path("/{id}")
       @QueryParams(keys = "acl", values = "")
-      ListenableFuture<String> getQueryEmpty(@PathParam("id") String id);
+      String getQueryEmpty(@PathParam("id") String id);
 
       @PUT
       @Path("/{id}")
-      ListenableFuture<String> put(@PathParam("id") @ParamParser(FirstCharacter.class) String id,
+      String put(@PathParam("id") @ParamParser(FirstCharacter.class) String id,
             @BinderParam(BindToStringPayload.class) String payload);
 
       @PUT
       @Path("/{id}")
       @VirtualHost
-      ListenableFuture<String> putOptions(@PathParam("id") String id, HttpRequestOptions options);
+      String putOptions(@PathParam("id") String id, HttpRequestOptions options);
 
       @PUT
       @Path("/{id}")
       @Headers(keys = "foo", values = "--{id}--")
       @ResponseParser(ReturnTrueIf2xx.class)
-      ListenableFuture<String> putHeader(@PathParam("id") String id,
+      String putHeader(@PathParam("id") String id,
             @BinderParam(BindToStringPayload.class) String payload);
    }
 
@@ -2335,7 +2170,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @GET
       @Path("/{id}")
       @VirtualHost
-      public ListenableFuture<String> get(@PathParam("id") String id, String foo) {
+      public String get(@PathParam("id") String id, String foo) {
          return null;
       }
    }
@@ -2356,11 +2191,11 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
       @GET
       @Path("/{id}")
       @VirtualHost
-      ListenableFuture<String> get(@PathParam("id") String id, String foo);
+      String get(@PathParam("id") String id, String foo);
 
       @GET
       @Path("/{id}")
-      ListenableFuture<String> getPrefix(@PathParam("id") String id, @BinderParam(BindAsHostPrefix.class) String foo);
+      String getPrefix(@PathParam("id") String id, @BinderParam(BindAsHostPrefix.class) String foo);
 
    }
 
@@ -2501,7 +2336,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
 
       @PUT
       @Path("/{foo}")
-      ListenableFuture<Void> putWithPath(@PathParam("foo") String path,
+      void putWithPath(@PathParam("foo") String path,
             @BinderParam(BindToStringPayload.class) String content);
 
       @PUT
@@ -2653,9 +2488,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
    @BeforeClass
    void setupFactory() {
       injector = ContextBuilder
-            .newBuilder(
-                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(Callee.class, AsyncCallee.class,
-                        "http://localhost:9999"))
+            .newBuilder(forApiOnEndpoint(Callee.class, "http://localhost:9999"))
             .modules(ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
                protected void configure() {
                   bind(new TypeLiteral<Supplier<URI>>() {