meethngala commented on code in PR #3616:
URL: https://github.com/apache/gobblin/pull/3616#discussion_r1099620238


##########
gobblin-data-management/src/test/java/org/apache/gobblin/data/management/copy/writer/FileAwareInputStreamDataWriterTest.java:
##########
@@ -423,29 +413,25 @@ public void testCommit() throws IOException {
     // previously existing paths should not have permissions changed
     fileStatus = this.fs.getFileStatus(existingOutputPath);
     Assert.assertEquals(fileStatus.getPermission(), existingPathPermission);
-    verifyAclEntries(writer, pathToAclEntries, expectedOutputPath);
+    verifyAclEntries(writer, this.fs.getPathToAclEntries(), 
expectedOutputPath);
     Assert.assertFalse(this.fs.exists(writer.stagingDir));
 
   }
 
   private void verifyAclEntries(FileAwareInputStreamDataWriter writer, 
ConcurrentHashMap pathToAclEntries, Path expectedOutputPath) {
     // fetching and preparing file paths from FileAwareInputStreamDataWriter 
object
-    Path stagingDir = writer.stagingDir;
     Path outputDir = writer.outputDir;
     String[] splitExpectedOutputPath = 
expectedOutputPath.toString().split("output");
     Path dstOutputPath = new 
Path(outputDir.toString().concat(splitExpectedOutputPath[1])).getParent();
-    Path stgFilePath = new 
Path("file:".concat(stagingDir.toString().concat("/file")));
-
     Assert.assertTrue(pathToAclEntries.containsKey(dstOutputPath));
-    Assert.assertTrue(pathToAclEntries.containsKey(stgFilePath));
 
     OwnerAndPermission destinationOwnerAndPermission = 
writer.actualProcessedCopyableFile.get().getDestinationOwnerAndPermission();
     List<AclEntry> actual = destinationOwnerAndPermission.getAclEntries();
-    List<AclEntry> expectedStgAclEntries = (List<AclEntry>) 
pathToAclEntries.get(stgFilePath);
-    List<AclEntry> expectedDstAclEntries = (List<AclEntry>) 
pathToAclEntries.get(dstOutputPath);
-
-    Assert.assertEquals(actual, expectedStgAclEntries);
-    Assert.assertEquals(actual, expectedDstAclEntries);
+    do {
+      List<AclEntry> expected = (List<AclEntry>) 
pathToAclEntries.get(dstOutputPath);
+      Assert.assertEquals(actual, expected);
+      dstOutputPath = dstOutputPath.getParent();
+    } while (pathToAclEntries.containsKey(dstOutputPath));

Review Comment:
   makes sense! my latest commit handles this issue... thanks for the feedback!



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

Reply via email to