diff --git a/nifi-daffodil-processors/src/main/java/com/owlcyberdefense/nifi/processors/AbstractDaffodilProcessor.java b/nifi-daffodil-processors/src/main/java/com/owlcyberdefense/nifi/processors/AbstractDaffodilProcessor.java index 2556b51..7d7c325 100644 --- a/nifi-daffodil-processors/src/main/java/com/owlcyberdefense/nifi/processors/AbstractDaffodilProcessor.java +++ b/nifi-daffodil-processors/src/main/java/com/owlcyberdefense/nifi/processors/AbstractDaffodilProcessor.java @@ -80,7 +80,7 @@ public abstract class AbstractDaffodilProcessor extends AbstractProcessor { .description("Full path to the DFDL schema file that is to be used for parsing/unparsing.") .required(true) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) - .addValidator(StandardValidators.FILE_EXISTS_VALIDATOR) + .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .build(); public static final PropertyDescriptor PRE_COMPILED_SCHEMA = new PropertyDescriptor.Builder() diff --git a/nifi-daffodil-processors/src/test/java/com/owlcyberdefense/nifi/processors/TestDaffodilProcessor.java b/nifi-daffodil-processors/src/test/java/com/owlcyberdefense/nifi/processors/TestDaffodilProcessor.java index ce9d386..5ae0a51 100644 --- a/nifi-daffodil-processors/src/test/java/com/owlcyberdefense/nifi/processors/TestDaffodilProcessor.java +++ b/nifi-daffodil-processors/src/test/java/com/owlcyberdefense/nifi/processors/TestDaffodilProcessor.java @@ -47,7 +47,13 @@ public class TestDaffodilProcessor { public void testDFDLSchemaNotFound() throws IOException { final TestRunner testRunner = TestRunners.newTestRunner(DaffodilParse.class); testRunner.setProperty(DaffodilParse.DFDL_SCHEMA_FILE, "/does/not/exist.dfdl.xsd"); - testRunner.assertNotValid(); + testRunner.assertValid(); + testRunner.enqueue(Paths.get("src/test/resources/TestDaffodilProcessor/tokens.csv")); + testRunner.run(); + testRunner.assertAllFlowFilesTransferred(DaffodilParse.REL_FAILURE); + final MockFlowFile original = testRunner.getFlowFilesForRelationship(DaffodilParse.REL_FAILURE).get(0); + final String expectedContent = new String(Files.readAllBytes(Paths.get("src/test/resources/TestDaffodilProcessor/tokens.csv"))); + original.assertContentEquals(expectedContent); } @Test