Skip to content

Commit d500a1a

Browse files
committed
Test getId for listed licenses
1 parent e2cb4b9 commit d500a1a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/test/java/org/spdx/library/ListedLicensesTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.spdx.storage.compatv2.CompatibleModelStoreWrapper;
3232

3333
import junit.framework.TestCase;
34-
import org.spdx.utility.compare.UnitTestHelper;
3534

3635

3736
/**
@@ -162,7 +161,18 @@ public void testGetLicenseIdProperty() throws InvalidSPDXAnalysisException {
162161
assertTrue(idProp.get() instanceof String);
163162
assertEquals(id, idProp.get());
164163
}
165-
164+
165+
public void testGetIdV2() throws InvalidSPDXAnalysisException {
166+
String id = "Apache-2.0";
167+
SpdxListedLicense lic = ListedLicenses.getListedLicenses().getListedLicenseByIdCompatV2(id);
168+
assertEquals(id, lic.getId());
169+
}
170+
171+
public void testGetIdV3() throws InvalidSPDXAnalysisException {
172+
String id = "Apache-2.0";
173+
ListedLicense lic = ListedLicenses.getListedLicenses().getListedLicenseById(id);
174+
assertEquals(id, lic.getId());
175+
}
166176
public void testGetExceptionIdProperty() throws InvalidSPDXAnalysisException {
167177
String id = "Classpath-exception-2.0";
168178
org.spdx.library.model.v2.license.ListedLicenseException ex = ListedLicenses.getListedLicenses().getListedExceptionByIdCompatV2(id);

0 commit comments

Comments
 (0)