CryptoApp { private int createKeyStore(CryptoKeyStore ks) throws Exception { try { ks.createKeyStore(); updateStatus("KeyStore created: " + ks.getKeyStoreFile()); return EXIT_SUCCESS; } catch (CryptoKeyStoreException e) { updateStatus("KeyStore create failed: " + e.getMessage()); return EXIT_COMMAND_FAILED; } } 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 createKeyStoreInDefaultLocationTest() throws Exception { execApp("dummy"); verify(mockedKSFactory).newInstance(); verify(mockedKS).createKeyStore(); }
@Test public void createKeyStoreInCustomLocationTest() throws Exception { execApp("dummy", "-keyStoreLocation", getTempKeyStore2Path()); verify(mockedKSFactory).newInstance(tempKeyStoreFolder2.getRoot()); verify(mockedKS).createKeyStore(); }