use of com.blackducksoftware.integration.hub.api.response.VulnerabilitySourceQualifiedId in project hub-alert by blackducksoftware.
the class VulnerabilityProcessorTest method testProcess.
@Test
public void testProcess() throws URISyntaxException, HubIntegrationException {
final MapProcessorCache cache = new MapProcessorCache();
final VulnerabilityProcessor vulnProcessor = new VulnerabilityProcessor(cache, new TestLogger());
final Date createdAt = new Date();
final ProjectVersionModel projectVersionModel = new ProjectVersionModel();
projectVersionModel.setProjectLink("New project link");
final String componentName = "notification test";
final ComponentVersionView componentVersionView = new ComponentVersionView();
final String componentVersionUrl = "sss";
final String componentIssueUrl = "ddd";
final List<VulnerabilitySourceQualifiedId> addedVulns = Lists.newArrayList();
final List<VulnerabilitySourceQualifiedId> updatedVulns = Lists.newArrayList();
final List<VulnerabilitySourceQualifiedId> deletedVulns = Lists.newArrayList();
final VulnerabilityContentItem emptyVulnerabilityContentItem = new VulnerabilityContentItem(createdAt, projectVersionModel, componentName, componentVersionView, componentVersionUrl, addedVulns, updatedVulns, deletedVulns, componentIssueUrl);
vulnProcessor.process(emptyVulnerabilityContentItem);
assertTrue(cache.getEvents().size() == 0);
final VulnerabilitySourceQualifiedId addedQualifiedId = new VulnerabilitySourceQualifiedId();
final VulnerabilitySourceQualifiedId removedQualifiedId = new VulnerabilitySourceQualifiedId();
addedVulns.add(addedQualifiedId);
updatedVulns.add(addedQualifiedId);
deletedVulns.add(removedQualifiedId);
final VulnerabilityContentItem filledAndEmptiedVulnerabilityContentItem = new VulnerabilityContentItem(createdAt, projectVersionModel, componentName, componentVersionView, componentVersionUrl, addedVulns, updatedVulns, deletedVulns, componentIssueUrl);
vulnProcessor.process(filledAndEmptiedVulnerabilityContentItem);
assertTrue(cache.getEvents().size() == 0);
}
Aggregations