@Test(expected = IllegalArgumentException.class)
public void testHttpHeaderAuthenticationFilterUserWithMultipleRoleHeaderNameRegexAndSingleRoleHeaderTogether() throws Exception
{

    Map<String, Object> overrideMap = getDefaultSecurityEnvironmentVariables();
    overrideMap.put(ConfigurationValue.SECURITY_HTTP_HEADER_NAMES.getKey(), "useridHeader=userId|firstNameHeader=firstName" +
        "|lastNameHeader=lastName|emailHeader=email|rolesHeader=roles|sessionInitTimeHeader=sessionInitTime");
    overrideMap.put(ConfigurationValue.SECURITY_HTTP_HEADER_NAME_ROLE_REGEX.getKey(), "priv(.+)");
    overrideMap.put(ConfigurationValue.SECURITY_HTTP_HEADER_ROLE_VALUE.getKey(), "valid");
    modifyPropertySourceInEnvironment(overrideMap);
    try
    {
        MockHttpServletRequest request =
            getRequestWithHeaders("testUserId", "testFirstName", "testLastName", "testEmail", "noRoleMemberOf", "Wed, 11 Mar 2015 10:24:09");
        request.addHeader("privtestrole2", "valid");
        // Invalidate user session if exists.
        invalidateApplicationUser(request);
        httpHeaderAuthenticationFilter.init(new MockFilterConfig());
        httpHeaderAuthenticationFilter.doFilter(request, new MockHttpServletResponse(), new MockFilterChain());
        //exception is throw if singleRoleHeaderValue and multiRoleHeaders are found
        validateHttpHeaderApplicationUser("testUserId", "testFirstName", "testLastName", "testEmail", "testrole1", "Wed, 11 Mar 2015 10:24:09", null, null);
    }
    finally
    {
        restorePropertySourceInEnvironment();
    }
}