SW360Updater extends AbstractGenerator { @Override public Map<String, IAttachable> produce(Collection<Artifact> intermediates) { return updaterImpl.produce(intermediates); } SW360Updater();   SW360Updater(SW360ConnectionConfigurationFactory factory); @Override void configure(Map<String, String> configMap); @Override Map<String, IAttachable> produce(Collection<Artifact> intermediates);  }
@Test public void testProduce() { Set<Artifact> artifacts = Collections.singleton(mock(Artifact.class)); Map<String, IAttachable> updateResult = Collections.singletonMap("foo", mock(IAttachable.class)); final SW360UpdaterImpl updaterImpl = mock(SW360UpdaterImpl.class); when(updaterImpl.produce(artifacts)) .thenReturn(updateResult); SW360Updater updater = new SW360Updater() { @Override SW360UpdaterImpl createUpdaterImpl(Map<String, String> configMap) { return updaterImpl; } }; updater.configure(createConfigMap()); final Map<String, IAttachable> releases = updater.produce(artifacts); assertThat(releases).isEqualTo(updateResult); }