@Test public void testFindReleaseForArtifactWithNoCoordinate() { setUp(); final Optional<SW360Release> releaseForArtifact = metaDataReceiver.findReleaseForArtifact(new Artifact()); assertThat(releaseForArtifact).isNotPresent(); verify(componentClientAdapter, never()).getComponentByName(any()); }
public Optional<SW360Release> findReleaseForArtifact(Artifact artifact) { Optional<SW360Component> component = getComponentByArtifact(artifact); if (component.isPresent()) { String releaseVersionOfArtifact = ArtifactToReleaseUtils.createSW360ReleaseVersion(artifact); return releaseClientAdapter.getReleaseByVersion(component.get(), releaseVersionOfArtifact); } return Optional.empty(); }
SW360MetaDataReceiver { public Optional<SW360Release> findReleaseForArtifact(Artifact artifact) { Optional<SW360Component> component = getComponentByArtifact(artifact); if (component.isPresent()) { String releaseVersionOfArtifact = ArtifactToReleaseUtils.createSW360ReleaseVersion(artifact); return releaseClientAdapter.getReleaseByVersion(component.get(), releaseVersionOfArtifact); } return Optional.empty(); } }
SW360MetaDataReceiver { public Optional<SW360Release> findReleaseForArtifact(Artifact artifact) { Optional<SW360Component> component = getComponentByArtifact(artifact); if (component.isPresent()) { String releaseVersionOfArtifact = ArtifactToReleaseUtils.createSW360ReleaseVersion(artifact); return releaseClientAdapter.getReleaseByVersion(component.get(), releaseVersionOfArtifact); } return Optional.empty(); } SW360MetaDataReceiver(SW360Connection sw360ConnectionConfiguration); }
SW360MetaDataReceiver { public Optional<SW360Release> findReleaseForArtifact(Artifact artifact) { Optional<SW360Component> component = getComponentByArtifact(artifact); if (component.isPresent()) { String releaseVersionOfArtifact = ArtifactToReleaseUtils.createSW360ReleaseVersion(artifact); return releaseClientAdapter.getReleaseByVersion(component.get(), releaseVersionOfArtifact); } return Optional.empty(); } SW360MetaDataReceiver(SW360Connection sw360ConnectionConfiguration); Optional<SW360Release> findReleaseForArtifact(Artifact artifact); Optional<SW360License> getLicenseDetails(SW360SparseLicense sparseLicense); Optional<Path> downloadAttachment(SW360Release release, SW360SparseAttachment attachment, Path downloadPath); }
SW360MetaDataReceiver { public Optional<SW360Release> findReleaseForArtifact(Artifact artifact) { Optional<SW360Component> component = getComponentByArtifact(artifact); if (component.isPresent()) { String releaseVersionOfArtifact = ArtifactToReleaseUtils.createSW360ReleaseVersion(artifact); return releaseClientAdapter.getReleaseByVersion(component.get(), releaseVersionOfArtifact); } return Optional.empty(); } SW360MetaDataReceiver(SW360Connection sw360ConnectionConfiguration); Optional<SW360Release> findReleaseForArtifact(Artifact artifact); Optional<SW360License> getLicenseDetails(SW360SparseLicense sparseLicense); Optional<Path> downloadAttachment(SW360Release release, SW360SparseAttachment attachment, Path downloadPath);  }