@Test
public void testHttpHeaderAuthenticationFilterNoSessionInitTime() throws Exception
{

    modifyPropertySourceInEnvironment(getDefaultSecurityEnvironmentVariables());
    try
    {
        MockHttpServletRequest request = getRequestWithHeaders(USER_ID, "testFirstName", "testLastName", "testEmail", null, null);
        // Invalidate user session if exists.
        invalidateApplicationUser(request);
        httpHeaderAuthenticationFilter.init(new MockFilterConfig());
        httpHeaderAuthenticationFilter.doFilter(request, new MockHttpServletResponse(), new MockFilterChain());
        validateHttpHeaderApplicationUser(USER_ID, "testFirstName", "testLastName", "testEmail", (String) null, null, null, null);
    }
    finally
    {
        restorePropertySourceInEnvironment();
    }
}