mosermw commented on code in PR #9781:
URL: https://github.com/apache/nifi/pull/9781#discussion_r2059261481


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertRecord.java:
##########
@@ -434,7 +435,10 @@ public void testJSONDroppingUnknownFields() throws 
InitializationException, IOEx
         runner.assertAllFlowFilesTransferred(ConvertRecord.REL_SUCCESS, 1);
 
         final MockFlowFile flowFile = 
runner.getFlowFilesForRelationship(ConvertRecord.REL_SUCCESS).getFirst();
-        
assertFalse(flowFile.getContent().contains("fieldThatShouldBeRemoved"));
+        final List<String> undefinedTopLevelKeys = List.of("undefinedKey", 
"undefinedObjectArray", "undefinedObject", "undefinedScalarArray");
+
+        undefinedTopLevelKeys.forEach(undefinedTopLevelKey -> 
assertFalse(flowFile.getContent().contains(undefinedTopLevelKey)));

Review Comment:
   Could this be simplified to a single assert that the string "undefined" is 
not in the result?  Perhaps you could add a comment stating this covers all of 
the cases "undefinedKey", "undefinedObjectArray", "undefinedObject", 
"undefinedScalarArray", "undefinedKeyInObject"



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