use of com.synopsys.integration.blackduck.api.manual.temporary.component.NameValuePairView in project blackduck-common by blackducksoftware.
the class PolicyStatusDescription method populatePolicySeverityMap.
private void populatePolicySeverityMap() {
ProjectVersionPolicyStatusComponentVersionPolicyViolationDetailsView policyViolationDetails = policyStatusItem.getComponentVersionPolicyViolationDetails();
if (policyViolationDetails != null && ProjectVersionComponentPolicyStatusType.IN_VIOLATION.equals(policyStatusItem.getOverallStatus())) {
List<NameValuePairView> nameValuePairs = policyViolationDetails.getSeverityLevels();
if (nameValuePairs != null) {
for (NameValuePairView nameValuePairView : nameValuePairs) {
if (nameValuePairView.getName() != null) {
ComponentVersionPolicyViolationCount componentVersionPolicyViolationCount = new ComponentVersionPolicyViolationCount(nameValuePairView);
policySeverityCount.put(componentVersionPolicyViolationCount.name, componentVersionPolicyViolationCount);
}
}
}
}
}
use of com.synopsys.integration.blackduck.api.manual.temporary.component.NameValuePairView in project blackduck-common by blackducksoftware.
the class PolicyStatusDescription method populatePolicyStatusMap.
private void populatePolicyStatusMap() {
List<NameValuePairView> nameValuePairs = policyStatusItem.getComponentVersionStatusCounts();
if (nameValuePairs != null) {
for (NameValuePairView nameValuePairView : nameValuePairs) {
if (nameValuePairView.getName() != null) {
ComponentVersionStatusCount componentVersionStatusCount = new ComponentVersionStatusCount(nameValuePairView);
policyStatusCount.put(componentVersionStatusCount.name, componentVersionStatusCount);
}
}
}
}
use of com.synopsys.integration.blackduck.api.manual.temporary.component.NameValuePairView in project blackduck-common by blackducksoftware.
the class PolicyStatusDescriptionTest method createProjectVersionPolicyStatusView.
private ProjectVersionPolicyStatusView createProjectVersionPolicyStatusView() {
NameValuePairView blockerViolation = new NameValuePairView();
blockerViolation.setName(PolicyRuleSeverityType.BLOCKER.name());
blockerViolation.setValue(3);
NameValuePairView trivialViolation = new NameValuePairView();
trivialViolation.setName(PolicyRuleSeverityType.TRIVIAL.name());
trivialViolation.setValue(1);
List<NameValuePairView> violations = new ArrayList<>();
violations.add(blockerViolation);
violations.add(trivialViolation);
ProjectVersionPolicyStatusComponentVersionPolicyViolationDetailsView projectVersionPolicyStatusComponentVersionPolicyViolationDetailsView = new ProjectVersionPolicyStatusComponentVersionPolicyViolationDetailsView();
projectVersionPolicyStatusComponentVersionPolicyViolationDetailsView.setSeverityLevels(violations);
NameValuePairView inViolation = new NameValuePairView();
inViolation.setName(ProjectVersionComponentPolicyStatusType.IN_VIOLATION.name());
inViolation.setValue(4);
NameValuePairView notInViolation = new NameValuePairView();
notInViolation.setName(ProjectVersionComponentPolicyStatusType.NOT_IN_VIOLATION.name());
notInViolation.setValue(1);
List<NameValuePairView> statuses = new ArrayList<>();
statuses.add(inViolation);
statuses.add(notInViolation);
ProjectVersionPolicyStatusView policyStatusItem = new ProjectVersionPolicyStatusView();
policyStatusItem.setComponentVersionPolicyViolationDetails(projectVersionPolicyStatusComponentVersionPolicyViolationDetailsView);
policyStatusItem.setComponentVersionStatusCounts(statuses);
policyStatusItem.setOverallStatus(ProjectVersionComponentPolicyStatusType.IN_VIOLATION);
return policyStatusItem;
}
Aggregations