use of com.synopsys.integration.alert.processor.api.extract.model.project.ProjectOperation in project hub-alert by blackducksoftware.
the class ProviderMessageDistributorTest method createProcessedProviderMessageHolder.
private ProcessedProviderMessageHolder createProcessedProviderMessageHolder(int numberOfProjectMessages, int numberOfSimpleMessages) {
List<ProcessedProviderMessage<ProjectMessage>> processedProjectMessages = new ArrayList<>();
List<ProcessedProviderMessage<SimpleMessage>> processedSimpleMessages = new ArrayList<>();
LinkableItem commonProject = new LinkableItem("Project", "Common Project");
ProjectOperation commonOperation = ProjectOperation.CREATE;
for (long i = 1; i < numberOfProjectMessages + 1; i++) {
LinkableItem provider = new LinkableItem("Provider", "Provider " + i);
ProviderDetails providerDetails = new ProviderDetails(i, provider);
ProjectMessage projectMessage = ProjectMessage.projectStatusInfo(providerDetails, commonProject, commonOperation);
ProcessedProviderMessage<ProjectMessage> processedProviderMessage = ProcessedProviderMessage.singleSource(i, projectMessage);
processedProjectMessages.add(processedProviderMessage);
}
for (long i = 1; i < numberOfSimpleMessages + 1; i++) {
LinkableItem provider = new LinkableItem("Details", "Detail " + i);
ProviderDetails providerDetails = new ProviderDetails(i, provider);
SimpleMessage simpleMessage = SimpleMessage.original(providerDetails, "Summary " + i, "Description " + i, List.of(commonProject));
ProcessedProviderMessage<SimpleMessage> processedSimpleMessage = ProcessedProviderMessage.singleSource(i, simpleMessage);
processedSimpleMessages.add(processedSimpleMessage);
}
return new ProcessedProviderMessageHolder(processedProjectMessages, processedSimpleMessages);
}
use of com.synopsys.integration.alert.processor.api.extract.model.project.ProjectOperation in project hub-alert by blackducksoftware.
the class ProcessedProviderMessageTest method combineProjectOperationsMatchTest.
@Test
public void combineProjectOperationsMatchTest() {
LinkableItem provider = new LinkableItem("Provider", "Provider Config Name");
ProviderDetails providerDetails = new ProviderDetails(1L, provider);
LinkableItem commonProject = new LinkableItem("Project", "Project 1");
ProjectOperation commonOperation = ProjectOperation.CREATE;
ProjectMessage projectMessage1 = ProjectMessage.projectStatusInfo(providerDetails, commonProject, commonOperation);
ProjectMessage projectMessage2 = ProjectMessage.projectStatusInfo(providerDetails, commonProject, commonOperation);
ProcessedProviderMessage<ProjectMessage> processedProviderMessage1 = ProcessedProviderMessage.singleSource(10L, projectMessage1);
ProcessedProviderMessage<ProjectMessage> processedProviderMessage2 = ProcessedProviderMessage.singleSource(20L, projectMessage2);
assertCombined(processedProviderMessage1, processedProviderMessage2);
}
Aggregations