PasswordUtils { public static String createPassword(String rawPass, String salt) { Preconditions.checkNotNull(rawPass); String oldPW = createMD5Password(rawPass); return updateOldEncPass(oldPW, salt); }  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; }
@Test(expected = NullPointerException.class) public void createPasswordWithNull() { PasswordUtils.createPassword(null, null); }
@Test public void createPasswordWithEmptyValue() { assertNotNull("empty string should have md5 value!", PasswordUtils.createPassword(EMPTY, DATESTRING)); }