use of com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel in project hub-alert by blackducksoftware.
the class DefaultDistributionAccessorTestIT method createAndSave6JobAndAudit.
private Map<UUID, Pair<DistributionJobModel, List<AuditEntryEntity>>> createAndSave6JobAndAudit() {
DistributionJobRequestModel firstJob = createSlackJob(true);
DistributionJobRequestModel secondJob = createSlackJob(false);
DistributionJobRequestModel thirdJob = createSlackJob(true);
DistributionJobRequestModel fourthJob = createSlackJob(false);
DistributionJobRequestModel fifthJob = createMSTeamsJob(true);
DistributionJobRequestModel sixthJob = createMSTeamsJob(false);
DistributionJobModel firstJobSaved = jobAccessor.createJob(firstJob);
DistributionJobModel secondJobSaved = jobAccessor.createJob(secondJob);
DistributionJobModel thirdJobSaved = jobAccessor.createJob(thirdJob);
DistributionJobModel fourthJobSaved = jobAccessor.createJob(fourthJob);
DistributionJobModel fifthJobSaved = jobAccessor.createJob(fifthJob);
DistributionJobModel sixthJobSaved = jobAccessor.createJob(sixthJob);
createdJobs.add(firstJobSaved.getJobId());
createdJobs.add(secondJobSaved.getJobId());
createdJobs.add(thirdJobSaved.getJobId());
createdJobs.add(fourthJobSaved.getJobId());
createdJobs.add(fifthJobSaved.getJobId());
createdJobs.add(sixthJobSaved.getJobId());
AuditEntryEntity firstAudit = createAuditEntryEntity(firstJobSaved.getJobId(), OffsetDateTime.now(), AuditEntryStatus.SUCCESS);
AuditEntryEntity secondAudit = createAuditEntryEntity(firstJobSaved.getJobId(), OffsetDateTime.now().minusDays(1), AuditEntryStatus.PENDING);
AuditEntryEntity thirdAudit = createAuditEntryEntity(secondJobSaved.getJobId(), OffsetDateTime.now().minusMinutes(1), AuditEntryStatus.FAILURE);
AuditEntryEntity fourthAudit = createAuditEntryEntity(fourthJobSaved.getJobId(), OffsetDateTime.now().minusHours(1), AuditEntryStatus.SUCCESS);
AuditEntryEntity fifthAudit = createAuditEntryEntity(fifthJobSaved.getJobId(), OffsetDateTime.now().minusHours(2), AuditEntryStatus.SUCCESS);
AuditEntryEntity sixthAudit = createAuditEntryEntity(fifthJobSaved.getJobId(), OffsetDateTime.now().minusMinutes(2), AuditEntryStatus.FAILURE);
AuditEntryEntity seventhAudit = createAuditEntryEntity(sixthJobSaved.getJobId(), null, AuditEntryStatus.SUCCESS);
AuditEntryEntity eighthAudit = createAuditEntryEntity(sixthJobSaved.getJobId(), OffsetDateTime.now(), AuditEntryStatus.FAILURE);
AuditEntryEntity ninthAudit = createAuditEntryEntity(sixthJobSaved.getJobId(), null, AuditEntryStatus.PENDING);
saveAllAudits(List.of(firstAudit, secondAudit, thirdAudit, fourthAudit, fifthAudit, sixthAudit, seventhAudit, eighthAudit, ninthAudit));
return Map.of(firstJobSaved.getJobId(), Pair.of(firstJobSaved, List.of(firstAudit, secondAudit)), secondJobSaved.getJobId(), Pair.of(secondJobSaved, List.of(thirdAudit)), thirdJobSaved.getJobId(), Pair.of(thirdJobSaved, List.of()), fourthJobSaved.getJobId(), Pair.of(fourthJobSaved, List.of(fourthAudit)), fifthJobSaved.getJobId(), Pair.of(fifthJobSaved, List.of(fifthAudit, sixthAudit)), sixthJobSaved.getJobId(), Pair.of(sixthJobSaved, List.of(seventhAudit, eighthAudit, ninthAudit)));
}
use of com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel in project hub-alert by blackducksoftware.
the class StaticJobAccessorTestIT method verifyJiraCloudSavesTest.
@Test
public void verifyJiraCloudSavesTest() {
JiraCloudJobDetailsModel jiraCloudJobDetailsModel = new JiraCloudJobDetailsModel(UUID.randomUUID(), true, "issueCreatorEmail", "projectNameOrKey", "issueType", "resolveTransition", "reopenTransition", List.of(), "issueSummary");
DistributionJobRequestModel jobRequestModel = createJobRequestModel(jiraCloudJobDetailsModel, new JiraServerChannelKey());
createAndAssertJob(jobRequestModel);
}
use of com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel in project hub-alert by blackducksoftware.
the class StaticJobAccessorTestIT method verifySlackSavesTest.
@Test
public void verifySlackSavesTest() {
SlackJobDetailsModel slackJobDetailsModel = new SlackJobDetailsModel(UUID.randomUUID(), "webhook", "channelName", "channelUsername");
DistributionJobRequestModel jobRequestModel = createJobRequestModel(slackJobDetailsModel, new SlackChannelKey());
createAndAssertJob(jobRequestModel);
}
use of com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel in project hub-alert by blackducksoftware.
the class StaticJobAccessorTestIT method verifyAzureSavesTest.
@Test
@Transactional
public void verifyAzureSavesTest() {
AzureBoardsJobDetailsModel azureBoardsJobDetailsModel = new AzureBoardsJobDetailsModel(UUID.randomUUID(), true, "projectNameOrId", "workItemType", "workItemCompletedState", "workItemReopenState");
DistributionJobRequestModel jobRequestModel = createJobRequestModel(azureBoardsJobDetailsModel, new AzureBoardsChannelKey());
createAndAssertJob(jobRequestModel);
}
use of com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel in project hub-alert by blackducksoftware.
the class StaticJobAccessorTestIT method verifyJiraServerSavesTest.
@Test
public void verifyJiraServerSavesTest() {
JiraServerJobDetailsModel jiraServerJobDetailsModel = new JiraServerJobDetailsModel(UUID.randomUUID(), true, "issueCreatorUsername", "projectNameOrKey", "issueType", "resolveTransition", "reopenTransition", List.of(), "issueSummary");
DistributionJobRequestModel jobRequestModel = createJobRequestModel(jiraServerJobDetailsModel, new JiraServerChannelKey());
createAndAssertJob(jobRequestModel);
}
Aggregations