@Test public void testNestedServletExceptionStringThrowable() { Throwable cause = new RuntimeException(); NestedServletException exception = new NestedServletException("foo", cause); assertEquals(NestedExceptionUtils.buildMessage("foo", cause), exception.getMessage()); assertEquals(cause, exception.getCause()); }
/** * Return the detail message, including the message from the nested exception * if there is one. */ @Override public String getMessage() { return NestedExceptionUtils.buildMessage(super.getMessage(), getCause()); }