steveloughran commented on a change in pull request #1614: HADOOP-16615. Add 
password check for credential provider
URL: https://github.com/apache/hadoop/pull/1614#discussion_r333645736
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredShell.java
 ##########
 @@ -174,11 +174,20 @@ public void testPromptForCredential() throws Exception {
     assertEquals(0, rc);
     assertTrue(outContent.toString().contains("credential1 has been 
successfully " +
         "created."));
-    
-    String[] args2 = {"delete", "credential1", "-f", "-provider",
-        jceksProvider};
+
+    String[] args2 = {"check", "credential1", "-provider",
+      jceksProvider};
+    ArrayList<String> password = new ArrayList<String>();
+    password.add("p@ssw0rd");
+    shell.setPasswordReader(new MockPasswordReader(password));
     rc = shell.run(args2);
     assertEquals(0, rc);
+    assertTrue(outContent.toString().contains("Password match success for 
credential1."));
 
 Review comment:
   Add an error message here which includes the failing string if the 
conditions not met. FWIW we are moving to using AssertJ assertions -if you are 
happy with them, feel free to use them over classic junit asserts

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


With regards,
Apache Git Services

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

Reply via email to