Skip to content

Commit

Permalink
Workaround #2207 in Azure Storage Data Lake test
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Mar 18, 2021
1 parent f2f8079 commit 6b2abee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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;

Expand All @@ -32,18 +33,18 @@
@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 */
Expand All @@ -53,12 +54,10 @@ public void crud() {
.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")
Expand Down Expand Up @@ -99,10 +98,14 @@ public void crud() {
} 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)
Expand Down

0 comments on commit 6b2abee

Please sign in to comment.