EncryptHelper { public static String encrypt(String plainText) { return BCrypt.hashpw(plainText, BCrypt.gensalt(12)); }  static String encrypt(String plainText); static boolean isMatched(String plainText, String hashedText);  }
@Test public void should_encrypt_plain_text() { String encryptedText = EncryptHelper.encrypt(plainText); assertThat(encryptedText, not(plainText)); }
@Test public void should_get_different_encrypted_text_every_time_for_same_plain_text() { String encryptedText1 = EncryptHelper.encrypt(plainText); String encryptedText2 = EncryptHelper.encrypt(plainText); String encryptedText3 = EncryptHelper.encrypt(plainText); assertThat(encryptedText1, not(encryptedText2)); assertThat(encryptedText1, not(encryptedText3)); assertThat(encryptedText2, not(encryptedText3)); }