@Test public void templateLocationShouldBeConfigurable() { SeyrenConfig mockConfiguration = mock(SeyrenConfig.class); when(mockConfiguration.getEmailTemplateFileName()).thenReturn("test-email-template.vm"); when(mockConfiguration.getEmailSubjectTemplateFileName()).thenReturn("test-email-template.vm"); EmailHelper emailHelper = new VelocityEmailHelper(mockConfiguration); String body = emailHelper.createBody(null, null, null); assertThat(body, containsString("Test content.")); }
@Override public String createBody(Check check, Subscription subscription, List<Alert> alerts) { return evaluateTemplate(check, subscription, alerts, TEMPLATE_CONTENT); }
VelocityEmailHelper implements EmailHelper { @Override public String createBody(Check check, Subscription subscription, List<Alert> alerts) { return evaluateTemplate(check, subscription, alerts, TEMPLATE_CONTENT); } }
VelocityEmailHelper implements EmailHelper { @Override public String createBody(Check check, Subscription subscription, List<Alert> alerts) { return evaluateTemplate(check, subscription, alerts, TEMPLATE_CONTENT); } @Inject  VelocityEmailHelper(SeyrenConfig seyrenConfig); }
VelocityEmailHelper implements EmailHelper { @Override public String createBody(Check check, Subscription subscription, List<Alert> alerts) { return evaluateTemplate(check, subscription, alerts, TEMPLATE_CONTENT); } @Inject  VelocityEmailHelper(SeyrenConfig seyrenConfig); String createSubject(Check check, Subscription subscription, List<Alert> alerts); @Override String createBody(Check check, Subscription subscription, List<Alert> alerts); }
VelocityEmailHelper implements EmailHelper { @Override public String createBody(Check check, Subscription subscription, List<Alert> alerts) { return evaluateTemplate(check, subscription, alerts, TEMPLATE_CONTENT); } @Inject  VelocityEmailHelper(SeyrenConfig seyrenConfig); String createSubject(Check check, Subscription subscription, List<Alert> alerts); @Override String createBody(Check check, Subscription subscription, List<Alert> alerts);  }