public void testParseHeaders5() throws Exception // Mix of quotes and non-quotes
{
final DigestAuthenticator f = new DigestAuthenticator(new HttpAuthenticationFilter.Credentials("foo", "bar"), 10000);
final Method method = DigestAuthenticator.class.getDeclaredMethod("parseAuthHeaders", List.class);
method.setAccessible(true);
final DigestScheme ds = (DigestScheme) method.invoke(f,
Arrays.asList(new String[]{
" digest realm = \"tata\" , opaque =bar ,nonce=\"foo, bar\", algorithm=md5"
}));
Assert.assertNotNull(ds);
Assert.assertEquals("tata", ds.getRealm());
Assert.assertEquals("foo, bar", ds.getNonce());
Assert.assertEquals("bar", ds.getOpaque());
Assert.assertEquals("MD5", ds.getAlgorithm().name());
}