@Test public void testExecute() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD1_NAME, WD2_NAME})); assertFalse(result.isEmpty()); assertEquals(2, result.size()); assertTrue(result.stream().anyMatch(w -> WD1_NAME.equals(w.getName()))); assertTrue(result.stream().anyMatch(w -> WD2_NAME.equals(w.getName()))); }
@Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); }
WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } }
WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService();   WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); }
WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService();   WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
                                                       final String serviceRepoUrl,
                                                       final String[] names); }
WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService();   WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
                                                       final String serviceRepoUrl,
                                                       final String[] names); static Function<String, WorkItemsHolder> DEFAULT_LOOKUP_SERVICE; }