@Test
public void testHttpHeaderAuthenticationFilterUserAuthorizationInvalidConfigurationValue() throws Exception
{

    // Create and persist the relative database entities.
    userDaoTestHelper.createUserEntity(USER_ID, true);
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE_2);
    // Create an ordered set of expected namespace authorizations.
    Set<NamespaceAuthorization> expectedNamespaceAuthorizations = new HashSet<>();
    expectedNamespaceAuthorizations.add(new NamespaceAuthorization(NAMESPACE, SUPPORTED_NAMESPACE_PERMISSIONS));
    expectedNamespaceAuthorizations.add(new NamespaceAuthorization(NAMESPACE_2, SUPPORTED_NAMESPACE_PERMISSIONS));
    setupTestFunctions("testRole");
    Map<String, Object> overrideMap = getDefaultSecurityEnvironmentVariables();
    overrideMap.put(ConfigurationValue.USER_NAMESPACE_AUTHORIZATION_ENABLED.getKey(), "NOT_A_BOOLEAN");
    modifyPropertySourceInEnvironment(overrideMap);
    try
    {
        MockHttpServletRequest request =
            getRequestWithHeaders(USER_ID, "testFirstName", "testLastName", "testEmail", "testRole", "Wed, 11 Mar 2015 10:24:09");
        // Invalidate user session if exists.
        invalidateApplicationUser(request);
        httpHeaderAuthenticationFilter.init(new MockFilterConfig());
        httpHeaderAuthenticationFilter.doFilter(request, new MockHttpServletResponse(), new MockFilterChain());
        // Validate that there is no authentication.
        assertNull(SecurityContextHolder.getContext().getAuthentication());
    }
    finally
    {
        restorePropertySourceInEnvironment();
    }
}