use of br.com.caelum.vraptor.simplemail.template.TemplateMailer in project mamute by caelum.
the class NewQuestionMailerTest method setup.
@Before
public void setup() {
this.mailer = mock(AsyncMailer.class);
TemplateMailer templates = mock(TemplateMailer.class);
BundleFormatter bundle = mock(BundleFormatter.class);
Linker linker = mock(Linker.class);
QuestionController questionController = mock(QuestionController.class);
this.request = mock(HttpServletRequest.class);
TemplateMail mail = mock(TemplateMail.class);
this.questionMailer = new NewQuestionMailer(mailer, templates, bundle, linker, "logo");
when(request.getRemoteAddr()).thenReturn("127.0.0.1");
when(linker.linkTo(QuestionController.class)).thenReturn(questionController);
when(templates.template(anyString())).thenReturn(mail);
when(mail.with(anyString(), any())).thenReturn(mail);
}
Aggregations