jbertram commented on code in PR #6419:
URL: https://github.com/apache/artemis/pull/6419#discussion_r3210495489
##########
artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTestIndividualSettings.java:
##########
@@ -84,4 +90,38 @@ private boolean fileContains(File file, String search) {
}
return false;
}
+
+ @Test
+ public void testMaskClusterPassword() throws Exception {
+ final String password = RandomUtil.randomUUIDString();
+
+ Create c = new Create();
+ Create.enableInput();
+ try {
+ InputReader inputReader = Mockito.mock(InputReader.class);
+
Mockito.when(inputReader.readPassword(Mockito.anyString())).thenReturn(password);
+ c.setLineReader(inputReader);
+
+
assertEquals(PasswordMaskingUtil.wrap(PasswordMaskingUtil.getDefaultCodec().encode(password)),
c.getClusterPassword());
+ } finally {
+ Create.disableInput();
+ }
+ }
+
+ @Test
+ public void testMaskAdminPassword() throws Exception {
+ final String password = RandomUtil.randomUUIDString();
+
+ Create c = new Create();
+ Create.enableInput();
+ try {
+ InputReader inputReader = Mockito.mock(InputReader.class);
+
Mockito.when(inputReader.readPassword(Mockito.anyString())).thenReturn(password);
Review Comment:
Agreed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]