use of com.synopsys.integration.alert.common.persistence.model.job.details.DistributionJobDetailsModel in project hub-alert by blackducksoftware.
the class IssueTrackerChannelTest method distributeMessagesTest.
@Test
public void distributeMessagesTest() throws AlertException {
IssueTrackerModelExtractor<String> modelExtractor = new IssueTrackerModelExtractor<>(createFormatter(), null);
IssueTrackerMessageSender<String> messageSender = createMessageSender();
IssueTrackerProcessor<String> processor = new IssueTrackerProcessor<>(modelExtractor, messageSender);
IssueTrackerProcessorFactory<DistributionJobDetailsModel, String> processorFactory = x -> processor;
IssueTrackerResponsePostProcessor postProcessor = new IssueTrackerResponsePostProcessor() {
@Override
public <T extends Serializable> void postProcess(IssueTrackerResponse<T> response) {
}
};
IssueTrackerChannel<DistributionJobDetailsModel, String> issueTrackerChannel = new IssueTrackerChannel<>(processorFactory, postProcessor) {
};
MessageResult testResult = issueTrackerChannel.distributeMessages(null, ProviderMessageHolder.empty(), null);
IssueTrackerResponse<?> processorResponse = processor.processMessages(ProviderMessageHolder.empty(), "jobName");
assertEquals(processorResponse.getStatusMessage(), testResult.getStatusMessage());
}
Aggregations