VelocityEmailHelper implements EmailHelper { public String createSubject(Check check) { return "Seyren alert: " + check.getName(); } @Inject  VelocityEmailHelper(SeyrenConfig seyrenConfig); String createSubject(Check check); @Override String createBody(Check check, Subscription subscription, List<Alert> alerts);  }
@Test public void subjectIsCorrect() { Check check = new Check() .withId("123") .withEnabled(true) .withName("test-check") .withState(AlertType.ERROR); String subject = emailHelper.createSubject(check); assertThat(subject, is("Seyren alert: test-check")); }