@Test public void testOverride() { String copyrightStatement = "someCopyright Statement"; String modificationStatus = "MODIFIED"; specialArtifact.addFact(new ArtifactModificationStatus(modificationStatus)); artifacts.add(specialArtifact); when(configMock.getOverride()) .thenReturn(getOverwriteMap(overrideArtifactMatchState, copyrightStatement, null)); ConfigurationHandlerOverride handler = new ConfigurationHandlerOverride(antennaContextMock); handler.process(artifacts); assertThat(artifacts.size()).isEqualTo(4); Artifact processedArtifact = artifacts.stream() .filter(a -> new ArtifactFilename(FILENAME).matches(a)) .findAny() .orElseThrow(() -> new IllegalStateException("should not happen")); assertThat(processedArtifact.askFor(ArtifactCoordinates.class).get().getCoordinates().stream() .filter(p -> PackageURL.StandardTypes.MAVEN.equals(p.getType())) .findAny() .get() .getName()) .isEqualTo(OVERRIDE_ID); assertThat(processedArtifact.askFor(ArtifactMatchingMetadata.class).map(ArtifactMatchingMetadata::getMatchState).orElse(null)).isEqualTo(expectedMatchState); assertThat(processedArtifact.askForGet(CopyrightStatement.class).get()).isEqualTo(copyrightStatement); assertThat(processedArtifact.askForGet(ArtifactModificationStatus.class).get()).isEqualTo(modificationStatus); }
@Override public Collection<Artifact> process(Collection<Artifact> intermediates) { resolveOverride(context.getConfiguration(), intermediates, this.reporter); return intermediates; }
ConfigurationHandlerOverride extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> intermediates) { resolveOverride(context.getConfiguration(), intermediates, this.reporter); return intermediates; } }
ConfigurationHandlerOverride extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> intermediates) { resolveOverride(context.getConfiguration(), intermediates, this.reporter); return intermediates; } ConfigurationHandlerOverride(AntennaContext context); }
ConfigurationHandlerOverride extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> intermediates) { resolveOverride(context.getConfiguration(), intermediates, this.reporter); return intermediates; } ConfigurationHandlerOverride(AntennaContext context); @Override Collection<Artifact> process(Collection<Artifact> intermediates); }
ConfigurationHandlerOverride extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> intermediates) { resolveOverride(context.getConfiguration(), intermediates, this.reporter); return intermediates; } ConfigurationHandlerOverride(AntennaContext context); @Override Collection<Artifact> process(Collection<Artifact> intermediates);  }