    @Test
    public void testPostRequestWithMatchingCsrfTokensInHeader() throws Exception {

        Cookie token = generateTokenCookie();
        when(request.getMethod()).thenReturn("POST");
        when(request.getCookies()).thenReturn(new Cookie[]{token});
        when(request.getParameter(TOKEN_PARAM)).thenReturn(null);
        when(request.getHeader(TOKEN_HEADER)).thenReturn(token.getValue());
        handler.handle(request, response, chain);
        verify(chain).next(request, response);
    }