@@ -158,13 +158,25 @@ public void testGetLicenseIdProperty() throws InvalidSPDXAnalysisException {
158158 assertEquals (id , idProp .get ());
159159 }
160160
161- public void testGetExceptionIdProperty () throws InvalidSPDXAnalysisException {
162- String id = "Classpath-exception-2.0" ;
163- org .spdx .library .model .v2 .license .ListedLicenseException ex = ListedLicenses .getListedLicenses ().getListedExceptionByIdCompatV2 (id );
164- Optional <Object > idProp = ex .getModelStore ().getValue (
165- CompatibleModelStoreWrapper .documentUriIdToUri (ex .getDocumentUri (), id , false ), SpdxConstantsCompatV2 .PROP_LICENSE_EXCEPTION_ID );
166- assertTrue (idProp .isPresent ());
167- assertTrue (idProp .get () instanceof String );
168- assertEquals (id , idProp .get ());
169- }
161+ public void testGetExceptionIdProperty () throws InvalidSPDXAnalysisException {
162+ String id = "Classpath-exception-2.0" ;
163+ org .spdx .library .model .v2 .license .ListedLicenseException ex = ListedLicenses .getListedLicenses ().getListedExceptionByIdCompatV2 (id );
164+ Optional <Object > idProp = ex .getModelStore ().getValue (
165+ CompatibleModelStoreWrapper .documentUriIdToUri (ex .getDocumentUri (), id , false ), SpdxConstantsCompatV2 .PROP_LICENSE_EXCEPTION_ID );
166+ assertTrue (idProp .isPresent ());
167+ assertTrue (idProp .get () instanceof String );
168+ assertEquals (id , idProp .get ());
169+ }
170+
171+ public void testGetIdV2 () throws InvalidSPDXAnalysisException {
172+ String id = "Apache-2.0" ;
173+ SpdxListedLicense lic = ListedLicenses .getListedLicenses ().getListedLicenseByIdCompatV2 (id );
174+ assertEquals (id , lic .getId ());
175+ }
176+
177+ public void testGetIdV3 () throws InvalidSPDXAnalysisException {
178+ String id = "Apache-2.0" ;
179+ ListedLicense lic = ListedLicenses .getListedLicenses ().getListedLicenseById (id );
180+ assertEquals (id , lic .getId ());
181+ }
170182}
0 commit comments