diff --git a/README.txt b/README.txt
index c344a02d53..1bbe809949 100644
--- a/README.txt
+++ b/README.txt
@@ -42,7 +42,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers (generic), cloudservers-
to all of these providers
our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfiles-uk,
- azurestorage, atmos (generic), synaptic-storage,
+ azureblob, atmos (generic), synaptic-storage,
cloudonestorage, s3 (generic), walrus(generic), googlestorage,
scaleup-storage, ecc-s3, swift (generic), transient (in-mem),
filesystem (on-disk)
@@ -50,8 +50,8 @@ our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfi
* note * the pom dependency org.jclouds/jclouds-allblobstore gives you access to
to all of these providers
-we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, openstack nova,
- as well a number of features the sandbox
+we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, openstack nova,
+ azurequeue, simpledb as well a number of features the sandbox
If you want access to all jclouds components, include the maven dependency org.jclouds/jclouds-all
diff --git a/allblobstore/pom.xml b/allblobstore/pom.xml
index cd9507e51e..4a84625999 100644
--- a/allblobstore/pom.xml
+++ b/allblobstore/pom.xml
@@ -70,8 +70,8 @@
${project.version}
- ${project.groupId}
- jclouds-azure
+ org.jclouds.provider
+ azureblob
${project.version}
diff --git a/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java b/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java
deleted file mode 100644
index 0f10801f21..0000000000
--- a/azure/src/test/java/org/jclouds/azure/storage/ProvidersInPropertiesTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- *
- * Copyright (C) 2010 Cloud Conscious, LLC.
- *
- * ====================================================================
- * Licensed 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.azure.storage;
-
-import org.jclouds.blobstore.util.BlobStoreUtils;
-import org.jclouds.rest.Providers;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Iterables;
-
-/**
- *
- * @author Adrian Cole
- *
- */
-@Test(groups = "unit")
-public class ProvidersInPropertiesTest {
-
- @Test
- public void testSupportedProviders() {
- Iterable providers = Providers.getSupportedProviders();
- assert Iterables.contains(providers, "azurequeue") : providers;
- assert Iterables.contains(providers, "azureblob") : providers;
- }
-
- @Test
- public void testSupportedBlobStoreProviders() {
- Iterable providers = BlobStoreUtils.getSupportedProviders();
- assert !Iterables.contains(providers, "azurequeue") : providers;
- assert Iterables.contains(providers, "azureblob") : providers;
- }
-
-}
diff --git a/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java b/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java
deleted file mode 100644
index d43d46b333..0000000000
--- a/azure/src/test/java/org/jclouds/azure/storage/config/AzureStorageRestClientModuleTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- *
- * Copyright (C) 2010 Cloud Conscious, LLC.
- *
- * ====================================================================
- * Licensed 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.azure.storage.config;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-import java.io.IOException;
-
-import org.jclouds.azure.storage.blob.config.AzureBlobRestClientModule;
-import org.jclouds.azure.storage.handlers.AzureStorageClientErrorRetryHandler;
-import org.jclouds.azure.storage.handlers.ParseAzureStorageErrorFromXmlContent;
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.http.handlers.DelegatingErrorHandler;
-import org.jclouds.http.handlers.DelegatingRetryHandler;
-import org.jclouds.http.handlers.RedirectionRetryHandler;
-import org.jclouds.logging.log4j.config.Log4JLoggingModule;
-import org.jclouds.rest.RestContextFactory;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
-/**
- * @author Adrian Cole
- */
-@Test(groups = "unit")
-public class AzureStorageRestClientModuleTest {
-
- Injector createInjector() throws IOException {
- return new RestContextFactory().createContextBuilder("azurequeue", "foo", "bar",
- ImmutableSet. of(new Log4JLoggingModule())).buildInjector();
- }
-
- @SuppressWarnings("unchecked")
- @Test
- void testUpdatesOnlyOncePerSecond() throws NoSuchMethodException, InterruptedException {
- @SuppressWarnings("rawtypes")
- AzureStorageRestClientModule module = new AzureBlobRestClientModule();
-
- Supplier map = module.provideTimeStampCache(1, new SimpleDateFormatDateService());
- String timeStamp = map.get();
- for (int i = 0; i < 10; i++)
- map.get();
- assertEquals(timeStamp, map.get());
- Thread.sleep(1001);
- assertFalse(timeStamp.equals(map.get()));
- }
-
- @Test
- void testServerErrorHandler() throws IOException {
- DelegatingErrorHandler handler = createInjector().getInstance(DelegatingErrorHandler.class);
- assertEquals(handler.getServerErrorHandler().getClass(),
- ParseAzureStorageErrorFromXmlContent.class);
- }
-
- @Test
- void testClientErrorHandler() throws IOException {
- DelegatingErrorHandler handler = createInjector().getInstance(DelegatingErrorHandler.class);
- assertEquals(handler.getClientErrorHandler().getClass(),
- ParseAzureStorageErrorFromXmlContent.class);
- }
-
- @Test
- void testClientRetryHandler() throws IOException {
- DelegatingRetryHandler handler = createInjector().getInstance(DelegatingRetryHandler.class);
- assertEquals(handler.getClientErrorRetryHandler().getClass(),
- AzureStorageClientErrorRetryHandler.class);
- }
-
- @Test
- void testRedirectionRetryHandler() throws IOException {
- DelegatingRetryHandler handler = createInjector().getInstance(DelegatingRetryHandler.class);
- assertEquals(handler.getRedirectionRetryHandler().getClass(), RedirectionRetryHandler.class);
- }
-
-}
\ No newline at end of file
diff --git a/azure/README.txt b/common/azure/README.txt
similarity index 100%
rename from azure/README.txt
rename to common/azure/README.txt
diff --git a/common/azure/pom.xml b/common/azure/pom.xml
new file mode 100644
index 0000000000..5310bf0177
--- /dev/null
+++ b/common/azure/pom.xml
@@ -0,0 +1,50 @@
+
+
+
+
+ 4.0.0
+
+ org.jclouds
+ jclouds-project
+ 1.0-SNAPSHOT
+ ../../project/pom.xml
+
+ org.jclouds.common
+ azure-common
+ jclouds Azure Components Core
+ jclouds Core components to access Azure
+
+
+ org.jclouds
+ jclouds-core
+ ${project.version}
+
+
+ org.jclouds
+ jclouds-core
+ ${project.version}
+ test-jar
+ test
+
+
+
+
diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageContextBuilder.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java
similarity index 78%
rename from azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java
index 328d3b4290..0414c157fc 100644
--- a/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java
+++ b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStoragePropertiesBuilder.java
@@ -19,10 +19,8 @@
package org.jclouds.azure.storage;
-import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_IDENTITY;
-import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX;
import java.util.Properties;
import java.util.regex.Pattern;
@@ -31,18 +29,11 @@ import org.jclouds.PropertiesBuilder;
import org.jclouds.util.Strings2;
/**
- * Builds properties used in AzureBlob Connections
+ * Builds properties used in Azure Connections
*
* @author Adrian Cole
*/
public class AzureStoragePropertiesBuilder extends PropertiesBuilder {
- @Override
- protected Properties defaultProperties() {
- Properties properties = super.defaultProperties();
- properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "x-ms-meta-");
- properties.setProperty(PROPERTY_API_VERSION, "2009-09-19");
- return properties;
- }
public AzureStoragePropertiesBuilder() {
this(new Properties());
diff --git a/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java b/common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/AzureStorageResponseException.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java b/common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageParserModule.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java b/common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/config/AzureStorageRestClientModule.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/AzureStorageError.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/BoundedSet.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java b/common/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedHashSet.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java b/common/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/handlers/AzureStorageClientErrorRetryHandler.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java
similarity index 77%
rename from azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java
index 9a665ab9fd..bcdada6fd4 100644
--- a/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java
+++ b/common/azure/src/main/java/org/jclouds/azure/storage/handlers/ParseAzureStorageErrorFromXmlContent.java
@@ -22,7 +22,6 @@ package org.jclouds.azure.storage.handlers;
import static org.jclouds.http.HttpUtils.releasePayload;
import java.io.IOException;
-import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
@@ -31,14 +30,13 @@ import javax.inject.Inject;
import org.jclouds.azure.storage.AzureStorageResponseException;
import org.jclouds.azure.storage.domain.AzureStorageError;
import org.jclouds.azure.storage.util.AzureStorageUtils;
-import org.jclouds.blobstore.ContainerNotFoundException;
-import org.jclouds.blobstore.KeyNotFoundException;
import org.jclouds.http.HttpCommand;
import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.HttpResponseException;
import org.jclouds.logging.Logger;
import org.jclouds.rest.AuthorizationException;
+import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.util.Strings2;
/**
@@ -65,14 +63,14 @@ public class ParseAzureStorageErrorFromXmlContent implements HttpErrorHandler {
public void handleError(HttpCommand command, HttpResponse response) {
Exception exception = new HttpResponseException(command, response);
String message = null;
+ AzureStorageError error = null;
try {
if (response.getPayload() != null) {
String contentType = response.getPayload().getContentMetadata().getContentType();
if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1)
- && !new Long(0).equals(response.getPayload().getContentMetadata().getContentLength())) {
+ && !new Long(0).equals(response.getPayload().getContentMetadata().getContentLength())) {
try {
- AzureStorageError error = utils.parseAzureStorageErrorFromContent(command, response, response
- .getPayload().getInput());
+ error = utils.parseAzureStorageErrorFromContent(command, response, response.getPayload().getInput());
if (error != null) {
message = error.getMessage();
exception = new AzureStorageResponseException(command, response, error);
@@ -93,33 +91,30 @@ public class ParseAzureStorageErrorFromXmlContent implements HttpErrorHandler {
}
}
message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 401:
- exception = new AuthorizationException(exception.getMessage(), exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- String path = command.getCurrentRequest().getEndpoint().getPath();
- Matcher matcher = CONTAINER_PATH.matcher(path);
- if (matcher.find()) {
- exception = new ContainerNotFoundException(matcher.group(1), message);
- } else {
- matcher = CONTAINER_KEY_PATH.matcher(path);
- if (matcher.find()) {
- exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
- }
- }
- }
- break;
- case 411:
- exception = new IllegalArgumentException(message);
- break;
- }
+ response.getStatusLine());
+ exception = refineException(command, response, exception, error, message);
} finally {
releasePayload(response);
command.setException(exception);
}
}
+ protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception,
+ AzureStorageError error, String message) {
+ switch (response.getStatusCode()) {
+ case 401:
+ exception = new AuthorizationException(message, exception);
+ break;
+ case 404:
+ if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
+ exception = new ResourceNotFoundException(message, exception);
+ }
+ break;
+ case 411:
+ exception = new IllegalArgumentException(message);
+ break;
+ }
+ return exception;
+ }
+
}
\ No newline at end of file
diff --git a/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java b/common/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/options/CreateOptions.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java b/common/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/options/ListOptions.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java b/common/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/reference/AzureStorageHeaders.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java b/common/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/util/AzureStorageUtils.java
diff --git a/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java b/common/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java
similarity index 100%
rename from azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java
rename to common/azure/src/main/java/org/jclouds/azure/storage/xml/ErrorHandler.java
diff --git a/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java b/common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java
similarity index 72%
rename from azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java
rename to common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java
index d06379713e..617900f00d 100755
--- a/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java
+++ b/common/azure/src/test/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthenticationTest.java
@@ -23,19 +23,25 @@ import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.net.URI;
+import java.util.List;
+import java.util.Map;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.core.HttpHeaders;
-import org.jclouds.encryption.internal.Base64;
+import org.jclouds.PropertiesBuilder;
+import org.jclouds.azure.storage.config.AzureStorageRestClientModule;
import org.jclouds.http.HttpRequest;
-import org.jclouds.logging.log4j.config.Log4JLoggingModule;
+import org.jclouds.logging.config.NullLoggingModule;
+import org.jclouds.rest.RestContextBuilder;
import org.jclouds.rest.RestContextFactory;
+import org.jclouds.rest.RestContextSpec;
+import org.jclouds.rest.BaseRestClientTest.MockModule;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableList;
import com.google.inject.Injector;
import com.google.inject.Module;
@@ -46,7 +52,6 @@ import com.google.inject.Module;
@Test(groups = "unit")
public class SharedKeyLiteAuthenticationTest {
- private static final String KEY = Base64.encodeBytes("bar".getBytes());
private static final String ACCOUNT = "foo";
private Injector injector;
private SharedKeyLiteAuthentication filter;
@@ -54,12 +59,12 @@ public class SharedKeyLiteAuthenticationTest {
@DataProvider(parallel = true)
public Object[][] dataProvider() {
return new Object[][] {
- { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT
- + ".blob.core.windows.net/movies/MOV1.avi?comp=block&blockid=BlockId1&timeout=60")) },
- { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT
- + ".blob.core.windows.net/movies/MOV1.avi?comp=blocklist&timeout=120")) },
- { new HttpRequest(HttpMethod.GET,
- URI.create("http://" + ACCOUNT + ".blob.core.windows.net/movies/MOV1.avi")) } };
+ { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT
+ + ".blob.core.windows.net/movies/MOV1.avi?comp=block&blockid=BlockId1&timeout=60")) },
+ { new HttpRequest(HttpMethod.PUT, URI.create("http://" + ACCOUNT
+ + ".blob.core.windows.net/movies/MOV1.avi?comp=blocklist&timeout=120")) },
+ { new HttpRequest(HttpMethod.GET, URI.create("http://" + ACCOUNT
+ + ".blob.core.windows.net/movies/MOV1.avi")) } };
}
/**
@@ -80,7 +85,7 @@ public class SharedKeyLiteAuthenticationTest {
request = filter.filter(request);
}
System.out.printf("%s: %d iterations before the timestamp updated %n", Thread.currentThread().getName(),
- iterations);
+ iterations);
}
@Test
@@ -113,7 +118,7 @@ public class SharedKeyLiteAuthenticationTest {
@Test
void testAclQueryStringRelativeWithExtraJunk() {
URI host = URI.create("http://" + ACCOUNT
- + ".blob.core.windows.net/mycontainer?comp=list&marker=marker&maxresults=1&prefix=prefix");
+ + ".blob.core.windows.net/mycontainer?comp=list&marker=marker&maxresults=1&prefix=prefix");
HttpRequest request = new HttpRequest(HttpMethod.GET, host);
StringBuilder builder = new StringBuilder();
filter.appendUriPath(request, builder);
@@ -128,9 +133,14 @@ public class SharedKeyLiteAuthenticationTest {
*/
@BeforeClass
protected void createFilter() throws IOException {
- injector = new RestContextFactory().createContextBuilder("azurequeue", ACCOUNT, KEY,
- ImmutableSet. of(new Log4JLoggingModule())).buildInjector();
+ injector = RestContextFactory.createContextBuilder(DUMMY_SPEC).buildInjector();
filter = injector.getInstance(SharedKeyLiteAuthentication.class);
}
+ @SuppressWarnings("unchecked")
+ public static final RestContextSpec