Search in sources :

Example 1 with QuestionController

use of org.mamute.controllers.QuestionController 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);
}
Also used : TemplateMailer(br.com.caelum.vraptor.simplemail.template.TemplateMailer) HttpServletRequest(javax.servlet.http.HttpServletRequest) QuestionController(org.mamute.controllers.QuestionController) BundleFormatter(br.com.caelum.vraptor.simplemail.template.BundleFormatter) TemplateMail(br.com.caelum.vraptor.simplemail.template.TemplateMail) Linker(org.mamute.vraptor.Linker) AsyncMailer(br.com.caelum.vraptor.simplemail.AsyncMailer) Before(org.junit.Before)

Aggregations

AsyncMailer (br.com.caelum.vraptor.simplemail.AsyncMailer)1 BundleFormatter (br.com.caelum.vraptor.simplemail.template.BundleFormatter)1 TemplateMail (br.com.caelum.vraptor.simplemail.template.TemplateMail)1 TemplateMailer (br.com.caelum.vraptor.simplemail.template.TemplateMailer)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Before (org.junit.Before)1 QuestionController (org.mamute.controllers.QuestionController)1 Linker (org.mamute.vraptor.Linker)1