CryptoApp { private int encryptPassword(final String password, final CryptoKeyStore ks) throws Exception { if (!ks.keyStoreExists()) { createKeyStore(ks); } updateStatus("Using KeyStore: " + ks.getKeyStoreFile()); String encPwd = getCryptoService(ks).encrypt(password); updateStatus("Encrypted Password:\nENC(" + encPwd + ")"); return EXIT_SUCCESS; } CryptoApp(
            CryptoKeyStoreFactory ksFactory, CryptoServiceFactory csFactory);  CryptoApp(); int execute(String[] args); static void main(String[] args); static final int EXIT_SUCCESS; static final int EXIT_INVALID_COMMAND; static final int EXIT_COMMAND_FAILED; }
@Test public void encryptPasswordTest() throws Exception { when(mockedKS.keyStoreExists()).thenReturn(true); String password = "Demo Password CLI"; execApp(password); verify(mockedCryptoService).encrypt(password); }