@Test void licenseWithNullTextTest() { License license = new License(); license.setText(null); String licenseText = ArtifactAdapter.getLicenseText(license); assertThat(licenseText).isEqualTo("No license text available"); }
public static String getLicenseText(License license) { String text = license.getText(); if (StringUtils.isBlank(text)) { return "No license text available"; } return text .replace("\u0009", " ") .replace("\u00a0", " ") .replace("\u200b", "") .replace("\u2028", "\n") .replace("\ufeff", ""); }
ArtifactAdapter implements ArtifactAndLicense { public static String getLicenseText(License license) { String text = license.getText(); if (StringUtils.isBlank(text)) { return "No license text available"; } return text .replace("\u0009", " ") .replace("\u00a0", " ") .replace("\u200b", "") .replace("\u2028", "\n") .replace("\ufeff", ""); } }
ArtifactAdapter implements ArtifactAndLicense { public static String getLicenseText(License license) { String text = license.getText(); if (StringUtils.isBlank(text)) { return "No license text available"; } return text .replace("\u0009", " ") .replace("\u00a0", " ") .replace("\u200b", "") .replace("\u2028", "\n") .replace("\ufeff", ""); } ArtifactAdapter(Artifact artifact); }
ArtifactAdapter implements ArtifactAndLicense { public static String getLicenseText(License license) { String text = license.getText(); if (StringUtils.isBlank(text)) { return "No license text available"; } return text .replace("\u0009", " ") .replace("\u00a0", " ") .replace("\u200b", "") .replace("\u2028", "\n") .replace("\ufeff", ""); } ArtifactAdapter(Artifact artifact); static String getLicenseText(License license); static String createKey(License license); @Override String getFilename(); @Override List<LicenseInfo> getLicenses(); @Override Optional<String> getCopyrightStatement(); @Override Optional<String> getPurl(); }
ArtifactAdapter implements ArtifactAndLicense { public static String getLicenseText(License license) { String text = license.getText(); if (StringUtils.isBlank(text)) { return "No license text available"; } return text .replace("\u0009", " ") .replace("\u00a0", " ") .replace("\u200b", "") .replace("\u2028", "\n") .replace("\ufeff", ""); } ArtifactAdapter(Artifact artifact); static String getLicenseText(License license); static String createKey(License license); @Override String getFilename(); @Override List<LicenseInfo> getLicenses(); @Override Optional<String> getCopyrightStatement(); @Override Optional<String> getPurl();  }