dongjinleekr commented on a change in pull request #11430:
URL: https://github.com/apache/kafka/pull/11430#discussion_r738930580



##########
File path: 
clients/src/test/java/org/apache/kafka/common/security/JaasContextTest.java
##########
@@ -172,14 +172,42 @@ public void testMissingSemicolon() throws Exception {
 
     @Test
     public void testNumericOptionWithoutQuotes() throws Exception {
-        checkInvalidConfiguration("test.testNumericOptionWithoutQuotes 
required option1=3;");
+        try {
+            Map<String, Object> options = new HashMap<>();
+            options.put("option", "3");
+            checkConfiguration("test.testNumericOptionWithoutQuotes required 
option=3;", "test.testNumericOptionWithoutQuotes", 
LoginModuleControlFlag.REQUIRED, options);
+            fail("Given Jaas config is parsed properly but 
sun.security.provider.ConfigFile$Spi.<init> throws a IOException wrapped with a 
SecurityException.");
+        } catch (SecurityException e) {
+            assertEquals(IOException.class, e.getCause().getClass());
+        }
     }
 
     @Test
     public void testInvalidControlFlag() throws Exception {
         checkInvalidConfiguration("test.testInvalidControlFlag { option1=3;");
     }
 
+    @Test
+    public void testNumericWord() throws Exception {
+        Map<String, Object> options = new HashMap<>();
+        options.put("password", "k3fka");

Review comment:
       Now tests 5 cases - starts with numeric, starts with symbolic, has 
numeric in the middle, has symbolic in the middle, has both of numeric and 
symbolic in the middle.




-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to