Search in sources :

Example 1 with OverridableFile

use of edu.stanford.bmir.protege.web.server.inject.OverridableFile in project webprotege by protegeproject.

the class PasswordResetMailer_IT method setUp.

@Before
public void setUp() throws Exception {
    when(placeUrl.getApplicationUrl()).thenReturn(applicationUrl);
    when(appNameProvider.get()).thenReturn(theAppName);
    OverridableFile overridableFile = new OverridableFile(TEMPLATE_PATH, new File("/tmp/data"));
    FileContents templateFile = new FileContents(overridableFile);
    TemplateEngine templateEngine = new TemplateEngine(DefaultMustacheFactory::new);
    ResetPasswordMailer mailer = new ResetPasswordMailer(sendMailImpl, templateEngine, templateFile, placeUrl, appNameProvider);
    mailer.sendEmail(userId, emailAddress, theNewPassword, e -> {
    });
    verify(sendMailImpl, times(1)).sendMail(eq(singletonList(emailAddress)), eq("Your password has been reset"), bodyCaptor.capture(), any(MessagingExceptionHandler.class));
}
Also used : TemplateEngine(edu.stanford.bmir.protege.web.server.templates.TemplateEngine) FileContents(edu.stanford.bmir.protege.web.server.filemanager.FileContents) DefaultMustacheFactory(com.github.mustachejava.DefaultMustacheFactory) MessagingExceptionHandler(edu.stanford.bmir.protege.web.server.mail.MessagingExceptionHandler) File(java.io.File) OverridableFile(edu.stanford.bmir.protege.web.server.inject.OverridableFile) OverridableFile(edu.stanford.bmir.protege.web.server.inject.OverridableFile) Before(org.junit.Before)

Aggregations

DefaultMustacheFactory (com.github.mustachejava.DefaultMustacheFactory)1 FileContents (edu.stanford.bmir.protege.web.server.filemanager.FileContents)1 OverridableFile (edu.stanford.bmir.protege.web.server.inject.OverridableFile)1 MessagingExceptionHandler (edu.stanford.bmir.protege.web.server.mail.MessagingExceptionHandler)1 TemplateEngine (edu.stanford.bmir.protege.web.server.templates.TemplateEngine)1 File (java.io.File)1 Before (org.junit.Before)1