@Test public void testArtifactWithFullyConfiguredLicense() { License license = new License(); license.setId(LICENSE_ID); license.setCommonName(LICENSE_NAME); license.setText(LICENSE_TEXT); license.setThreatGroup(LICENSE_THREAT_GROUP); license.setClassification(LICENSE_CLASSIFICATION); Artifact artifact = new Artifact(); artifact.addFact(new ConfiguredLicenseInformation(license)); knowledgeBaseResolver.process(Collections.singletonList(artifact)); final Collection<License> finalLicenses = ArtifactLicenseUtils.getFinalLicenses(artifact).getLicenses(); assertThat(finalLicenses.size()).isEqualTo(1); assertThat(finalLicenses.stream() .findAny()) .hasValueSatisfying(l -> { assertThat(l.getId()).isEqualTo(LICENSE_ID); assertThat(l.getCommonName()).isEqualTo(LICENSE_NAME); assertThat(l.getText()).isEqualTo(LICENSE_TEXT); assertThat(l.getThreatGroup()).hasValue(LICENSE_THREAT_GROUP); assertThat(l.getClassification()).hasValue(LICENSE_CLASSIFICATION); }); }
@Override public Collection<Artifact> process(Collection<Artifact> artifacts) { return new LicenseKnowledgeBaseResolverImpl(knowledgeBase).resolveKnowledgeBase(artifacts); }
LicenseKnowledgeBaseResolver extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> artifacts) { return new LicenseKnowledgeBaseResolverImpl(knowledgeBase).resolveKnowledgeBase(artifacts); } }
LicenseKnowledgeBaseResolver extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> artifacts) { return new LicenseKnowledgeBaseResolverImpl(knowledgeBase).resolveKnowledgeBase(artifacts); } LicenseKnowledgeBaseResolver();  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase);  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase,
                                        Supplier<List<ILicenseManagementKnowledgeBase>> supplier); }
LicenseKnowledgeBaseResolver extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> artifacts) { return new LicenseKnowledgeBaseResolverImpl(knowledgeBase).resolveKnowledgeBase(artifacts); } LicenseKnowledgeBaseResolver();  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase);  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase,
                                        Supplier<List<ILicenseManagementKnowledgeBase>> supplier); ILicenseManagementKnowledgeBase getKnowledgeBase(); @Override Collection<Artifact> process(Collection<Artifact> artifacts); @Override void configure(Map<String,String> configMap); }
LicenseKnowledgeBaseResolver extends AbstractProcessor { @Override public Collection<Artifact> process(Collection<Artifact> artifacts) { return new LicenseKnowledgeBaseResolverImpl(knowledgeBase).resolveKnowledgeBase(artifacts); } LicenseKnowledgeBaseResolver();  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase);  LicenseKnowledgeBaseResolver(ILicenseManagementKnowledgeBase knowledgeBase,
                                        Supplier<List<ILicenseManagementKnowledgeBase>> supplier); ILicenseManagementKnowledgeBase getKnowledgeBase(); @Override Collection<Artifact> process(Collection<Artifact> artifacts); @Override void configure(Map<String,String> configMap);  }