use of com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupChannel in project hub-alert by blackducksoftware.
the class DistributionChannelTest method receiveMessageCatchExceptionTest.
@Test
public void receiveMessageCatchExceptionTest() {
final Gson gson = new Gson();
final EmailGroupChannel channel = new EmailGroupChannel(null, gson, null, null, null, null);
channel.receiveMessage("garbage");
}
use of com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupChannel in project hub-alert by blackducksoftware.
the class DistributionChannelTest method setAuditEntrySuccessTest.
@Test
public void setAuditEntrySuccessTest() {
final AuditEntryRepositoryWrapper auditEntryRepository = Mockito.mock(AuditEntryRepositoryWrapper.class);
final EmailGroupChannel channel = new EmailGroupChannel(null, null, auditEntryRepository, null, null, null);
final AuditEntryEntity entity = new AuditEntryEntity(1L, new Date(System.currentTimeMillis() - 1000), new Date(System.currentTimeMillis()), StatusEnum.SUCCESS, null, null);
entity.setId(1L);
Mockito.when(auditEntryRepository.findOne(Mockito.anyLong())).thenReturn(entity);
Mockito.when(auditEntryRepository.save(entity)).thenReturn(entity);
channel.setAuditEntrySuccess(null);
channel.setAuditEntrySuccess(entity.getId());
}
use of com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupChannel in project hub-alert by blackducksoftware.
the class DistributionChannelTest method handleEventWrongTypeTest.
@Test
public void handleEventWrongTypeTest() {
final GlobalProperties globalProperties = new TestGlobalProperties();
final Gson gson = new Gson();
final CommonDistributionRepositoryWrapper commonRepositoryWrapper = Mockito.mock(CommonDistributionRepositoryWrapper.class);
final EmailGroupChannel channel = new EmailGroupChannel(globalProperties, gson, null, null, null, commonRepositoryWrapper);
final Long commonId = 1L;
final EmailGroupEvent event = new EmailGroupEvent(createProjectData("Distribution Channel Test"), commonId);
final CommonDistributionConfigEntity commonEntity = new CommonDistributionConfigEntity(commonId, SupportedChannels.SLACK, "Other Config", DigestTypeEnum.REAL_TIME, false);
Mockito.when(commonRepositoryWrapper.findOne(Mockito.anyLong())).thenReturn(commonEntity);
channel.handleEvent(event);
}
Aggregations