@Test
void validDaemonCli() throws IOException, KeyStoreException {

    // prepare keystore
    final String keyStorePassword = "password";
    final File keystore = File.createTempFile("robozonky-", ".keystore");
    keystore.delete();
    final KeyStoreHandler ksh = KeyStoreHandler.create(keystore, keyStorePassword.toCharArray());
    SecretProvider.keyStoreBased(ksh, USERNAME, "something".toCharArray());
    // run the app
    final String name = UUID.randomUUID()
        .toString();
    final App main = new App("-n", name, "-g", keystore.getAbsolutePath(), "-p", keyStorePassword, "-i",
            "somewhere.txt",
            "-s", "somewhere");
    final Optional<Function<Lifecycle, InvestmentMode>> cfg = CommandLine.parse(main);
    assertThat(cfg).isPresent();
    assertThat(cfg.get()
        .apply(null)).isInstanceOf(Daemon.class);
    assertThat(ListenerServiceLoader.getNotificationConfiguration(mockSessionInfo())).isNotEmpty();
}