@Test public void testDifferentStrengthNotMatch() { BCryptPasswordEncoder digester = PasswordUtils.getBcryptDigestByLevel(10); BCryptPasswordEncoder digesterStronger = PasswordUtils.getBcryptDigestByLevel(20); String enPW = digester.encode(STRING); boolean isMatch = digesterStronger.matches(STRING, enPW); assertTrue("Digesters with different strength should not match", isMatch); }
public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); } }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  static String createPassword(String rawPass, String salt); static boolean isPasswordValid(String encPass, String rawPass, String salt); static String updateOldEncPass(String oldPW, String salt); static BCryptPasswordEncoder getBcryptDigestByLevel(int level); static String addSalt(String origin, String salt); }
PasswordUtils { public static BCryptPasswordEncoder getBcryptDigestByLevel(int level) { if (level <= 0) return new BCryptPasswordEncoder(); else return new BCryptPasswordEncoder(level); }  static String createPassword(String rawPass, String salt); static boolean isPasswordValid(String encPass, String rawPass, String salt); static String updateOldEncPass(String oldPW, String salt); static BCryptPasswordEncoder getBcryptDigestByLevel(int level); static String addSalt(String origin, String salt); static final PasswordEncoder encoder; static final BCryptPasswordEncoder digester; }