@Test public void testUpdaterArtifactToReleaseWithUploadsNoUploads() { Artifact artifact = TestUtils.mkArtifact("test", false); License license = new License("testLicense"); SW360License sw360License = new SW360License(); sw360License.setShortName("sw360TestLicense"); artifact.addFact(new ConfiguredLicenseInformation(license)); SW360Release release = createRelease("test", null); SW360Release updatedRelease = createRelease("testUpdated", null); when(metaDataUpdater.getLicenses(Collections.singletonList(license))) .thenReturn(Collections.singleton(sw360License)); when(metaDataUpdater.getOrCreateRelease(release, true)) .thenReturn(updatedRelease); SW360UpdaterImpl updater = new SW360UpdaterImpl(metaDataUpdater, "test", "version", true, true, false); AttachmentUploadResult<SW360Release> result = updater.artifactToReleaseWithUploads(artifact, release, Collections.emptyMap()); assertThat(result.getTarget()).isEqualTo(updatedRelease); assertThat(release.getMainLicenseIds()).containsOnly(sw360License.getShortName()); verify(metaDataUpdater, never()).uploadAttachments(any(), any(), anyBoolean()); }
public AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release, Map<Path, SW360AttachmentType> uploads) { Set<String> licenseIds = getSetOfLicenseIds(artifact); release.setMainLicenseIds(licenseIds); SW360Release sw360ReleaseFinal = sw360MetaDataUpdater.getOrCreateRelease(release, isUpdateReleases()); return uploadSourceAndAttachments(sw360ReleaseFinal, artifact, uploads); }
SW360UpdaterImpl { public AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release, Map<Path, SW360AttachmentType> uploads) { Set<String> licenseIds = getSetOfLicenseIds(artifact); release.setMainLicenseIds(licenseIds); SW360Release sw360ReleaseFinal = sw360MetaDataUpdater.getOrCreateRelease(release, isUpdateReleases()); return uploadSourceAndAttachments(sw360ReleaseFinal, artifact, uploads); } }
SW360UpdaterImpl { public AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release, Map<Path, SW360AttachmentType> uploads) { Set<String> licenseIds = getSetOfLicenseIds(artifact); release.setMainLicenseIds(licenseIds); SW360Release sw360ReleaseFinal = sw360MetaDataUpdater.getOrCreateRelease(release, isUpdateReleases()); return uploadSourceAndAttachments(sw360ReleaseFinal, artifact, uploads); } SW360UpdaterImpl(SW360MetaDataUpdater sw360MetaDataUpdater,
                            String projectName, String projectVersion, boolean updateReleases,
                            boolean uploadSources, boolean deleteObsoleteSourceAttachments); }
SW360UpdaterImpl { public AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release, Map<Path, SW360AttachmentType> uploads) { Set<String> licenseIds = getSetOfLicenseIds(artifact); release.setMainLicenseIds(licenseIds); SW360Release sw360ReleaseFinal = sw360MetaDataUpdater.getOrCreateRelease(release, isUpdateReleases()); return uploadSourceAndAttachments(sw360ReleaseFinal, artifact, uploads); } SW360UpdaterImpl(SW360MetaDataUpdater sw360MetaDataUpdater,
                            String projectName, String projectVersion, boolean updateReleases,
                            boolean uploadSources, boolean deleteObsoleteSourceAttachments); boolean isUpdateReleases(); boolean isUploadSources(); boolean isDeleteObsoleteSourceAttachments(); Map<String, IAttachable> produce(Collection<Artifact> intermediates); SW360Release artifactToReleaseInSW360(Artifact artifact); SW360Release artifactToReleaseInSW360(Artifact artifact, SW360Release release); AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release,
                                                                             Map<Path, SW360AttachmentType> uploads); }
SW360UpdaterImpl { public AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release, Map<Path, SW360AttachmentType> uploads) { Set<String> licenseIds = getSetOfLicenseIds(artifact); release.setMainLicenseIds(licenseIds); SW360Release sw360ReleaseFinal = sw360MetaDataUpdater.getOrCreateRelease(release, isUpdateReleases()); return uploadSourceAndAttachments(sw360ReleaseFinal, artifact, uploads); } SW360UpdaterImpl(SW360MetaDataUpdater sw360MetaDataUpdater,
                            String projectName, String projectVersion, boolean updateReleases,
                            boolean uploadSources, boolean deleteObsoleteSourceAttachments); boolean isUpdateReleases(); boolean isUploadSources(); boolean isDeleteObsoleteSourceAttachments(); Map<String, IAttachable> produce(Collection<Artifact> intermediates); SW360Release artifactToReleaseInSW360(Artifact artifact); SW360Release artifactToReleaseInSW360(Artifact artifact, SW360Release release); AttachmentUploadResult<SW360Release> artifactToReleaseWithUploads(Artifact artifact, SW360Release release,
                                                                             Map<Path, SW360AttachmentType> uploads);  }