JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence( HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); }  @Override void commence(
      HttpServletRequest request,
      HttpServletResponse response,
      AuthenticationException authException);  }
@Test public void whenCommenceCalledThenExpectUnauthorizedResponse() throws Exception { final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint = new JwtAuthenticationEntryPoint(); jwtAuthenticationEntryPoint.commence(request, response, authException); verify(response, times(1)).sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); }