This is an automated email from the ASF dual-hosted git repository.

ppalaga pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 6b2abeef72b587437744d0b7ee08aeb63b603389
Author: Peter Palaga <ppal...@redhat.com>
AuthorDate: Fri Mar 5 19:26:13 2021 +0100

    Workaround #2207 in Azure Storage Data Lake test
---
 .../integration-test/pom.xml                       |  7 +++++
 .../datalake/it/AzureStorageDatalakeTest.java      | 35 ++++++++++++----------
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/extensions-jvm/azure-storage-datalake/integration-test/pom.xml 
b/extensions-jvm/azure-storage-datalake/integration-test/pom.xml
index 88d39bb..e0eb088 100644
--- a/extensions-jvm/azure-storage-datalake/integration-test/pom.xml
+++ b/extensions-jvm/azure-storage-datalake/integration-test/pom.xml
@@ -34,6 +34,13 @@
 
     <dependencyManagement>
         <dependencies>
+            <dependency><!-- Workaround for 
https://github.com/apache/camel-quarkus/issues/2207 -->
+                <groupId>com.fasterxml.jackson</groupId>
+                <artifactId>jackson-bom</artifactId>
+                <version>2.11.3</version>
+                <scope>import</scope>
+                <type>pom</type>
+            </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-bom-test</artifactId>
diff --git 
a/extensions-jvm/azure-storage-datalake/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/datalake/it/AzureStorageDatalakeTest.java
 
b/extensions-jvm/azure-storage-datalake/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/datalake/it/AzureStorageDatalakeTest.java
index 2f7f4d3..f35fbe1 100644
--- 
a/extensions-jvm/azure-storage-datalake/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/datalake/it/AzureStorageDatalakeTest.java
+++ 
b/extensions-jvm/azure-storage-datalake/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/datalake/it/AzureStorageDatalakeTest.java
@@ -22,6 +22,7 @@ import io.restassured.RestAssured;
 import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.hamcrest.Matchers;
+import org.jboss.logging.Logger;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
 
@@ -32,18 +33,18 @@ import 
org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
 @QuarkusTestResource(AzureStorageTestResource.class)
 class AzureStorageDatalakeTest {
 
+    private static final Logger LOG = 
Logger.getLogger(AzureStorageDatalakeTest.class);
+
     @Test
     public void crud() {
         final String filesystem = "cqfs" + RandomStringUtils.randomNumeric(16);
         final String filename = "file" + RandomStringUtils.randomNumeric(16);
 
         /* The filesystem does not exist initially */
-        // TODO this causes an infinite loop of requests see
-        // https://github.com/apache/camel-quarkus/issues/2304
-        // RestAssured.get("/azure-storage-datalake/filesystems")
-        // .then()
-        // .statusCode(200)
-        // .body(Matchers.not(Matchers.hasItem(filesystem)));
+        RestAssured.get("/azure-storage-datalake/filesystem/" + filesystem)
+                .then()
+                .statusCode(200)
+                .body("", Matchers.not(Matchers.hasItem(filesystem)));
 
         try {
             /* Create the filesystem */
@@ -53,12 +54,10 @@ class AzureStorageDatalakeTest {
                     .statusCode(201);
 
             /* Now it should exist */
-            // TODO this causes an infinite loop of requests see
-            // https://github.com/apache/camel-quarkus/issues/2304
-            //            
RestAssured.get("/azure-storage-datalake/filesystem/" + filesystem)
-            //                    .then()
-            //                    .statusCode(200)
-            //                    .body(Matchers.hasItem(filesystem));
+            RestAssured.get("/azure-storage-datalake/filesystem/" + filesystem)
+                    .then()
+                    .statusCode(200)
+                    .body("", Matchers.hasItem(filesystem));
 
             /* No paths yet */
             RestAssured.get("/azure-storage-datalake/filesystem/" + filesystem 
+ "/paths")
@@ -99,10 +98,14 @@ class AzureStorageDatalakeTest {
         } finally {
             /* Clean up */
 
-            RestAssured.given()
-                    .delete("/azure-storage-datalake/filesystem/" + filesystem 
+ "/path/" + filename)
-                    .then()
-                    .statusCode(204);
+            try {
+                RestAssured.given()
+                        .delete("/azure-storage-datalake/filesystem/" + 
filesystem + "/path/" + filename)
+                        .then()
+                        .statusCode(204);
+            } catch (Exception e) {
+                LOG.warnf(e, "Could not delete file '%s' in file system %s", 
filename, filesystem);
+            }
 
             RestAssured.given()
                     .delete("/azure-storage-datalake/filesystem/" + filesystem)

Reply via email to