You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/08/01 22:38:48 UTC

[tomcat] branch 8.5.x updated: Update test for changes in Base64 decoder

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 994dc7b  Update test for changes in Base64 decoder
994dc7b is described below

commit 994dc7bcf1d3b031e20c6192e0606aea894076d2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Aug 1 23:37:59 2019 +0100

    Update test for changes in Base64 decoder
---
 test/org/apache/catalina/authenticator/TestBasicAuthParser.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
index 30a1f35..cc480ff 100644
--- a/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
+++ b/test/org/apache/catalina/authenticator/TestBasicAuthParser.java
@@ -387,18 +387,17 @@ public class TestBasicAuthParser {
     /*
      * "-" is not a legal base64 character. The RFC says it must be
      * ignored by the decoder. This will scramble the decoded string
-     * and eventually result in an authentication Assert.failure.
+     * and eventually result in an IllegalArgumentException.
      */
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     public void testBadBase64Char() throws Exception {
         final String BASE64_CRIB = "dXNlcmlkOnNl-3JldHM=";
         final BasicAuthHeader AUTH_HEADER =
                 new BasicAuthHeader(NICE_METHOD, BASE64_CRIB);
+        @SuppressWarnings("unused")
         BasicAuthenticator.BasicCredentials credentials =
                 new BasicAuthenticator.BasicCredentials(
                     AUTH_HEADER.getHeader(), StandardCharsets.UTF_8, true);
-        Assert.assertEquals(USER_NAME, credentials.getUsername());
-        Assert.assertNotSame(PASSWORD, credentials.getPassword());
     }
 
     /*


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org