use of com.synopsys.integration.alert.provider.blackduck.processor.model.BomEditWithProjectNameNotificationContent in project hub-alert by blackducksoftware.
the class BomEditNotificationMessageExtractorTest method createBomEditWithProjectNameNotificationContent.
private BomEditWithProjectNameNotificationContent createBomEditWithProjectNameNotificationContent() {
BomEditNotificationContent bomEditNotificationContent = new BomEditNotificationContent();
bomEditNotificationContent.setProjectVersion(PROJECT_VERSION_ITEM.getValue());
bomEditNotificationContent.setBomComponent("http://bomComponentUrl");
bomEditNotificationContent.setComponentName(COMPONENT.getValue());
bomEditNotificationContent.setComponentVersionName(COMPONENT_VERSION.getValue());
return new BomEditWithProjectNameNotificationContent(bomEditNotificationContent, PROJECT_ITEM.getLabel(), PROJECT_VERSION_ITEM.getLabel());
}
use of com.synopsys.integration.alert.provider.blackduck.processor.model.BomEditWithProjectNameNotificationContent in project hub-alert by blackducksoftware.
the class BomEditNotificationDetailExtractor method extractDetailedContent.
@Override
public List<DetailedNotificationContent> extractDetailedContent(AlertNotificationModel alertNotificationModel, BomEditNotificationView notificationView) {
BomEditNotificationContent notificationContent = notificationView.getContent();
Optional<ProjectVersionWrapper> optionalProjectAndVersion = retrieveProjectAndVersion(alertNotificationModel.getProviderConfigId(), notificationContent.getProjectVersion());
if (optionalProjectAndVersion.isPresent()) {
ProjectVersionWrapper projectAndVersion = optionalProjectAndVersion.get();
ProjectView project = projectAndVersion.getProjectView();
ProjectVersionView projectVersion = projectAndVersion.getProjectVersionView();
String projectName = project.getName();
BomEditWithProjectNameNotificationContent updatedNotificationContent = new BomEditWithProjectNameNotificationContent(notificationContent, projectName, projectVersion.getVersionName());
DetailedNotificationContent detailedContent = DetailedNotificationContent.project(alertNotificationModel, updatedNotificationContent, projectName, projectVersion.getVersionName());
return List.of(detailedContent);
}
return List.of();
}
Aggregations