MikeThomsen commented on a change in pull request #3646: NIFI-6546 - Add
JsonPath set value support
URL: https://github.com/apache/nifi/pull/3646#discussion_r317559806
##########
File path:
nifi-commons/nifi-expression-language/src/test/java/org/apache/nifi/attribute/expression/language/TestQuery.java
##########
@@ -384,12 +385,121 @@ public void testJsonPathDeleteHomePhoneNumber() throws
IOException {
verifyEquals("${json:jsonPath('$.firstName')}", attributes, "John");
verifyEquals("${json:jsonPath('$.lastName')}", attributes, "Smith");
verifyEquals("${json:jsonPath('$.age')}", attributes, "25");
+ verifyEquals("${json:jsonPath('$.voter')}", attributes, "true");
verifyEquals("${json:jsonPath('$.address.postalCode')}", attributes,
"10021-3100");
verifyEquals("${json:jsonPath(\"$.phoneNumbers[?(@.type=='home')].number\")}",
attributes, "[]");
verifyEquals("${json:jsonPath('$.phoneNumbers')}", attributes,
"{\"type\":\"office\",\"number\":\"646 555-4567\"}");
}
+ @Test
+ public void testJsonPathSetFirstNameAttribute() throws IOException {
+ final Map<String, String> attributes = new HashMap<>();
Review comment:
Lines 416-420 appear to be a common pattern as well throughout your test.
Let's see if we can wrap that up into a common method that can be reused in
these tests.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services