use of com.thoughtworks.go.server.messaging.StageResultMessage in project gocd by gocd.
the class StageNotificationServiceIntegrationTest method shouldSendEmailWithCancelledInfo.
@Test
public void shouldSendEmailWithCancelledInfo() throws SQLException {
String jezMail = prepareOneMatchedUser();
Pipeline pipeline = pipelineFixture.createPipelineWithFirstStagePassedAndSecondStageRunning();
Stage ftStage = mockStageServiceWithStage(pipeline);
stageNotificationListener.onMessage(new StageResultMessage(ftStage.getIdentifier(), StageEvent.Passes, new Username(new CaseInsensitiveString("chris"))));
assertThat(inMemoryEmailNotificationTopic.getBody(jezMail), containsString("The stage was cancelled by chris."));
}
use of com.thoughtworks.go.server.messaging.StageResultMessage in project gocd by gocd.
the class StageNotificationServiceIntegrationTest method shouldSendEmailWhenStageBreaks.
@Test
public void shouldSendEmailWhenStageBreaks() throws SQLException {
String jezMail = prepareOneMatchedUser(StageEvent.Breaks);
Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
Stage ftStage = mockStageServiceWithStage(pipeline);
stageNotificationListener.onMessage(new StageResultMessage(ftStage.getIdentifier(), StageEvent.Breaks, Username.BLANK));
String subject = "Stage [" + ftStage.getIdentifier().stageLocator() + "]" + " is broken";
assertThat(inMemoryEmailNotificationTopic.getSubject(jezMail), is(subject));
assertThat(inMemoryEmailNotificationTopic.getBody(jezMail), containsString("Sent by Go on behalf of jez"));
}
Aggregations