Decryptor implements java.io.Serializable { public String decrypt(String version, String encryptedMessage) { return encryptors.get(version).decrypt(encryptedMessage); } @Inject  Decryptor(final Map<String, Encryptor> encryptors); String decrypt(String version, String encryptedMessage);  }
@Test(expected = NullPointerException.class) public void testDecryptNullKey() { decryptor.decrypt(null, null); }
@Test public void testDecryptNullValue() { assertThat(decryptor.decrypt("decryption.version.number.1", null), is(nullValue())); }
@Test public void testEncrypt() { assertThat(decryptor.decrypt("decryption.version.number.1", testMessage), is(testMessage)); }