@Test
public void testNormalCredentials() throws ServletException, IOException {

    Mockito.when(mockHttpServletRequest.getHeader(JwtFilter.HEADER_AUTHORIZATION))
        .thenReturn(HEADER_VALID_CREDENTIALS);
    jwtFilter.doFilterInternal(mockHttpServletRequest, mockHttpServletResponse, mockFilterChain);
    final Claims expectedClaims = new DefaultClaims().setSubject(VALID_CREDENTIALS_SUBJECT);
    expectedClaims.put("roles", "");
    expectedClaims.put("iat", 0);
    Mockito.verify(mockHttpServletRequest).getMethod();
    Mockito.verify(mockHttpServletRequest).setAttribute(JwtFilter.JWT_ATTRIBUTE, expectedClaims);
    Mockito.verify(mockHttpServletResponse).setHeader(JwtFilter.JWT_TOKEN,
        "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2YWxpZCIsInJvbGVzIjoiIiwiaWF0IjowfQ.lzdLJW9bdkXZLc57_YcXm0cJL87ZFSrPLEOD1-nYR8Q");
    Mockito.verify(mockHttpServletRequest).getHeader(JwtFilter.HEADER_AUTHORIZATION);
    Mockito.verify(mockHttpServletResponse).setHeader(JwtFilter.HEADER_CLAIMS_SUBJECT, VALID_CREDENTIALS_SUBJECT);
    Mockito.verify(mockFilterChain).doFilter(mockHttpServletRequest, mockHttpServletResponse);
    Mockito.verify(mockHttpServletResponse, Mockito.times(4)).setHeader(ArgumentMatchers.anyString(),
        ArgumentMatchers.any());
}