-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Parsing a bom with ISO 8601 compliant available metadata.timestamp using a version > 9.1.0 returns a bom object with value null
for metadata.timestamp.
Code to reproduce the behaviour (or run the test in BomParserTest in attached TestSbomImport):
import org.cyclonedx.model.Bom;
import org.cyclonedx.parsers.JsonParser;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
public class BomParserTest {
@Test
void manTest() {
try {
String bomContent = new String(Files.readAllBytes(new File("src/test/resources/bom.json").toPath()));
Bom b = new JsonParser().parse(bomContent.getBytes(StandardCharsets.UTF_8));
// works with 9.1.0 but not with later versions
assertNotNull(b.getMetadata().getTimestamp());
}
catch (Exception e) {
assertNull(e);
}
}
}
Metadata
Metadata
Assignees
Labels
No labels