@Test @SuppressWarnings("unchecked") public void testFilter() { Collection<WorkItemDefinition> result = tested.execute(metadata); ArgumentCaptor<DirectoryStream.Filter> filterCaptor = ArgumentCaptor.forClass(DirectoryStream.Filter.class); verify(vfsService, times(1)) .newDirectoryStream(eq(path), filterCaptor.capture()); DirectoryStream.Filter<Path> filter = filterCaptor.getValue(); Path path1 = mock(Path.class); when(path1.getFileName()).thenReturn("someFile.wid"); assertTrue(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.bpmn"); assertFalse(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.WID"); assertTrue(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.WiD"); assertTrue(filter.accept(path1)); }
@Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); }
WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } }
WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected  WorkItemDefinitionVFSLookupService(); @Inject  WorkItemDefinitionVFSLookupService(final VFSService vfsService,
                                              final WorkItemDefinitionResources resources); }
WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected  WorkItemDefinitionVFSLookupService(); @Inject  WorkItemDefinitionVFSLookupService(final VFSService vfsService,
                                              final WorkItemDefinitionResources resources); @Override Collection<WorkItemDefinition> execute(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata,
                                                 final Path root); Collection<WorkItemDefinition> get(final Metadata metadata,
                                              final Path resource); }
WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected  WorkItemDefinitionVFSLookupService(); @Inject  WorkItemDefinitionVFSLookupService(final VFSService vfsService,
                                              final WorkItemDefinitionResources resources); @Override Collection<WorkItemDefinition> execute(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata,
                                                 final Path root); Collection<WorkItemDefinition> get(final Metadata metadata,
                                              final Path resource);  }