[ 
https://issues.apache.org/jira/browse/NIFI-13850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Stieglitz updated NIFI-13850:
------------------------------------
    Status: Patch Available  (was: In Progress)

> Simplify TestXMLReader 2.x with Java 21 constructs, JUnit constructs and NIFI 
> MockFlowFile methods.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-13850
>                 URL: https://issues.apache.org/jira/browse/NIFI-13850
>             Project: Apache NiFi
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Daniel Stieglitz
>            Assignee: Daniel Stieglitz
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Some examples
> * Use Files.readString(somePath) instead of new 
> String(Files.readAllBytes(somePath))
> * Use flowFile.getFirst() instead of flowFile.get(0)
> * Use Path for runner.enqueue instead of Inputstream.
> * Use flowFile.getFirst().getContent().split("\n")  instead of new 
> String(runner.getContentAsByteArray(flowFile.get(0)))).split("\n")
> * Remove public from class and test methods.
> * Define paths once for those files read in more than one test.
> * Read the text of the test schema once and reuse instead of reading it for 
> each tests its used in.
> * Use JUnit BeforeEach annotation instead of plain setup method



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to