@Test void testMessageOptionsCustomPlaceholderWithCustomBodyHtml() throws Exception { EmailServiceFactory serviceFactory = FACTORY.build(new File(Resources.getResource( "fixtures/configuration/email/message-options/placeholder-body-html.yaml").toURI())); MessageOptions expected = new MessageOptions( "Test Subject", "bodyHtml", "bodyText", "TEST-PLACEHOLDER", "CODEGEN-URL", "successHtml"); assertEquals(expected, serviceFactory.getMessageOptions("bodyHtml", "bodyText", "successHtml")); }
public MessageOptions getMessageOptions() { if (messageOptionsConfiguration == null) { return getMessageOptions( readFileAsResources(DEFAULT_BODY_HTML_FILE), readFileAsResources(DEFAULT_BODY_TEXT_FILE), readFileAsResources(DEFAULT_SUCCESS_HTML_FILE)); } return getMessageOptions( getFileContents( messageOptionsConfiguration.getBodyHtmlFilePath(), DEFAULT_BODY_HTML_FILE), getFileContents( messageOptionsConfiguration.getBodyTextFilePath(), DEFAULT_BODY_TEXT_FILE), getFileContents( messageOptionsConfiguration.getSuccessHtmlFilePath(), DEFAULT_SUCCESS_HTML_FILE)); }
EmailServiceFactory implements Discoverable { public MessageOptions getMessageOptions() { if (messageOptionsConfiguration == null) { return getMessageOptions( readFileAsResources(DEFAULT_BODY_HTML_FILE), readFileAsResources(DEFAULT_BODY_TEXT_FILE), readFileAsResources(DEFAULT_SUCCESS_HTML_FILE)); } return getMessageOptions( getFileContents( messageOptionsConfiguration.getBodyHtmlFilePath(), DEFAULT_BODY_HTML_FILE), getFileContents( messageOptionsConfiguration.getBodyTextFilePath(), DEFAULT_BODY_TEXT_FILE), getFileContents( messageOptionsConfiguration.getSuccessHtmlFilePath(), DEFAULT_SUCCESS_HTML_FILE)); } }
EmailServiceFactory implements Discoverable { public MessageOptions getMessageOptions() { if (messageOptionsConfiguration == null) { return getMessageOptions( readFileAsResources(DEFAULT_BODY_HTML_FILE), readFileAsResources(DEFAULT_BODY_TEXT_FILE), readFileAsResources(DEFAULT_SUCCESS_HTML_FILE)); } return getMessageOptions( getFileContents( messageOptionsConfiguration.getBodyHtmlFilePath(), DEFAULT_BODY_HTML_FILE), getFileContents( messageOptionsConfiguration.getBodyTextFilePath(), DEFAULT_BODY_TEXT_FILE), getFileContents( messageOptionsConfiguration.getSuccessHtmlFilePath(), DEFAULT_SUCCESS_HTML_FILE)); }  }
EmailServiceFactory implements Discoverable { public MessageOptions getMessageOptions() { if (messageOptionsConfiguration == null) { return getMessageOptions( readFileAsResources(DEFAULT_BODY_HTML_FILE), readFileAsResources(DEFAULT_BODY_TEXT_FILE), readFileAsResources(DEFAULT_SUCCESS_HTML_FILE)); } return getMessageOptions( getFileContents( messageOptionsConfiguration.getBodyHtmlFilePath(), DEFAULT_BODY_HTML_FILE), getFileContents( messageOptionsConfiguration.getBodyTextFilePath(), DEFAULT_BODY_TEXT_FILE), getFileContents( messageOptionsConfiguration.getSuccessHtmlFilePath(), DEFAULT_SUCCESS_HTML_FILE)); }  @JsonGetter("messageOptions") MessageOptionsConfiguration getMessageOptionsConfiguration(); String getFromAddress(); Boolean isEnabled(); abstract EmailService createEmailService(MetricRegistry metrics); abstract EmailHealthCheck createHealthCheck(); MessageOptions getMessageOptions(); }
EmailServiceFactory implements Discoverable { public MessageOptions getMessageOptions() { if (messageOptionsConfiguration == null) { return getMessageOptions( readFileAsResources(DEFAULT_BODY_HTML_FILE), readFileAsResources(DEFAULT_BODY_TEXT_FILE), readFileAsResources(DEFAULT_SUCCESS_HTML_FILE)); } return getMessageOptions( getFileContents( messageOptionsConfiguration.getBodyHtmlFilePath(), DEFAULT_BODY_HTML_FILE), getFileContents( messageOptionsConfiguration.getBodyTextFilePath(), DEFAULT_BODY_TEXT_FILE), getFileContents( messageOptionsConfiguration.getSuccessHtmlFilePath(), DEFAULT_SUCCESS_HTML_FILE)); }  @JsonGetter("messageOptions") MessageOptionsConfiguration getMessageOptionsConfiguration(); String getFromAddress(); Boolean isEnabled(); abstract EmailService createEmailService(MetricRegistry metrics); abstract EmailHealthCheck createHealthCheck(); MessageOptions getMessageOptions();  }