Github user e-kolpakov commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2481#discussion_r169291484
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateCsv.java
 ---
    @@ -333,4 +333,23 @@ public void testMultipleRuns() {
             runner.assertTransferCount(ValidateCsv.REL_VALID, 2);
             runner.assertTransferCount(ValidateCsv.REL_INVALID, 0);
         }
    +
    +    @Test
    +    public void testEscapingLineByLine() {
    +        final TestRunner runner = TestRunners.newTestRunner(new 
ValidateCsv());
    +        runner.setProperty(ValidateCsv.DELIMITER_CHARACTER, ",");
    +        runner.setProperty(ValidateCsv.END_OF_LINE_CHARACTER, "\r\n");
    +        runner.setProperty(ValidateCsv.QUOTE_CHARACTER, "\"");
    +        runner.setProperty(ValidateCsv.HEADER, "false");
    +        runner.setProperty(ValidateCsv.VALIDATION_STRATEGY, 
ValidateCsv.VALIDATE_LINES_INDIVIDUALLY);
    +
    +        runner.setProperty(ValidateCsv.SCHEMA, 
"ParseInt(),ParseInt(),ParseInt()");
    +
    +        runner.enqueue("Field1,\"Field2,excaped\",Field3");
    --- End diff --
    
    @pvillard31 Suggestion: extract into `final String` and use in an 
assertion? I.e.
    
    ```
    final String payload = "Field1,\"Field2,escaped\",Field3"
    runner.enqueue(payload)
    ...
    
runner.getFlowFilesForRelationship(ValidateCsv.REL_INVALID).get(0).assertContentEquals(payload)
    ```
    
    Also, `excaped` is definitely a typo in my template, no need to repeat it 
here.


---

Reply via email to