You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/09/23 10:28:59 UTC

[GitHub] [nifi] turcsanyip commented on a change in pull request #5404: NIFI-9234 - Upgrade Atlas dependency to 2.2.0

turcsanyip commented on a change in pull request #5404:
URL: https://github.com/apache/nifi/pull/5404#discussion_r714660508



##########
File path: nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/test/java/org/apache/nifi/atlas/provenance/analyzer/TestAwsS3DirectoryV2.java
##########
@@ -76,17 +76,19 @@ protected void assertAnalysisResult(DataSetRefs refs, String dirPath) {
         Referenceable ref = refs.getOutputs().iterator().next();
 
         String actualPath = dirPath;
+        String parentPath = StringUtils.substringBeforeLast(actualPath, "/");
         while (StringUtils.isNotEmpty(actualPath) && !"/".equals(actualPath)) {
             String directory = StringUtils.substringAfterLast(actualPath, "/");
 
             assertEquals(AwsS3Directory.TYPE_DIRECTORY_V2, ref.getTypeName());
             assertEquals(String.format("s3a://%s%s/@%s", AWS_BUCKET, actualPath, ATLAS_NAMESPACE), ref.get(ATTR_QUALIFIED_NAME));
             assertEquals(directory, ref.get(ATTR_NAME));
-            assertEquals(actualPath + "/", ref.get(ATTR_OBJECT_PREFIX_V2));
+            assertEquals(parentPath + "/", ref.get(ATTR_OBJECT_PREFIX_V2));

Review comment:
       Minor simplification: `parentPath` could be calculated inline from `actualPath`:
   ```suggestion
               assertEquals(StringUtils.substringBeforeLast(actualPath, "/") + "/", ref.get(ATTR_OBJECT_PREFIX_V2));
   ```




-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org