kevinrr888 commented on code in PR #5547:
URL: https://github.com/apache/accumulo/pull/5547#discussion_r2116477430


##########
minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java:
##########
@@ -32,36 +33,36 @@
 import org.apache.accumulo.core.clientImpl.Namespace;
 import org.apache.accumulo.core.clientImpl.NamespaceMapping;
 import org.apache.accumulo.core.fate.zookeeper.ZooUtil;
-import org.apache.commons.io.FileUtils;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;
 import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.TestingServer;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not 
set by user input")
 public class MiniAccumuloClusterExistingZooKeepersTest extends WithTestNames {
-  private static final File BASE_DIR =
-      
Path.of(System.getProperty("user.dir")).resolve("target").resolve("mini-tests")
-          
.resolve(MiniAccumuloClusterExistingZooKeepersTest.class.getName()).toFile();
+
+  @TempDir
+  private static Path tempDir;
 
   private static final String SECRET = "superSecret";
 
   private MiniAccumuloConfig config;
 
   @BeforeEach
-  public void setupTestCluster() {
-    assertTrue(BASE_DIR.mkdirs() || BASE_DIR.isDirectory());
-    File testDir = BASE_DIR.toPath().resolve(testName()).toFile();
-    FileUtils.deleteQuietly(testDir);
-    assertTrue(testDir.mkdir());
+  public void setupTestCluster() throws IOException {
+    assertTrue(Files.isDirectory(tempDir));

Review Comment:
   I don't think the tempDir has been created yet so this won't pass. I'm not 
entirely sure how @ TempDir works though



##########
minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java:
##########
@@ -40,17 +40,18 @@ public class MiniAccumuloClusterStartStopTest extends 
WithTestNames {
 
   private static final Logger log = 
LoggerFactory.getLogger(MiniAccumuloClusterStartStopTest.class);
 
-  private File baseDir = 
Path.of(System.getProperty("user.dir")).resolve("target")
-      .resolve("mini-tests").resolve(this.getClass().getName()).toFile();
+  @TempDir
+  private static Path tempDir;
+
   private MiniAccumuloCluster accumulo;
 
   @BeforeEach
   public void setupTestCluster() throws IOException {
-    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
-    File testDir = baseDir.toPath().resolve(testName()).toFile();
-    FileUtils.deleteQuietly(testDir);
-    assertTrue(testDir.mkdir());
-    accumulo = new MiniAccumuloCluster(testDir, "superSecret");
+    assertTrue(Files.isDirectory(tempDir));

Review Comment:
   Here as well



-- 
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: notifications-unsubscr...@accumulo.apache.org

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

Reply via email to