Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Alzate <[email protected]>
  • Loading branch information
mr-zepol committed Nov 21, 2024
1 parent a5ee68c commit 9494f3a
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public String toXmlString() throws GeneratorException {
*
* @return a String of the BoM
* @since 1.1.0
*
*/
@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cyclonedx/model/attestation/Claim.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public void setResource(final ResourceReferenceChoice resource) {
this.resource = resource;
}


@JacksonXmlElementWrapper(localName = "environmentVars")
public EnvironmentVars getEnvironmentVars() {
return environmentVars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
60 changes: 0 additions & 60 deletions src/test/java/org/cyclonedx/BomJsonGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
60 changes: 0 additions & 60 deletions src/test/java/org/cyclonedx/BomXmlGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Attribute> 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);
/* <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<!-- XML signature here -->
</ds:Signature>*/
}


@Test
public void schema16_testCompositions() throws Exception {
Version version = Version.VERSION_16;
Expand All @@ -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;
Expand Down

0 comments on commit 9494f3a

Please sign in to comment.