diff --git a/aws/s3/core/src/main/java/org/jclouds/aws/s3/handlers/AWSRedirectionRetryHandler.java b/aws/s3/core/src/main/java/org/jclouds/aws/s3/handlers/AWSRedirectionRetryHandler.java index b6fcec9541..377cfc3f11 100644 --- a/aws/s3/core/src/main/java/org/jclouds/aws/s3/handlers/AWSRedirectionRetryHandler.java +++ b/aws/s3/core/src/main/java/org/jclouds/aws/s3/handlers/AWSRedirectionRetryHandler.java @@ -23,6 +23,7 @@ */ package org.jclouds.aws.s3.handlers; +import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; import org.jclouds.aws.domain.AWSError; @@ -31,7 +32,6 @@ import org.jclouds.aws.s3.util.S3Utils; import org.jclouds.aws.s3.xml.S3ParserFactory; import org.jclouds.http.HttpCommand; import org.jclouds.http.HttpException; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpResponse; import org.jclouds.http.handlers.BackoffLimitedRetryHandler; import org.jclouds.http.handlers.RedirectionRetryHandler; diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/filters/RequestAuthorizeSignatureTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/filters/RequestAuthorizeSignatureTest.java index 7d7b2fd72a..e68adc5cfd 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/filters/RequestAuthorizeSignatureTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/filters/RequestAuthorizeSignatureTest.java @@ -27,10 +27,10 @@ import static org.testng.Assert.assertEquals; import java.net.URI; +import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; import org.jclouds.aws.s3.reference.S3Constants; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.util.DateService; import org.testng.annotations.BeforeClass; diff --git a/core/src/main/java/org/jclouds/http/HttpCommand.java b/core/src/main/java/org/jclouds/http/HttpCommand.java index 957c7b0d7f..6b81ad1a58 100644 --- a/core/src/main/java/org/jclouds/http/HttpCommand.java +++ b/core/src/main/java/org/jclouds/http/HttpCommand.java @@ -48,5 +48,5 @@ public interface HttpCommand extends EndpointCommand - * - * ==================================================================== - * 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; - -/** - * {@code HttpMethod} is an enumeration of HTTP methods used in {@link TransformingHttpCommand} - * - * @author Adrian Cole - */ -public enum HttpMethod { - DELETE, GET, HEAD, POST, PUT -} diff --git a/core/src/main/java/org/jclouds/http/HttpRequest.java b/core/src/main/java/org/jclouds/http/HttpRequest.java index 71d4476d2b..4cadcefd5e 100644 --- a/core/src/main/java/org/jclouds/http/HttpRequest.java +++ b/core/src/main/java/org/jclouds/http/HttpRequest.java @@ -43,7 +43,7 @@ public class HttpRequest extends HttpMessage implements Request { private List requestFilters = Lists.newArrayList(); - private final HttpMethod method; + private final String method; private final URI endpoint; private Object entity; @@ -54,7 +54,7 @@ public class HttpRequest extends HttpMessage implements Request { * @param method * If the request is HEAD, this may change to GET due to redirects */ - public HttpRequest(HttpMethod method, URI endPoint) { + public HttpRequest(String method, URI endPoint) { this.method = checkNotNull(method, "method"); this.endpoint = checkNotNull(endPoint, "endPoint"); } @@ -66,7 +66,7 @@ public class HttpRequest extends HttpMessage implements Request { * @param method * If the request is HEAD, this may change to GET due to redirects */ - public HttpRequest(HttpMethod method, URI endPoint, Multimap headers) { + public HttpRequest(String method, URI endPoint, Multimap headers) { this(method, endPoint); setHeaders(checkNotNull(headers, "headers")); } @@ -78,7 +78,7 @@ public class HttpRequest extends HttpMessage implements Request { * @param method * If the request is HEAD, this may change to GET due to redirects */ - public HttpRequest(HttpMethod method, URI endPoint, Multimap headers, + public HttpRequest(String method, URI endPoint, Multimap headers, @Nullable Object entity) { this(method, endPoint); setHeaders(checkNotNull(headers, "headers")); @@ -101,7 +101,11 @@ public class HttpRequest extends HttpMessage implements Request { return sb.toString(); } - public HttpMethod getMethod() { + /** + * We cannot return an enum, as per specification custom methods are allowed. Enums are not extensible. + * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1 + */ + public String getMethod() { return method; } diff --git a/core/src/main/java/org/jclouds/http/TransformingHttpCommandImpl.java b/core/src/main/java/org/jclouds/http/TransformingHttpCommandImpl.java index 1bf4092916..1d776d8704 100644 --- a/core/src/main/java/org/jclouds/http/TransformingHttpCommandImpl.java +++ b/core/src/main/java/org/jclouds/http/TransformingHttpCommandImpl.java @@ -122,7 +122,7 @@ public class TransformingHttpCommandImpl implements TransformingHttpCommand httpMethods = IsHttpMethod.getHttpMethods(method); if (httpMethods == null || httpMethods.size() != 1) { throw new IllegalStateException( "You must use at least one, but no more than one http method or pathparam annotation on: " + method.toString()); } - return HttpMethod.valueOf(httpMethods.iterator().next()); + return httpMethods.iterator().next(); } public void addHostHeaderIfAnnotatedWithVirtualHost(Multimap headers, @@ -390,44 +389,42 @@ public class JaxrsAnnotationProcessor { public HttpRequest buildEntityIfPostOrPutRequest(Method method, Object[] args, HttpRequest request) { - switch (request.getMethod()) { - case POST: - case PUT: - MapEntityBinder mapBinder = getMapEntityBinderOrNull(method, args); - Map mapParams = buildPostParams(method, args); - // MapEntityBinder is only useful if there are parameters. We guard here in case the - // MapEntityBinder is also an EntityBinder. If so, it can be used with or without - // parameters. - if (mapBinder != null) { - mapBinder.addEntityToRequest(mapParams, request); - break; + OUTER: if (request.getMethod().toUpperCase().equals("POST") + || request.getMethod().toUpperCase().equals("PUT")) { + MapEntityBinder mapBinder = getMapEntityBinderOrNull(method, args); + Map mapParams = buildPostParams(method, args); + // MapEntityBinder is only useful if there are parameters. We guard here in case the + // MapEntityBinder is also an EntityBinder. If so, it can be used with or without + // parameters. + if (mapBinder != null) { + mapBinder.addEntityToRequest(mapParams, request); + break OUTER; + } + HttpRequestOptions options = findOptionsIn(method, args); + if (options != null) { + optionsBinder.addEntityToRequest(options, request); + } + if (request.getEntity() == null) { + + Map> indexToEntityAnnotation = getIndexToEntityAnnotation(method); + + if (indexToEntityAnnotation.size() == 1) { + Entry> entry = indexToEntityAnnotation.entrySet() + .iterator().next(); + EntityParam entityAnnotation = (EntityParam) entry.getValue().iterator().next(); + + Object entity = args[entry.getKey()]; + EntityBinder binder = injector.getInstance(entityAnnotation.value()); + + binder.addEntityToRequest(entity, request); + } else if (indexToEntityAnnotation.size() > 1) { + throw new IllegalStateException("cannot have multiple @Entity annotations on " + + method); + } else { + request.getHeaders().replaceValues(HttpHeaders.CONTENT_LENGTH, + Lists.newArrayList("0")); } - HttpRequestOptions options = findOptionsIn(method, args); - if (options != null) { - optionsBinder.addEntityToRequest(options, request); - } - if (request.getEntity() == null) { - - Map> indexToEntityAnnotation = getIndexToEntityAnnotation(method); - - if (indexToEntityAnnotation.size() == 1) { - Entry> entry = indexToEntityAnnotation.entrySet() - .iterator().next(); - EntityParam entityAnnotation = (EntityParam) entry.getValue().iterator().next(); - - Object entity = args[entry.getKey()]; - EntityBinder binder = injector.getInstance(entityAnnotation.value()); - - binder.addEntityToRequest(entity, request); - } else if (indexToEntityAnnotation.size() > 1) { - throw new IllegalStateException("cannot have multiple @Entity annotations on " - + method); - } else { - request.getHeaders().replaceValues(HttpHeaders.CONTENT_LENGTH, - Lists.newArrayList("0")); - } - } - break; + } } return request; } 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 147dc47572..137138fe50 100644 --- a/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java +++ b/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java @@ -34,7 +34,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.jclouds.http.HttpCommand; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; import org.jclouds.http.TransformingHttpCommandExecutorServiceImpl; @@ -137,7 +136,7 @@ public class BackoffLimitedRetryHandlerTest { assertEquals(response.getContent().read(), -1); } - private final HttpRequest request = new HttpRequest(HttpMethod.HEAD, END_POINT); + private final HttpRequest request = new HttpRequest("HEAD", END_POINT); private HttpCommand createCommand() { HttpCommand command = new TransformingHttpCommandImpl(executorService, request, diff --git a/core/src/test/java/org/jclouds/rest/JaxrsAnnotationProcessorTest.java b/core/src/test/java/org/jclouds/rest/JaxrsAnnotationProcessorTest.java index 742d1c502f..13fcca521f 100644 --- a/core/src/test/java/org/jclouds/rest/JaxrsAnnotationProcessorTest.java +++ b/core/src/test/java/org/jclouds/rest/JaxrsAnnotationProcessorTest.java @@ -27,6 +27,10 @@ import static com.google.common.base.Preconditions.checkNotNull; import static org.testng.Assert.assertEquals; import java.io.UnsupportedEncodingException; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import java.lang.reflect.Method; import java.net.URI; import java.net.URLEncoder; @@ -37,6 +41,7 @@ import java.util.concurrent.Future; import javax.ws.rs.GET; 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; @@ -45,7 +50,6 @@ import javax.ws.rs.PathParam; import org.jclouds.concurrent.WithinThreadExecutorService; import org.jclouds.concurrent.config.ExecutorServiceModule; import org.jclouds.http.HttpException; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequestFilter; import org.jclouds.http.HttpResponse; @@ -80,6 +84,28 @@ import com.google.inject.name.Names; @Test(groups = "unit", testName = "jaxrs.JaxrsUtilTest") public class JaxrsAnnotationProcessorTest { + @Target( { ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @javax.ws.rs.HttpMethod("FOO") + public @interface FOO { + } + + public class TestCustomMethod { + @FOO + public void foo() { + } + } + + public void testCustomMethod() throws SecurityException, NoSuchMethodException { + Method method = TestCustomMethod.class.getMethod("foo"); + URI endpoint = URI.create("http://localhost"); + HttpRequest httpMethod = factory.create(TestCustomMethod.class).createRequest(endpoint, + method, new Object[] {}); + assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); + assertEquals(httpMethod.getEndpoint().getPath(), ""); + assertEquals(httpMethod.getMethod(), "FOO"); + } + public class TestPost { @POST public void post(@EntityParam String content) { diff --git a/extensions/gae/src/test/java/org/jclouds/gae/GaeHttpCommandExecutorServiceTest.java b/extensions/gae/src/test/java/org/jclouds/gae/GaeHttpCommandExecutorServiceTest.java index f4e5864bc6..08a61b8b29 100644 --- a/extensions/gae/src/test/java/org/jclouds/gae/GaeHttpCommandExecutorServiceTest.java +++ b/extensions/gae/src/test/java/org/jclouds/gae/GaeHttpCommandExecutorServiceTest.java @@ -40,10 +40,10 @@ import java.util.Date; import java.util.List; import java.util.concurrent.ExecutorService; +import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; import org.apache.commons.io.IOUtils; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; import org.jclouds.http.handlers.DelegatingErrorHandler; diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/RateLimit.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/RateLimit.java index 58c725399f..9053edc3d0 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/RateLimit.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/RateLimit.java @@ -23,7 +23,7 @@ */ package org.jclouds.rackspace.cloudservers.domain; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; /** * diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionTest.java index 812127a9d6..3752ea4beb 100755 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionTest.java @@ -27,9 +27,9 @@ import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Bui import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.withMetadata; import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.withSharedIpGroup; import static org.jclouds.rackspace.cloudservers.options.CreateSharedIpGroupOptions.Builder.withServer; -import static org.jclouds.rackspace.cloudservers.options.RebuildServerOptions.Builder.withImage; import static org.jclouds.rackspace.cloudservers.options.ListOptions.Builder.changesSince; import static org.jclouds.rackspace.cloudservers.options.ListOptions.Builder.withDetails; +import static org.jclouds.rackspace.cloudservers.options.RebuildServerOptions.Builder.withImage; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; @@ -39,12 +39,12 @@ import java.net.URI; import java.net.UnknownHostException; import java.util.Collections; +import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import org.jclouds.concurrent.WithinThreadExecutorService; import org.jclouds.concurrent.config.ExecutorServiceModule; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.http.functions.ReturnFalseOn404; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeAdminPassBinderTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeAdminPassBinderTest.java index dfdf746ab3..78421ac49f 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeAdminPassBinderTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeAdminPassBinderTest.java @@ -28,10 +28,10 @@ import static org.testng.Assert.assertEquals; import java.io.File; import java.net.URI; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; -import org.jclouds.rackspace.cloudservers.binders.ChangeAdminPassBinder; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeServerNameBinderTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeServerNameBinderTest.java index a4607dfb21..ddf8343b5d 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeServerNameBinderTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/ChangeServerNameBinderTest.java @@ -28,10 +28,10 @@ import static org.testng.Assert.assertEquals; import java.io.File; import java.net.URI; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; -import org.jclouds.rackspace.cloudservers.binders.ChangeServerNameBinder; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/CreateImageBinderTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/CreateImageBinderTest.java index a8694bf71e..7d122259f1 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/CreateImageBinderTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/CreateImageBinderTest.java @@ -28,10 +28,10 @@ import static org.testng.Assert.assertEquals; import java.io.File; import java.net.URI; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; -import org.jclouds.rackspace.cloudservers.binders.CreateImageBinder; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/RebootTypeBinderTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/RebootTypeBinderTest.java index c94f7df93d..7595a1888c 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/RebootTypeBinderTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/binders/RebootTypeBinderTest.java @@ -28,10 +28,10 @@ import static org.testng.Assert.assertEquals; import java.io.File; import java.net.URI; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; -import org.jclouds.rackspace.cloudservers.binders.RebootTypeBinder; import org.jclouds.rackspace.cloudservers.domain.RebootType; import org.testng.annotations.Test; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateServerOptionsTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateServerOptionsTest.java index 3aa4df33ca..75ea467276 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateServerOptionsTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateServerOptionsTest.java @@ -23,13 +23,17 @@ */ package org.jclouds.rackspace.cloudservers.options; +import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.withFile; +import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.withSharedIp; +import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.withSharedIpGroup; import static org.testng.Assert.assertEquals; import java.net.InetAddress; import java.net.URI; import java.net.UnknownHostException; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; import org.testng.annotations.Test; @@ -37,7 +41,6 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; import com.google.inject.Guice; import com.google.inject.Injector; -import static org.jclouds.rackspace.cloudservers.options.CreateServerOptions.Builder.*; /** * Tests behavior of {@code ParseFlavorFromGsonResponse} diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateSharedIpGroupOptionsTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateSharedIpGroupOptionsTest.java index b67b8d1c7a..a4652b8116 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateSharedIpGroupOptionsTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/CreateSharedIpGroupOptionsTest.java @@ -28,7 +28,8 @@ import static org.testng.Assert.assertEquals; import java.net.URI; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; import org.testng.annotations.Test; diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/RebuildServerOptionsTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/RebuildServerOptionsTest.java index 0dd417eebd..a97a5b5a4d 100644 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/RebuildServerOptionsTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/options/RebuildServerOptionsTest.java @@ -29,7 +29,8 @@ import static org.testng.Assert.assertEquals; import java.net.URI; import java.util.HashMap; -import org.jclouds.http.HttpMethod; +import javax.ws.rs.HttpMethod; + import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.config.ParserModule; import org.testng.annotations.Test; diff --git a/rackspace/core/src/test/java/org/jclouds/rackspace/RackspaceAuthenticationTest.java b/rackspace/core/src/test/java/org/jclouds/rackspace/RackspaceAuthenticationTest.java index 7752dc75e5..3fa67b339d 100644 --- a/rackspace/core/src/test/java/org/jclouds/rackspace/RackspaceAuthenticationTest.java +++ b/rackspace/core/src/test/java/org/jclouds/rackspace/RackspaceAuthenticationTest.java @@ -29,9 +29,10 @@ import java.lang.reflect.Method; import java.net.URI; import java.util.Collections; +import javax.ws.rs.HttpMethod; + import org.jclouds.concurrent.WithinThreadExecutorService; import org.jclouds.concurrent.config.ExecutorServiceModule; -import org.jclouds.http.HttpMethod; import org.jclouds.http.HttpRequest; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.rackspace.functions.ParseAuthenticationResponseFromHeaders;