use of com.thoughtworks.go.server.messaging.EmailNotificationTopic in project gocd by gocd.
the class UniqueEmailSenderTest method shouldSendEmailIfNotEnoughSpaceForFirstTime.
@Test
public void shouldSendEmailIfNotEnoughSpaceForFirstTime() {
ClassMockery mockery = new ClassMockery();
final EmailNotificationTopic topic = mockery.mock(EmailNotificationTopic.class);
final SendEmailMessage message = new SendEmailMessage("pavan", "hu kai", "someone");
mockery.checking(new Expectations() {
{
one(topic).post(message);
}
});
EmailSender sender = new AsynchronousEmailSender(topic);
sender.sendEmail(message);
}
use of com.thoughtworks.go.server.messaging.EmailNotificationTopic in project gocd by gocd.
the class UniqueEmailSenderTest method shouldBeAbleToSend2Emails.
@Test
public void shouldBeAbleToSend2Emails() {
ClassMockery mockery = new ClassMockery();
final EmailNotificationTopic topic = mockery.mock(EmailNotificationTopic.class);
final SendEmailMessage message = new SendEmailMessage("pavan", "hu kai", "someone");
mockery.checking(new Expectations() {
{
exactly(2).of(topic).post(message);
}
});
EmailSender sender = new AsynchronousEmailSender(topic);
sender.sendEmail(message);
sender.sendEmail(message);
}
Aggregations