assertThat(email.toSimpleMail().getSubject(), equalTo(DEFAULT_SUBJECT));
}
@Test
public void should_use_provided_subject_if_exists_in_environment() throws IOException, EmailException {
DefaultEnvironment env = new DefaultEnvironment(TEST);
ErrorMailFactory factory = new ErrorMailFactory(request, env);
ErrorMail email = factory.build();
String pattern = forPattern(env.get(ERROR_DATE_PATTERN)).print(DateTime.now());
assertThat(email.toSimpleMail().getSubject(), equalTo("Error at 'cat' project" + " - " + pattern));
}