use of com.mercedesbenz.sechub.sereco.ImportParameter in project sechub by mercedes-benz.
the class CheckmarxV1XMLImporterTest method emptyXMLcanNotBeImported.
@Test
public void emptyXMLcanNotBeImported() {
/* prepare */
String xml = "<?xml version='1.0'?>";
ImportParameter param = ImportParameter.builder().importData(xml).importId("id1").productId("Checkmarx").build();
/* execute */
ProductImportAbility ableToImport = importerToTest.isAbleToImportForProduct(param);
/* test */
assertEquals("Was able to import xml!", ProductImportAbility.NOT_ABLE_TO_IMPORT, ableToImport);
}
use of com.mercedesbenz.sechub.sereco.ImportParameter in project sechub by mercedes-benz.
the class CheckmarxV1XMLImporterTest method xmlReportFromCheckmarxV8canBeImported.
@Test
public void xmlReportFromCheckmarxV8canBeImported() {
/* prepare */
String xml = SerecoTestFileSupport.INSTANCE.loadTestFile("checkmarx/sechub-continous-integration.xml");
ImportParameter param = ImportParameter.builder().importData(xml).importId("id1").productId("Checkmarx").build();
/* execute */
ProductImportAbility ableToImport = importerToTest.isAbleToImportForProduct(param);
/* test */
assertEquals("Was NOT able to import xml!", ProductImportAbility.ABLE_TO_IMPORT, ableToImport);
}
use of com.mercedesbenz.sechub.sereco.ImportParameter in project sechub by mercedes-benz.
the class NetsparkerV1XMLImporterTest method xmlReportFromNetsparkerCanBeImported.
@Test
public void xmlReportFromNetsparkerCanBeImported() {
/* prepare */
String xml = SerecoTestFileSupport.INSTANCE.loadTestFile("netsparker/netsparker_v1.0.40.109_scan_result_output_vulnerabilities.xml");
ImportParameter param = ImportParameter.builder().importData(xml).importId("id1").productId("Netsparker").build();
/* execute */
ProductImportAbility ableToImport = importerToTest.isAbleToImportForProduct(param);
/* test */
assertEquals("Was not able to import xml!", ProductImportAbility.ABLE_TO_IMPORT, ableToImport);
}
use of com.mercedesbenz.sechub.sereco.ImportParameter in project sechub by mercedes-benz.
the class ProductFailureMetaDataBuilderTest method creates_a_meta_model_with_product_information_nothing_set_will_at_least_work.
@Test
public void creates_a_meta_model_with_product_information_nothing_set_will_at_least_work() {
/* prepare */
ImportParameter param = ImportParameter.builder().build();
/* execute */
SerecoMetaData result = builderToTest.forParam(param).build();
/* test */
assertNotNull(result);
List<SerecoVulnerability> vulnerabilities = result.getVulnerabilities();
assertNotNull(vulnerabilities);
assertEquals(1, vulnerabilities.size());
SerecoVulnerability v = vulnerabilities.iterator().next();
assertEquals(SerecoSeverity.CRITICAL, v.getSeverity());
assertEquals("SecHub failure", v.getType());
assertEquals("Security product 'null' failed, so cannot give a correct answer.", v.getDescription());
}
use of com.mercedesbenz.sechub.sereco.ImportParameter in project sechub by mercedes-benz.
the class ProductFailureMetaDataBuilderTest method creates_a_meta_model_with_product_information.
@Test
public void creates_a_meta_model_with_product_information() {
/* prepare */
ImportParameter param = ImportParameter.builder().importId("id1").productId("productId").build();
/* execute */
SerecoMetaData result = builderToTest.forParam(param).build();
/* test */
assertNotNull(result);
List<SerecoVulnerability> vulnerabilities = result.getVulnerabilities();
assertNotNull(vulnerabilities);
assertEquals(1, vulnerabilities.size());
SerecoVulnerability v = vulnerabilities.iterator().next();
assertEquals(SerecoSeverity.CRITICAL, v.getSeverity());
assertEquals("SecHub failure", v.getType());
assertEquals("Security product 'productId' failed, so cannot give a correct answer.", v.getDescription());
}
Aggregations