Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public static CreationInfo convertCreationInfo(
CreationInfo retval = new CreationInfo.CreationInfoBuilder(modelStore, modelStore.getNextId(IdType.Anonymous), null)
.setCreated(creationInfoV2.getCreated())
.setSpecVersion(SpdxConstantsV3.MODEL_SPEC_VERSION)
.setComment(creationInfoV2.getComment().orElse(null))
.build();
retval.setIdPrefix(uriPrefix);
for (String docCreator:creationInfoV2.getCreators()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ public void testConvertCreationInfo() throws InvalidSPDXAnalysisException {
String organizationCreatorName = "Source Auditor Inc.";
String organizationCreator = SpdxConstantsCompatV2.CREATOR_PREFIX_ORGANIZATION + organizationCreatorName;
String created = "2010-01-29T18:30:22Z";
String comment = "Test creation info comment";
String licenseListVersion = "3.21";
SpdxCreatorInformation creatorInfo = new SpdxCreatorInformation(fromModelStore, DOCUMENT_URI, creatorId, copyManager, true);
creatorInfo.getCreators().add(personCreator);
creatorInfo.getCreators().add(toolCreator);
creatorInfo.getCreators().add(organizationCreator);
creatorInfo.setCreated(created);
creatorInfo.setComment(comment);
creatorInfo.setLicenseListVersion(licenseListVersion);
List<String> verify = creatorInfo.verify();
assertTrue(verify.isEmpty());
Expand Down Expand Up @@ -173,6 +175,7 @@ public void testConvertCreationInfo() throws InvalidSPDXAnalysisException {
assertEquals(1, tools.length);
assertEquals(toolCreatorName, tools[0].getName().get());
assertEquals(created, result.getCreated());
assertEquals(comment, result.getComment().orElse(null));
assertEquals(IdType.Anonymous, toModelStore.getIdType(result.getObjectUri()));
verify = result.verify();
assertTrue(verify.isEmpty());
Expand Down