Encoder { public static boolean matches(String rawPassword, String encodedPassword) { try { return bCryptPasswordEncoder.matches(rawPassword, encodedPassword); } catch (Exception e) { LOG.error("password match check failed because of: " + e.getMessage()); } return false; }  @Deprecated static String encrypt(String s); static String bCryptEncode(String rawPassword); static boolean matches(String rawPassword, String encodedPassword); static void main(String[] args); static final MD5Encoder md5Encoder; }
@Test public void testBCryptEncode_wrongPasswordHash() { String plaintext = "aBc_123_X"; String humbugPasswordHash = "e8136d63483adcd7760a1d50a2a8978b"; boolean matches = Encoder.matches(plaintext, humbugPasswordHash); assertFalse(matches); }