SW360ComponentAdapterUtils { static SW360Component createFromRelease(SW360Release release) { SW360Component sw360Component = new SW360Component(); sw360Component.setName(release.getName()); setComponentType(sw360Component, release.isProprietary()); sw360Component.setCategories(Collections.singleton("Antenna")); sw360Component.setHomepage(release.getHomepageUrl()); return sw360Component; } private  SW360ComponentAdapterUtils(); static void setComponentType(SW360Component component, boolean isProprietary);  }
@Test public void testCreateFromRelease() { final String homepageUrl = "dummy.page.url"; SW360Release release = new SW360Release() .setName("test") .setProprietary(true) .setHomepageUrl(homepageUrl); SW360Component component = SW360ComponentAdapterUtils.createFromRelease(release); assertThat(component.getName()).isEqualTo(release.getName()); assertThat(component.getComponentType()).isEqualTo(SW360ComponentType.INTERNAL); assertThat(component.getHomepage()).isEqualTo(homepageUrl); }