nit0906 commented on code in PR #1542:
URL: https://github.com/apache/jackrabbit-oak/pull/1542#discussion_r1650348034


##########
oak-run-commons/src/test/java/org/apache/jackrabbit/oak/fixture/DataStoreUtilsTest.java:
##########
@@ -0,0 +1,259 @@
+/*
+ * 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.apache.jackrabbit.oak.fixture;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.read.ListAppender;
+import com.microsoft.azure.storage.StorageException;
+import com.microsoft.azure.storage.blob.CloudBlobContainer;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPermissions;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPolicy;
+import org.apache.commons.lang3.StringUtils;
+import 
org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage.AzureBlobContainerProvider;
+import org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage.AzureConstants;
+import 
org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage.AzuriteDockerRule;
+import org.jetbrains.annotations.NotNull;
+import org.junit.After;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.slf4j.LoggerFactory;
+
+import java.net.URISyntaxException;
+import java.security.InvalidKeyException;
+import java.time.Instant;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class DataStoreUtilsTest {
+    @ClassRule
+    public static AzuriteDockerRule azuriteDockerRule = new 
AzuriteDockerRule();
+
+    private static final String AZURE_ACCOUNT_NAME = "AZURE_ACCOUNT_NAME";
+    private static final String AZURE_TENANT_ID = "AZURE_TENANT_ID";
+    private static final String AZURE_CLIENT_ID = "AZURE_CLIENT_ID";
+    private static final String AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET";
+    private static final String AZURE_CONNECTION_STRING = 
"DefaultEndpointsProtocol=http;AccountName=%s;AccountKey=%s;BlobEndpoint=%s";
+    private static final String CONTAINER_NAME = "oak-blob-test";
+    private static final String AUTHENTICATE_VIA_AZURE_CONNECTION_STRING_LOG = 
"connecting to azure blob storage via azureConnectionString";
+    private static final String AUTHENTICATE_VIA_ACCESS_KEY_LOG = "connecting 
to azure blob storage via access key";
+    private static final String AUTHENTICATE_VIA_SERVICE_PRINCIPALS_LOG = 
"connecting to azure blob storage via service principal credentials";
+    private static final String AUTHENTICATE_VIA_SAS_TOKEN_LOG = "connecting 
to azure blob storage via sas token";
+    private static final String REFRESH_TOKEN_EXECUTOR_SHUTDOWN_LOG = "Refresh 
token executor service shutdown completed";
+    private static final String CONTAINER_DOES_NOT_EXIST_MESSAGE = "container 
[%s] doesn't exists";
+    private static final String CONTAINER_DELETED_MESSAGE = "container [%s] 
deleted";
+
+    private CloudBlobContainer container;
+
+    @Before
+    public void init() throws URISyntaxException, InvalidKeyException, 
StorageException {
+        container = azuriteDockerRule.getContainer(CONTAINER_NAME);
+    }
+
+    @After
+    public void cleanup() throws StorageException {
+        if (container != null) {
+            container.deleteIfExists();
+        }
+    }
+
+    @Test
+    public void delete_non_existing_container_azure_connection_string() throws 
Exception {
+        container.deleteIfExists();

Review Comment:
   instead of deleting the container here - couldn't we simply use a random 
container name that we never created ? 



-- 
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.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to