adoroszlai commented on code in PR #5669:
URL: https://github.com/apache/ozone/pull/5669#discussion_r1405991667


##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconUtils.java:
##########
@@ -44,46 +47,37 @@
 import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdfs.web.URLConnectionFactory;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 /**
  * Test Recon Utility methods.
  */
 public class TestReconUtils {
 
-  @Rule
-  public TemporaryFolder folder = new TemporaryFolder();
+  @TempDir
+  private static Path temporaryFolder;

Review Comment:
   Nit: Can this be non-`static`?



##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconUtils.java:
##########
@@ -44,46 +47,37 @@
 import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdfs.web.URLConnectionFactory;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 /**
  * Test Recon Utility methods.
  */
 public class TestReconUtils {
 
-  @Rule
-  public TemporaryFolder folder = new TemporaryFolder();
+  @TempDir
+  private static Path temporaryFolder;
 
   @Test
-  public void testGetReconDbDir() throws Exception {
+  public void testGetReconDbDir(@TempDir File newDir) throws Exception {

Review Comment:
   Can use member `temporaryFolder` instead of param in this method?



##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/spi/impl/TestOzoneManagerServiceProviderImpl.java:
##########
@@ -89,33 +88,33 @@
  */
 public class TestOzoneManagerServiceProviderImpl {
 
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
   private OzoneConfiguration configuration;
   private OzoneManagerProtocol ozoneManagerProtocol;
   private CommonUtils commonUtils;
 
-  @Before
-  public void setUp() throws Exception {
+  @BeforeEach
+  public void setUp(@TempDir File dirReconSnapDB, @TempDir File dirReconDB)
+      throws Exception {
     configuration = new OzoneConfiguration();
     configuration.set(OZONE_RECON_OM_SNAPSHOT_DB_DIR,
-        temporaryFolder.newFolder().getAbsolutePath());
+        dirReconSnapDB.getAbsolutePath());
     configuration.set(OZONE_RECON_DB_DIR,
-        temporaryFolder.newFolder().getAbsolutePath());
+        dirReconSnapDB.getAbsolutePath());

Review Comment:
   ```suggestion
           dirReconDB.getAbsolutePath());
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to