@Test
public void testHttpHeaderAuthenticationFilterNoHeaders() throws Exception
{

    modifyPropertySourceInEnvironment(getDefaultSecurityEnvironmentVariables());
    try
    {
        // Invalidate user session if exists.
        invalidateApplicationUser(null);
        httpHeaderAuthenticationFilter.init(new MockFilterConfig());
        httpHeaderAuthenticationFilter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain());
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        assertNull(authentication);
    }
    finally
    {
        restorePropertySourceInEnvironment();
    }
}