myskov commented on code in PR #6364:
URL: https://github.com/apache/ozone/pull/6364#discussion_r1519722034


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/graph/TestPrintableGraph.java:
##########
@@ -0,0 +1,75 @@
+package org.apache.ozone.graph;
+
+import com.google.common.graph.MutableGraph;
+import org.apache.ozone.rocksdiff.CompactionNode;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.when;
+
+/**
+ * This class is used for testing the PrintableGraph class.
+ * It contains methods to test the generation and printing of graphs with 
different types.
+ */
+@ExtendWith(MockitoExtension.class)
+public class TestPrintableGraph {
+  @TempDir
+  private Path dir;
+
+  @Mock
+  private MutableGraph<CompactionNode> mutableGraph;
+
+  private static Stream<Arguments> graphTypes() {
+    return Stream.of(
+      Arguments.of(PrintableGraph.GraphType.KEY_SIZE),
+      Arguments.of(PrintableGraph.GraphType.CUMULATIVE_SIZE),
+      Arguments.of(PrintableGraph.GraphType.FILE_NAME)
+    );
+  }
+
+  @ParameterizedTest
+  @MethodSource("graphTypes")

Review Comment:
   I suggest using EnumSource, it will allow:
    * get rid of graphTypes() method
    * No need in modifying this test if a new value is added to the enum



-- 
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