use of com.synopsys.integration.alert.common.persistence.accessor.SlackJobDetailsAccessor in project hub-alert by blackducksoftware.
the class SlackDistributionEventHandlerTest method init.
@BeforeEach
public void init() throws IOException {
MarkupEncoderUtil markupEncoderUtil = new MarkupEncoderUtil();
SlackChannelMessageFormatter slackChannelMessageFormatter = new SlackChannelMessageFormatter(markupEncoderUtil);
SlackChannelMessageConverter slackChannelMessageConverter = new SlackChannelMessageConverter(slackChannelMessageFormatter);
SlackChannelMessageSender slackChannelMessageSender = new SlackChannelMessageSender(ChannelKeys.SLACK, createConnectionFactory());
SlackChannel slackChannel = new SlackChannel(slackChannelMessageConverter, slackChannelMessageSender);
mockSlackServer.start();
String url = mockSlackServer.url("/").toString();
SlackJobDetailsModel slackJobDetailsModel = new SlackJobDetailsModel(null, url, "channelName", "userName");
SlackJobDetailsAccessor slackJobDetailsAccessor = jobId -> Optional.of(slackJobDetailsModel);
distributionEventHandler = new SlackDistributionEventHandler(slackChannel, slackJobDetailsAccessor, processingAuditAccessor);
}
Aggregations