@Test public void code_scan_triggers_codescan_strategy() { SerecoVulnerability vulnerability = TestSerecoVulnerabilityBuilder.builder(). name("name1"). codeScan(). location("location1"). source("source1"). relevantPart("relevant1"). callsCode(). callsCode(). callsCode(). location("location2"). source("source2"). relevantPart("relevant2"). end().build(); FalsePositiveMetaData metaData = fetchFirstEntryMetaDataOfExample3(); finderToTest.isFound(vulnerability, metaData); verify(codeSCanStrategy).isFalsePositive(vulnerability, metaData); }
public boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData) { if (! isVulnerabilityValid(vulnerability)) { return false; } if (! isMetaDataValid(metaData)) { return false; } switch (vulnerability.getScanType()) { case CODE_SCAN: return codeSCanStrategy.isFalsePositive(vulnerability, metaData); default: return false; } }
SerecoFalsePositiveFinder { public boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData) { if (! isVulnerabilityValid(vulnerability)) { return false; } if (! isMetaDataValid(metaData)) { return false; } switch (vulnerability.getScanType()) { case CODE_SCAN: return codeSCanStrategy.isFalsePositive(vulnerability, metaData); default: return false; } } }
SerecoFalsePositiveFinder { public boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData) { if (! isVulnerabilityValid(vulnerability)) { return false; } if (! isMetaDataValid(metaData)) { return false; } switch (vulnerability.getScanType()) { case CODE_SCAN: return codeSCanStrategy.isFalsePositive(vulnerability, metaData); default: return false; } }  }
SerecoFalsePositiveFinder { public boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData) { if (! isVulnerabilityValid(vulnerability)) { return false; } if (! isMetaDataValid(metaData)) { return false; } switch (vulnerability.getScanType()) { case CODE_SCAN: return codeSCanStrategy.isFalsePositive(vulnerability, metaData); default: return false; } }  boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData); }
SerecoFalsePositiveFinder { public boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData) { if (! isVulnerabilityValid(vulnerability)) { return false; } if (! isMetaDataValid(metaData)) { return false; } switch (vulnerability.getScanType()) { case CODE_SCAN: return codeSCanStrategy.isFalsePositive(vulnerability, metaData); default: return false; } }  boolean isFound(SerecoVulnerability vulnerability, FalsePositiveMetaData metaData);  }