Github user jtstorck commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/778#discussion_r73533219
  
    --- Diff: 
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/PutHDFSTest.java
 ---
    @@ -199,7 +202,39 @@ public void testPutFile() throws IOException {
             TestRunner runner = TestRunners.newTestRunner(proc);
             runner.setProperty(PutHDFS.DIRECTORY, "target/test-classes");
             runner.setProperty(PutHDFS.CONFLICT_RESOLUTION, "replace");
    -        runner.setValidateExpressionUsage(false);
    +        try (FileInputStream fis = new 
FileInputStream("src/test/resources/testdata/randombytes-1");) {
    +            Map<String, String> attributes = new HashMap<String, String>();
    +            attributes.put(CoreAttributes.FILENAME.key(), "randombytes-1");
    +            runner.enqueue(fis, attributes);
    +            runner.run();
    +        }
    +
    +        Configuration config = new Configuration();
    +        FileSystem fs = FileSystem.get(config);
    +
    +        List<MockFlowFile> failedFlowFiles = runner
    +                .getFlowFilesForRelationship(new 
Relationship.Builder().name("failure").build());
    +        assertTrue(failedFlowFiles.isEmpty());
    +
    +        List<MockFlowFile> flowFiles = 
runner.getFlowFilesForRelationship(PutHDFS.REL_SUCCESS);
    +        assertEquals(1, flowFiles.size());
    --- End diff --
    
    Agreed, but the test still gets the flowfile to check some of the 
attributes, so I think the code is fine as is.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to