Repository: nifi Updated Branches: refs/heads/master c8928ce35 -> 10479a5a2
NIFI-5740 Ensuring permissions are restored after test completes in TestFetchFile Signed-off-by: Matthew Burgess <[email protected]> This closes #3104 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/10479a5a Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/10479a5a Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/10479a5a Branch: refs/heads/master Commit: 10479a5a2af4a3e53ef3d3f8f71e84122965fbf2 Parents: c8928ce Author: Bryan Bende <[email protected]> Authored: Tue Oct 23 10:44:26 2018 -0400 Committer: Matthew Burgess <[email protected]> Committed: Tue Oct 23 15:26:33 2018 -0400 ---------------------------------------------------------------------- .../nifi/processors/standard/TestFetchFile.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/10479a5a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java index dcafefe..ee2367c 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java @@ -210,13 +210,17 @@ public class TestFetchFile { moveTargetParentDir.mkdirs(); moveTargetParentDir.setReadable(false); moveTargetParentDir.setWritable(false); - - runner.enqueue(new byte[0]); - runner.run(); - runner.assertAllFlowFilesTransferred(FetchFile.REL_FAILURE, 1); - runner.getFlowFilesForRelationship(FetchFile.REL_FAILURE).get(0).assertContentEquals(""); - - assertTrue(sourceFile.exists()); + try { + runner.enqueue(new byte[0]); + runner.run(); + runner.assertAllFlowFilesTransferred(FetchFile.REL_FAILURE, 1); + runner.getFlowFilesForRelationship(FetchFile.REL_FAILURE).get(0).assertContentEquals(""); + + assertTrue(sourceFile.exists()); + } finally { + moveTargetParentDir.setReadable(true); + moveTargetParentDir.setWritable(true); + } } @Test
