nacx commented on a change in pull request #88:
URL: https://github.com/apache/jclouds/pull/88#discussion_r522435377



##########
File path: 
providers/azureblob/src/test/java/org/jclouds/azure/storage/util/StorageUrlDelegateTest.java
##########
@@ -0,0 +1,83 @@
+/*
+ * 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.azure.storage.util;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.Properties;
+
+import org.jclouds.ContextBuilder;
+import org.jclouds.azure.storage.reference.AzureConstants;
+import org.jclouds.logging.config.NullLoggingModule;
+import org.jclouds.rest.internal.BaseRestApiTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+
+@Test(groups = "unit")
+public class StorageUrlDelegateTest {
+
+   private static final String ACCOUNT = "foo";
+   private static final ImmutableSet<Module> MODULES = ImmutableSet.<Module> 
of(new BaseRestApiTest.MockModule(),
+         new NullLoggingModule());
+
+   @Test
+   void testDefaultEndpoint() {
+
+      StorageUrlDelegate target = ContextBuilder
+            .newBuilder("azureblob")
+            .credentials(ACCOUNT, "?token")
+            .modules(MODULES)
+            .buildInjector().getInstance(StorageUrlDelegate.class);
+
+      assertEquals(target.configureStorageUrl(), 
"https://foo.blob.core.windows.net/";);
+   }
+
+   @Test
+   void testCustomEndpointWithoutStorageAccountPath() {
+
+      StorageUrlDelegate target = ContextBuilder
+            .newBuilder("azureblob").endpoint("http://localhost:10000";)
+            .credentials(ACCOUNT, "?token")
+            .modules(MODULES)
+            .buildInjector()
+            .getInstance(StorageUrlDelegate.class);
+
+      assertEquals(target.configureStorageUrl(), "http://localhost:10000/";);

Review comment:
       That makes sense, thanks for the link!
   
   One last thing, then, if there is no custom endpoint configured and the 
property is set to `false`, the account will be included in the hostname, but 
appended to the path as well, which I guess is not correct?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to