@Override public boolean filterRecord(Record record) { FileRecord fileRecord = (FileRecord) record; for (String extension : extensions) { if (fileRecord.getPayload().getName().endsWith(extension)) { return true; } } return false; }
@Before public void setUp() throws Exception { filter = new FileExtensionFilter(".txt", ".xml"); when(fileRecord.getPayload()).thenReturn(file); }