MavenCipherImpl implements MavenCipher { @Override public String encrypt(final CharSequence str, final String passPhrase) { checkNotNull(str); checkNotNull(passPhrase); return SHIELD_BEGIN + doEncrypt(str, passPhrase) + SHIELD_END; } @Inject  MavenCipherImpl(final CryptoHelper cryptoHelper); @Override String encrypt(final CharSequence str, final String passPhrase); @Override String decrypt(final String str, final String passPhrase); @Override char[] decryptChars(final String str, final String passPhrase); @Override boolean isPasswordCipher(final CharSequence str);  }
@Test public void encrypt() throws Exception { String enc = testSubject.encrypt(plaintext, passPhrase); assertThat(enc, notNullValue()); }
@Test public void encrypt_with_special_chars() throws Exception { String mixed = testSubject.encrypt(plaintext_mixed, passPhrase); System.out.println(mixed); assertThat(mixed, notNullValue()); String xtraSpecChar = testSubject.encrypt(plaintext_spec_char_xtrabracket, passPhrase); System.out.println(xtraSpecChar); assertThat(xtraSpecChar, notNullValue()); String randomChars = testSubject.encrypt(plaintext_random, passPhrase); System.out.println(randomChars); assertThat(randomChars, notNullValue()); String specialChar = testSubject.encrypt(plaintext_special_char, passPhrase); System.out.println(specialChar); assertThat(specialChar, notNullValue()); }