mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
do not expose IOException
This commit is contained in:
@@ -105,6 +105,14 @@ public class WebResourceServletTest {
|
||||
verify(response).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoGetWithDispatcherException() throws IOException {
|
||||
when(request.getRequestURI()).thenReturn("/scm/awesome.jpg");
|
||||
doThrow(IOException.class).when(pushStateDispatcher).dispatch(request, response, "/awesome.jpg");
|
||||
servlet.doGet(request, response);
|
||||
verify(response).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
private static class TestingOutputServletOutputStream extends ServletOutputStream {
|
||||
|
||||
private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user