AlgorithmEncryptor implements Encryptor, java.io.Serializable { @Override public String decrypt(final String encryptedData) { LOGGER.debug("decrypting data"); String decryptedData = encryptor.decrypt(encryptedData); LOGGER.debug("decrypted data"); return decryptedData; } @Inject  AlgorithmEncryptor(@Named("crypto.key") final String key,
                              @Named("crypto.algorithm") final String algorithm,
                              @Named("crypto.poolsize") final int poolSize); @Override String encrypt(final String data); @Override String decrypt(final String encryptedData);  }
@Test public void testDecrypt() { String encrypted = algorithmEncryptor.encrypt(testMessage); assertThat(algorithmEncryptor.decrypt(encrypted), is(testMessage)); }
@Test public void testDecryptNull() { assertThat(algorithmEncryptor.decrypt(null), is(nullValue())); }