DaveTeng0 commented on code in PR #4708:
URL: https://github.com/apache/ozone/pull/4708#discussion_r1200840515


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMFileCreateRequest.java:
##########
@@ -115,57 +118,69 @@ public void testPreExecuteWithBlankKey() throws Exception 
{
 
   @Test
   public void testValidateAndUpdateCache() throws Exception {
-    OMRequest omRequest = createFileRequest(volumeName, bucketName, keyName,
-        HddsProtos.ReplicationFactor.ONE, HddsProtos.ReplicationType.RATIS,
-        false, true);
 
-    OMRequestTestUtils.addVolumeAndBucketToDB(volumeName, bucketName,
-        omMetadataManager, getBucketLayout());
-    OMFileCreateRequest omFileCreateRequest = 
getOMFileCreateRequest(omRequest);
+    String[] validKeyNames = {
+        keyName,
+        OM_SNAPSHOT_INDICATOR + "abc/" + keyName,
+        "a/" + OM_SNAPSHOT_INDICATOR + "/b/c/" + keyName
+    };
 
-    OMRequest modifiedOmRequest = omFileCreateRequest.preExecute(ozoneManager);
+    for (String validKeyName : validKeyNames) {
+      keyName = validKeyName;

Review Comment:
   The only changes I added in this tests is just to create a String array of 
validKeyNames, then iterate them through as keyName in original test. (also add 
indent to original code block due to the new for-loop)



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