How to queue a file to test input?
public void testProcessor() { try { testRunner.enqueue(new FileInputStream(new File("src/test/data/your_data.txt"))); } catch (FileNotFoundException e) { e.printStackTrace(); } testRunner.run(); }How to set properties?
public void testProcessor() { testRunner.setProperty(MyProcessor.MY_PROPERTY , "value"); testRunner.run(); }How to set Flowfile attributes
public void testProcessor() { Map< String, String > attributes = new HashMap<>(); attributes.put( "datasource_id", "2" ); try { testRunner.enqueue(new FileInputStream(new File("src/test/data/108124118589781")), attributes); } catch (FileNotFoundException e) { e.printStackTrace(); } testRunner.run(); }
No comments:
Post a Comment