diff --git a/src/main/java/org/cyclonedx/generators/xml/BomXmlGenerator.java b/src/main/java/org/cyclonedx/generators/xml/BomXmlGenerator.java index e135dd69f..bc0f29beb 100644 --- a/src/main/java/org/cyclonedx/generators/xml/BomXmlGenerator.java +++ b/src/main/java/org/cyclonedx/generators/xml/BomXmlGenerator.java @@ -140,6 +140,7 @@ public String toXmlString() throws GeneratorException { * * @return a String of the BoM * @since 1.1.0 + * */ @Override public String toString() { diff --git a/src/main/java/org/cyclonedx/model/attestation/Attestation.java b/src/main/java/org/cyclonedx/model/attestation/Attestation.java index 9080f3d9f..27dd01dc2 100644 --- a/src/main/java/org/cyclonedx/model/attestation/Attestation.java +++ b/src/main/java/org/cyclonedx/model/attestation/Attestation.java @@ -2,7 +2,6 @@ import java.util.List; import java.util.Objects; -import javax.xml.bind.annotation.XmlElement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/org/cyclonedx/model/attestation/Claim.java b/src/main/java/org/cyclonedx/model/attestation/Claim.java index fdb9d9f8d..d16d1bae5 100644 --- a/src/main/java/org/cyclonedx/model/attestation/Claim.java +++ b/src/main/java/org/cyclonedx/model/attestation/Claim.java @@ -2,7 +2,6 @@ import java.util.List; import java.util.Objects; -import javax.xml.bind.annotation.XmlElement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/org/cyclonedx/model/attestation/affirmation/Affirmation.java b/src/main/java/org/cyclonedx/model/attestation/affirmation/Affirmation.java index dcba33b86..39dc42f2b 100644 --- a/src/main/java/org/cyclonedx/model/attestation/affirmation/Affirmation.java +++ b/src/main/java/org/cyclonedx/model/attestation/affirmation/Affirmation.java @@ -2,11 +2,9 @@ import java.util.List; import java.util.Objects; -import javax.xml.bind.annotation.XmlElement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/src/main/java/org/cyclonedx/model/attestation/affirmation/Signatory.java b/src/main/java/org/cyclonedx/model/attestation/affirmation/Signatory.java index 6c0e183fe..5e66edbf6 100644 --- a/src/main/java/org/cyclonedx/model/attestation/affirmation/Signatory.java +++ b/src/main/java/org/cyclonedx/model/attestation/affirmation/Signatory.java @@ -15,7 +15,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonTypeName("signatory") @JsonPropertyOrder({"name", "role", "signature", "organization", "externalReference"}) @JsonDeserialize(using = SignatoryDeserializer.class) public class Signatory extends ExtensibleElement diff --git a/src/main/java/org/cyclonedx/model/formulation/common/AbstractType.java b/src/main/java/org/cyclonedx/model/formulation/common/AbstractType.java index d58eff4c7..8e2561898 100644 --- a/src/main/java/org/cyclonedx/model/formulation/common/AbstractType.java +++ b/src/main/java/org/cyclonedx/model/formulation/common/AbstractType.java @@ -44,7 +44,6 @@ public void setResource(final ResourceReferenceChoice resource) { this.resource = resource; } - @JacksonXmlElementWrapper(localName = "environmentVars") public EnvironmentVars getEnvironmentVars() { return environmentVars; diff --git a/src/main/java/org/cyclonedx/util/deserializer/AbstractDataTypeDeserializer.java b/src/main/java/org/cyclonedx/util/deserializer/AbstractDataTypeDeserializer.java index a653e55fc..8904500dc 100644 --- a/src/main/java/org/cyclonedx/util/deserializer/AbstractDataTypeDeserializer.java +++ b/src/main/java/org/cyclonedx/util/deserializer/AbstractDataTypeDeserializer.java @@ -70,7 +70,6 @@ protected void setSourceAndTarget(JsonNode node, AbstractType type) throws JsonP setReference(node, "target", type); } - protected void setProperties(JsonNode node, T type) throws JsonProcessingException { diff --git a/src/test/java/org/cyclonedx/BomJsonGeneratorTest.java b/src/test/java/org/cyclonedx/BomJsonGeneratorTest.java index f9e4c090a..09aea41ee 100644 --- a/src/test/java/org/cyclonedx/BomJsonGeneratorTest.java +++ b/src/test/java/org/cyclonedx/BomJsonGeneratorTest.java @@ -374,66 +374,6 @@ public void schema16_testFormulation() throws Exception { assertTrue(parser.isValid(loadedFile, version)); } - @Test - public void schema16_testExpressions() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonXmlBom("/1.6/valid-license-expression-1.6.xml"); - - BomJsonGenerator generator = BomGeneratorFactory.createJson(version, bom); - File loadedFile = writeToFile(generator.toJsonString()); - - JsonParser parser = new JsonParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testAttestations() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonXmlBom("/1.6/valid-attestation-1.6.xml"); - - BomJsonGenerator generator = BomGeneratorFactory.createJson(version, bom); - File loadedFile = writeToFile(generator.toJsonString()); - - JsonParser parser = new JsonParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testAttestations_json() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonJsonBom("/1.6/valid-attestation-1.6.json"); - - BomJsonGenerator generator = BomGeneratorFactory.createJson(version, bom); - File loadedFile = writeToFile(generator.toJsonString()); - - JsonParser parser = new JsonParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testCompositions() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonXmlBom("/1.6/valid-compositions-1.6.xml"); - - BomJsonGenerator generator = BomGeneratorFactory.createJson(version, bom); - File loadedFile = writeToFile(generator.toJsonString()); - - JsonParser parser = new JsonParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testVulnerabilities() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonXmlBom("/1.6/valid-vulnerability-1.6.xml"); - - BomJsonGenerator generator = BomGeneratorFactory.createJson(version, bom); - File loadedFile = writeToFile(generator.toJsonString()); - - JsonParser parser = new JsonParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - @Test public void schema16_testCrypto() throws Exception { Version version = Version.VERSION_16; diff --git a/src/test/java/org/cyclonedx/BomXmlGeneratorTest.java b/src/test/java/org/cyclonedx/BomXmlGeneratorTest.java index 6a93669cd..6f6c54b5a 100644 --- a/src/test/java/org/cyclonedx/BomXmlGeneratorTest.java +++ b/src/test/java/org/cyclonedx/BomXmlGeneratorTest.java @@ -492,54 +492,6 @@ public void schema16_testFormulation() throws Exception { assertTrue(parser.isValid(loadedFile, version)); } - @Test - public void schema16_testExpressions() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonJsonBom("/1.6/valid-license-expression-1.6.json"); - - BomXmlGenerator generator = BomGeneratorFactory.createXml(version, bom); - File loadedFile = writeToFile(generator.toXmlString()); - - XmlParser parser = new XmlParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testAttestations() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonJsonBom("/1.6/valid-attestation-1.6.json"); - - BomXmlGenerator generator = BomGeneratorFactory.createXml(version, bom); - File loadedFile = writeToFile(generator.toXmlString()); - - XmlParser parser = new XmlParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - @Test - public void schema16_testAttestations_xml() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonBomXml("/1.6/valid-attestation-1.6.xml"); - addSignature(bom); - - BomXmlGenerator generator = BomGeneratorFactory.createXml(version, bom); - File loadedFile = writeToFile(generator.toXmlString()); - - XmlParser parser = new XmlParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - - private void addSignature(Bom bom) { - List attributes = new ArrayList<>(); - attributes.add(new Attribute("xmlns", "http://www.w3.org/2000/09/xmldsig#")); - ExtensibleType signature = new ExtensibleType("ds", "Signature", attributes, ""); - bom.getDeclarations().getAffirmation().getSignatories().get(0).addExtensibleType(signature); - /* - - */ - } - - @Test public void schema16_testCompositions() throws Exception { Version version = Version.VERSION_16; @@ -552,18 +504,6 @@ public void schema16_testCompositions() throws Exception { assertTrue(parser.isValid(loadedFile, version)); } - @Test - public void schema16_testVulnerabilities() throws Exception { - Version version = Version.VERSION_16; - Bom bom = createCommonJsonBom("/1.6/valid-vulnerability-1.6.json"); - - BomXmlGenerator generator = BomGeneratorFactory.createXml(version, bom); - File loadedFile = writeToFile(generator.toXmlString()); - - XmlParser parser = new XmlParser(); - assertTrue(parser.isValid(loadedFile, version)); - } - @Test public void schema16_testCrypto() throws Exception { Version version = Version.VERSION_16;