Exemplo n.º 1
0
 @Test
 public void shouldLogPasswordsOnTheLogAsStars() {
   LogFixture logFixture = LogFixture.startListening();
   LogFixture.enableDebug();
   CommandLine line =
       CommandLine.createCommandLine("notexist").withArg(new PasswordArgument("secret"));
   try {
     line.runOrBomb(null);
   } catch (Exception e) {
     // ignored
   }
   assertThat(ArrayUtil.join(logFixture.getMessages()), containsString("notexist ******"));
   logFixture.stopListening();
 }