dan-s1 commented on code in PR #9785:
URL: https://github.com/apache/nifi/pull/9785#discussion_r1993517939


##########
nifi-extension-bundles/nifi-jolt-bundle/nifi-jolt-processors/src/test/java/org/apache/nifi/processors/jolt/TestJoltTransformJSON.java:
##########
@@ -464,6 +464,71 @@ void testJoltSpecInvalidEL() throws IOException {
         runner.assertNotValid();
     }
 
+    @Test
+    void testJsonAttributeNotInitialised() throws IOException {
+        runner.setProperty(JoltTransformJSON.JSON_SOURCE, 
SourceStrategy.ATTRIBUTE);
+        runner.setProperty(JoltTransformJSON.JOLT_SPEC, 
"./src/test/resources/specs/shiftrSpec.json");
+        runner.setProperty(JoltTransformJSON.JOLT_TRANSFORM, 
JoltTransformStrategy.SHIFTR);
+        runner.setProperty(JoltTransformJSON.JSON_SOURCE_ATTRIBUTE, 
"jsonAttr");

Review Comment:
   I see this value `"jsonAttr"` being used 8 times for defining the name of 
the attribute (this line and on lines 483, 484, 498, 510, 511,  523 and 525). 
Please make a `private static final String` variable and use it in each of 
those places.



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