### Question:
EncryptionServiceImpl implements EncryptionService { @Override public String encrypt(String plain) { return plain != null ? key.encrypt(plain) : null; } EncryptionServiceImpl(ConfidentialKey key); @Autowired  EncryptionServiceImpl(ConfidentialStore confidentialStore); @Override String encrypt(String plain); @Override String decrypt(String crypted); @Override String exportKey(); @Override void importKey(String payload);  }### Answer:
@Test public void encrypt() throws Exception { service.encrypt("test"); verify(key, times(1)).encrypt("test"); }
@Test public void encrypt_null() throws Exception { service.encrypt(null); verify(key, never()).encrypt(anyString()); }