예제 #1
0
  @Test
  public void shouldReturnStatus500WithViewResolutionExceptionCauseMessage() throws IOException {
    Exception cause = new Exception("cause");
    Throwable viewResult = new ViewResolutionException(cause, "ViewResolutionMessage");
    resolver.resolve(req, resp, viewResult);

    verify(resp).sendError(Mockito.eq(500), Mockito.startsWith("ViewResolutionMessage\ncause"));
  }
예제 #2
0
  @Test
  public void shouldReturnStatus500() throws IOException {
    Exception cause = new Exception("cause");
    Throwable viewResult = new Exception("message", cause);
    resolver.resolve(req, resp, viewResult);

    verify(resp)
        .sendError(
            Mockito.eq(500), Mockito.startsWith("message\ncause\njava.lang.Exception: message"));
  }
예제 #3
0
  @Test
  public void shouldReturnStatus500WithViewResolutionExceptionBecauseNoCauseIsProvided()
      throws IOException {
    Throwable viewResult = new ViewResolutionException("message");
    resolver.resolve(req, resp, viewResult);

    verify(resp)
        .sendError(
            Mockito.eq(500),
            Mockito.startsWith(
                "message\ncom.threewks.thundr.view.ViewResolutionException: message"));
  }