@@ -1951,5 +1951,29 @@ public void testConvertToLicenseExpression() throws InvalidSPDXAnalysisException
19511951 assertTrue (expected .isEmpty ());
19521952 assertEquals (ands .toString (), result .getLicenseExpression ());
19531953 }
1954+
1955+ @ Test
1956+ public void testPackageSupplierNoAssertionAndNone () throws InvalidSPDXAnalysisException {
1957+ CreationInfo testCreationInfo = Spdx2to3Converter .convertCreationInfo (
1958+ new SpdxCreatorInformation (fromModelStore , DOCUMENT_URI ,
1959+ fromModelStore .getNextId (IdType .Anonymous ), copyManager , true )
1960+ .setCreated ("2010-01-29T18:30:22Z" ),
1961+ toModelStore , DEFAULT_PREFIX );
1962+
1963+ // "NOASSERTION" agent string
1964+ Agent resultNoAssertion = Spdx2to3Converter .stringToAgent ("NOASSERTION" , testCreationInfo );
1965+ assertNull ("stringToAgent should return null for NOASSERTION value" , resultNoAssertion );
1966+
1967+ // "NONE" agent string
1968+ Agent resultNone = Spdx2to3Converter .stringToAgent ("NONE" , testCreationInfo );
1969+ assertNull ("stringToAgent should return null for NONE value" , resultNone );
1970+
1971+ // Valid Person agent string
1972+ String personCreator =
SpdxConstantsCompatV2 .
CREATOR_PREFIX_PERSON +
"John Doe ([email protected] )" ;
1973+ Agent resultPerson = Spdx2to3Converter .stringToAgent (personCreator , testCreationInfo );
1974+ assertNotNull ("stringToAgent should return an Agent for valid Person format" , resultPerson );
1975+ assertTrue ("Result should be a Person" , resultPerson instanceof Person );
1976+ assertEquals ("John Doe" , resultPerson .getName ().get ());
1977+ }
19541978
19551979}
0 commit comments