pvillard31 commented on code in PR #11361:
URL: https://github.com/apache/nifi/pull/11361#discussion_r3448205161
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestAttributesToCSV.java:
##########
@@ -757,7 +757,7 @@ public void testSchemaWithCoreAttribuesToContent() {
final byte[] contentData = testRunner.getContentAsByteArray(flowFile);
final String contentDataString = new String(contentData,
StandardCharsets.UTF_8);
- assertEquals(contentDataString.split(newline)[0],
"beach-name,beach-location,path,filename,uuid");
+ assertEquals("beach-name,beach-location,path,filename,uuid",
contentDataString.split(newline)[0]);
assertEquals(contentDataString.split(newline)[1], "Malibu
Beach,\"California, US\"," + path + "," + filename + "," + uuid);
Review Comment:
Should this assertion for split(newline)[1] also be reordered to expected
first, since the line above it was changed but this one was left as is?
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFlattenJson.java:
##########
@@ -65,7 +65,7 @@ void testFlatten() throws JsonProcessingException {
}
}""";
final Map parsed = (Map) baseTest(testRunner, json, 2);
- assertEquals(parsed.get("test.msg"), "Hello, world", "test.msg should
exist, but doesn't");
+ assertEquals("Hello, world", parsed.get("test.msg"), "test.msg should
exist, but doesn't");
assertEquals(parsed.get("first.second.third"),
Review Comment:
Should the assertion for parsed.get("first.second.third") just below also be
reordered to expected first, so the whole method is consistent?
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFlattenJson.java:
##########
@@ -65,7 +65,7 @@ void testFlatten() throws JsonProcessingException {
}
}""";
final Map parsed = (Map) baseTest(testRunner, json, 2);
- assertEquals(parsed.get("test.msg"), "Hello, world", "test.msg should
exist, but doesn't");
+ assertEquals("Hello, world", parsed.get("test.msg"), "test.msg should
exist, but doesn't");
Review Comment:
Was this conversion done with a tool or by hand, and is there a quick way to
confirm that no other misordered assertEquals calls remain in the files this PR
touches?
##########
nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/test/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryIT.java:
##########
@@ -532,7 +532,7 @@ private void assertStreamingData(String tableName, boolean
assertDate, boolean a
john = firstElt.get("name").getStringValue().equals("John Doe") ?
firstElt : sndElt;
jane = firstElt.get("name").getStringValue().equals("Jane Doe") ?
firstElt : sndElt;
- assertEquals(jane.get("job").getRecordValue().get(0).getStringValue(),
"Director");
+ assertEquals("Director",
jane.get("job").getRecordValue().getFirst().getStringValue());
Review Comment:
Is the change from get(0) to getFirst() in scope for an assertion ordering
PR, or would it be cleaner to keep this PR limited to argument order?
--
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]