Search in sources :

Example 26 with ProviderDetails

use of com.synopsys.integration.alert.processor.api.extract.model.ProviderDetails in project hub-alert by blackducksoftware.

the class ProjectMessageTest method combineMessageReasonsDontMatchTest.

@Test
public void combineMessageReasonsDontMatchTest() {
    LinkableItem provider = new LinkableItem("Provider", "Provider Config Name");
    ProviderDetails providerDetails = new ProviderDetails(1L, provider);
    LinkableItem commonProject = new LinkableItem("Project", "Common Project");
    ProjectOperation commonOperation = ProjectOperation.CREATE;
    ProjectMessage projectMessage1 = ProjectMessage.projectStatusInfo(providerDetails, commonProject, commonOperation);
    LinkableItem projectVersion = new LinkableItem("Project Version", "1.2.3");
    ProjectMessage projectMessage2 = ProjectMessage.projectVersionStatusInfo(providerDetails, commonProject, projectVersion, commonOperation);
    assertNotCombined(projectMessage1, projectMessage2);
}
Also used : LinkableItem(com.synopsys.integration.alert.common.message.model.LinkableItem) ProviderDetails(com.synopsys.integration.alert.processor.api.extract.model.ProviderDetails) Test(org.junit.jupiter.api.Test)

Example 27 with ProviderDetails

use of com.synopsys.integration.alert.processor.api.extract.model.ProviderDetails in project hub-alert by blackducksoftware.

the class NotificationRemovalTest method createABatchOfNotifications.

private void createABatchOfNotifications(ConfigurationModel providerConfig, OffsetDateTime notificationCreationTime, boolean batchOfProcessedNotifications) {
    int count = BATCH_SIZE;
    List<AlertNotificationModel> notifications = new ArrayList<>(BATCH_SIZE);
    ProviderDetails providerDetails = new ProviderDetails(providerConfig.getConfigurationId(), new LinkableItem("Black Duck", "bd-server", BLACKDUCK_PROVIDER_URL));
    for (int index = 0; index < count; index++) {
        RuleViolationNotificationView ruleViolationNotificationView = createRuleViolationNotificationView(PROJECT_NAME);
        String notificationContentString = GSON.toJson(ruleViolationNotificationView);
        notifications.add(createNotification(providerDetails, NotificationType.RULE_VIOLATION.name(), notificationContentString, notificationCreationTime, batchOfProcessedNotifications));
    }
    notifications = notificationAccessor.saveAllNotifications(notifications);
    createAuditEntries(notifications);
}
Also used : AlertNotificationModel(com.synopsys.integration.alert.common.rest.model.AlertNotificationModel) LinkableItem(com.synopsys.integration.alert.common.message.model.LinkableItem) ArrayList(java.util.ArrayList) ProviderDetails(com.synopsys.integration.alert.processor.api.extract.model.ProviderDetails) RuleViolationNotificationView(com.synopsys.integration.blackduck.api.manual.view.RuleViolationNotificationView)

Aggregations

ProviderDetails (com.synopsys.integration.alert.processor.api.extract.model.ProviderDetails)27 LinkableItem (com.synopsys.integration.alert.common.message.model.LinkableItem)25 Test (org.junit.jupiter.api.Test)13 ProviderMessageHolder (com.synopsys.integration.alert.processor.api.extract.model.ProviderMessageHolder)8 SimpleMessage (com.synopsys.integration.alert.processor.api.extract.model.SimpleMessage)7 IssueBomComponentDetails (com.synopsys.integration.alert.api.channel.issue.model.IssueBomComponentDetails)5 ProjectIssueModel (com.synopsys.integration.alert.api.channel.issue.model.ProjectIssueModel)5 AlertNotificationModel (com.synopsys.integration.alert.common.rest.model.AlertNotificationModel)5 ProjectMessage (com.synopsys.integration.alert.processor.api.extract.model.project.ProjectMessage)5 ProjectOperation (com.synopsys.integration.alert.processor.api.extract.model.project.ProjectOperation)4 AlertConfigurationException (com.synopsys.integration.alert.api.common.model.exception.AlertConfigurationException)3 WorkItemElementOperationModel (com.synopsys.integration.azure.boards.common.service.workitem.request.WorkItemElementOperationModel)3 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)3 MockChannelMessageFormatter (com.synopsys.integration.alert.api.channel.convert.mock.MockChannelMessageFormatter)2 IssuePolicyDetails (com.synopsys.integration.alert.api.channel.issue.model.IssuePolicyDetails)2 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 IssueVulnerabilityDetails (com.synopsys.integration.alert.api.channel.issue.model.IssueVulnerabilityDetails)1 AlertRuntimeException (com.synopsys.integration.alert.api.common.model.exception.AlertRuntimeException)1 IssueTrackerCallbackInfo (com.synopsys.integration.alert.common.channel.issuetracker.message.IssueTrackerCallbackInfo)1