chungen0126 commented on code in PR #3993:
URL: https://github.com/apache/ozone/pull/3993#discussion_r1038928951


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -688,21 +707,44 @@ public void testListSnapshot() throws Exception {
       }
     }
 
-    //Test listing snapshots with no volume name.
-    Assert.assertThrows(OMException.class, () -> 
omMetadataManager.listSnapshot(
-        null, null));
-
-    //Test listing snapshots with no bucket name.
-    Assert.assertThrows(OMException.class, () -> 
omMetadataManager.listSnapshot(
-        vol1, null));
-
     //Test listing all snapshots.
     List<SnapshotInfo> snapshotInfos = omMetadataManager.listSnapshot(vol1,
         bucket1);
-    Assert.assertEquals(10, snapshotInfos.size());
+    assertEquals(10, snapshotInfos.size());
     for (SnapshotInfo snapshotInfo : snapshotInfos) {
-      Assert.assertTrue(snapshotInfo.getName().startsWith(snapshotName));
+      assertTrue(snapshotInfo.getName().startsWith(snapshotName));
+    }
+
+  }
+
+  @ParameterizedTest
+  @NullSource
+  @ValueSource(strings = { "nonexistentBucket"})
+  public void testListSnapshotWithInvalidPath(String invalidBucket)
+      throws Exception {
+    String vol1 = "vol1";
+    String bucket1 = "bucket1";
+
+    OMRequestTestUtils.addVolumeToDB(vol1, omMetadataManager);
+    addBucketsToCache(vol1, bucket1);
+    String snapshotName = "snapshot";
+
+    for (int i = 1; i <= 10; i++) {

Review Comment:
   Done. 



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