@Test public void testIsValidReleaseEmptyVersion() { SW360Release release = new SW360Release(); release.setName("releaseName"); release.setVersion(""); try { SW360ReleaseAdapterUtils.validateRelease(release); fail("Invalid release not detected!"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).contains("missing property 'version'"); } }
public static SW360Release validateRelease(SW360Release release) { if (StringUtils.isEmpty(release.getName())) { throw new IllegalArgumentException("Invalid release: missing property 'name'."); } if (StringUtils.isEmpty(release.getVersion())) { throw new IllegalArgumentException("Invalid release: missing property 'version'."); } return release; }
SW360ReleaseAdapterUtils { public static SW360Release validateRelease(SW360Release release) { if (StringUtils.isEmpty(release.getName())) { throw new IllegalArgumentException("Invalid release: missing property 'name'."); } if (StringUtils.isEmpty(release.getVersion())) { throw new IllegalArgumentException("Invalid release: missing property 'version'."); } return release; } }
SW360ReleaseAdapterUtils { public static SW360Release validateRelease(SW360Release release) { if (StringUtils.isEmpty(release.getName())) { throw new IllegalArgumentException("Invalid release: missing property 'name'."); } if (StringUtils.isEmpty(release.getVersion())) { throw new IllegalArgumentException("Invalid release: missing property 'version'."); } return release; } private  SW360ReleaseAdapterUtils(); }
SW360ReleaseAdapterUtils { public static SW360Release validateRelease(SW360Release release) { if (StringUtils.isEmpty(release.getName())) { throw new IllegalArgumentException("Invalid release: missing property 'name'."); } if (StringUtils.isEmpty(release.getVersion())) { throw new IllegalArgumentException("Invalid release: missing property 'version'."); } return release; } private  SW360ReleaseAdapterUtils(); static SW360Release validateRelease(SW360Release release); }
SW360ReleaseAdapterUtils { public static SW360Release validateRelease(SW360Release release) { if (StringUtils.isEmpty(release.getName())) { throw new IllegalArgumentException("Invalid release: missing property 'name'."); } if (StringUtils.isEmpty(release.getVersion())) { throw new IllegalArgumentException("Invalid release: missing property 'version'."); } return release; } private  SW360ReleaseAdapterUtils(); static SW360Release validateRelease(SW360Release release);  }