@Test
public void shouldOutputErrorToResponse() throws IOException {

    when(requestMock.getMethod()).thenReturn("GET");
    when(requestMock.getPathInfo()).thenReturn("/error");
    servlet.service(requestMock, responseMock);
    verify(responseMock).sendError(401, "You are not authorized");
}