Skip to content

Commit

Permalink
feat(bindings/java): use random root for behavior tests (#3408)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun authored Oct 28, 2023
1 parent de40a4d commit 3c4a187
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.apache.opendal.BlockingOperator;
import org.apache.opendal.Operator;
Expand Down Expand Up @@ -53,6 +54,13 @@ public void beforeAll(ExtensionContext context) {
config.put(key.substring(prefix.length()), entry.getValue());
}
}

// Use random root unless OPENDAL_DISABLE_RANDOM_ROOT is set to true.
if (!Boolean.parseBoolean(dotenv.get("OPENDAL_DISABLE_RANDOM_ROOT"))) {
final String root = config.getOrDefault("root", "/") + UUID.randomUUID() + "/";
config.put("root", root);
}

this.operator = Operator.of(scheme, config);
this.blockingOperator = BlockingOperator.of(scheme, config);

Expand Down

0 comments on commit 3c4a187

Please sign in to comment.