Search in sources :

Example 11 with Feedback

use of edu.hawaii.its.groupings.type.Feedback in project uhgroupings by uhawaii-system-its-ti-iam.

the class EmailServiceTest method sendFeedbackWithExceptionMessage.

@Test
public void sendFeedbackWithExceptionMessage() {
    Feedback feedback = createBaseFeedback();
    feedback.setExceptionMessage("ArrayIndexOutOfBoundsException");
    emailService.send(feedback);
    assertThat(wasSent, is(true));
    assertThat(messageSent.getSubject(), containsString("problem"));
    assertThat(messageSent.getText(), containsString("John Doe"));
    assertThat(messageSent.getText(), containsString("jdoe@hawaii.edu"));
    assertThat(messageSent.getText(), containsString("Some problem happened."));
    assertThat(messageSent.getText(), containsString("Stack Trace:"));
    assertThat(messageSent.getText(), containsString("ArrayIndexOutOfBoundsException"));
}
Also used : Feedback(edu.hawaii.its.groupings.type.Feedback) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Feedback (edu.hawaii.its.groupings.type.Feedback)11 Test (org.junit.Test)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)4 HttpSession (javax.servlet.http.HttpSession)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 ResponseEntity (org.springframework.http.ResponseEntity)1 MailSendException (org.springframework.mail.MailSendException)1 SimpleMailMessage (org.springframework.mail.SimpleMailMessage)1 JavaMailSender (org.springframework.mail.javamail.JavaMailSender)1 MvcResult (org.springframework.test.web.servlet.MvcResult)1