From e5eb96301146e74dbd65e3701ab68cf8c0c976ec Mon Sep 17 00:00:00 2001 From: Bryan Bende Date: Tue, 23 Oct 2018 10:44:26 -0400 Subject: [PATCH] NIFI-5740 Ensuring permissions are restored after test completes in TestFetchFile --- .../processors/standard/TestFetchFile.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 dcafefeb168d..ee2367c3179a 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 void testMoveOnCompleteWithParentOfTargetDirNotAccessible() throws IOExce 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