michael-o commented on a change in pull request #230:
URL: 
https://github.com/apache/httpcomponents-client/pull/230#discussion_r447641035



##########
File path: 
httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestAuthChallengeParser.java
##########
@@ -321,12 +323,26 @@ public void testParseNTLMAuthChallenge() throws Exception 
{
         Assert.assertEquals(null, challenge1.getValue());
     }
 
-    private static void assertNameValuePair (
-            final NameValuePair expected,
-            final NameValuePair result) {
-        Assert.assertNotNull(result);
-        Assert.assertEquals(expected.getName(), result.getName());
-        Assert.assertEquals(expected.getValue(), result.getValue());
+    @Test
+    public void testParseParameterAndToken68AuthChallengeMix() throws 
Exception {
+        final CharArrayBuffer buffer = new CharArrayBuffer(64);
+        buffer.append("scheme1 aaaa  , scheme2 aaaa==,  scheme3 aaaa=aaaa, 
scheme4 aaaa=");
+        final ParserCursor cursor = new ParserCursor(0, buffer.length());
+        final List<AuthChallenge> challenges = 
parser.parse(ChallengeType.TARGET, buffer, cursor);
+        Assert.assertNotNull(challenges);
+        Assert.assertEquals(4, challenges.size());
+        final AuthChallenge challenge1 = challenges.get(0);
+        Assert.assertThat(challenge1.getSchemeName(), 
CoreMatchers.equalTo("scheme1"));
+        Assert.assertThat(challenge1.getValue(), CoreMatchers.equalTo("aaaa"));
+        final AuthChallenge challenge2 = challenges.get(1);
+        Assert.assertThat(challenge2.getSchemeName(), 
CoreMatchers.equalTo("scheme2"));
+        Assert.assertThat(challenge2.getValue(), 
CoreMatchers.equalTo("aaaa=="));
+        final AuthChallenge challenge3 = challenges.get(2);
+        Assert.assertThat(challenge3.getSchemeName(), 
CoreMatchers.equalTo("scheme3"));
+        Assert.assertThat(challenge3.getValue(), CoreMatchers.nullValue());

Review comment:
       How can this logically be padding, because the token is supported to 
terminal with an equals sign. If it does not, it param=value. Isn't it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to