示例#1
0
 @Test
 public void testDisablePwEncoder() {
   System.setProperty("zookeeper.password.encode", "false");
   assertEquals("UXdlcnR5", PasswordEncoder.decode("UXdlcnR5"));
   assertEquals(
       PasswordEncoder.PREFIX + "UXdlcnR5",
       PasswordEncoder.decode(PasswordEncoder.PREFIX + "UXdlcnR5"));
   assertEquals("Qwerty", PasswordEncoder.encode("Qwerty"));
   assertEquals(
       PasswordEncoder.PREFIX + "Qwerty",
       PasswordEncoder.encode(PasswordEncoder.PREFIX + "Qwerty"));
 }
示例#2
0
 @Test
 public void testDecode() {
   assertEquals("UXdlcnR5", PasswordEncoder.decode("UXdlcnR5"));
   assertEquals("Qwerty", PasswordEncoder.decode(PasswordEncoder.PREFIX + "UXdlcnR5"));
 }