### Question:
EnclaveCliAdapter implements CliAdapter, Callable<CliResult> { @Override public CliResult execute(String... args) throws Exception { this.pidFileMixin.call(); final Config config = configurationMixin.getConfig(); keyPasswordResolver.resolveKeyPasswords(config); return new CliResult(0, false, config); } EnclaveCliAdapter(final KeyPasswordResolver keyPasswordResolver);  EnclaveCliAdapter(); @Override CliType getType(); @Override CliResult call(); @Override CliResult execute(String... args);  }### Answer:
@Test public void missingConfigurationOutputsErrorMessage() { commandLine.execute(); final CliResult result = commandLine.getExecutionResult(); final String output = systemErrOutput.getLog(); assertThat(result).isNull(); assertThat(output).contains("Missing required option '-configfile <config>'"); }
@Test public void helpOptionOutputsUsageMessage() { commandLine.execute("help"); final CliResult result = commandLine.getExecutionResult(); final String output = systemOutOutput.getLog(); assertThat(result).isNull(); assertThat(output) .contains( "Usage:", "Run a standalone enclave to perform encryption/decryption operations", "<main class> [help] -configfile <config> [-pidfile <pidFilePath>]"); assertThat(output) .contains( "Description:", "Run a standalone enclave, which will perform encryption/decryption operations", "for a transaction manager. This means that the transaction manager does not", "perform any of the operations inside its own process, shielding the user from"); assertThat(output) .contains( "Options:", " -configfile <config> path to configuration file", " help display this help message", " -pidfile <pidFilePath> the path to write the PID to"); }
@Test public void configPassedToResolver() throws Exception { final Path inputFile = Paths.get(getClass().getResource("/sample-config.json").toURI()); commandLine.execute("-configfile", inputFile.toString()); final CliResult result = commandLine.getExecutionResult(); assertThat(result).isNotNull(); assertThat(result.getStatus()).isEqualTo(0); assertThat(result.isSuppressStartup()).isFalse(); assertThat(result.getConfig()).isPresent(); assertThat(MockKeyPasswordResolver.getSeen()).isNotNull(); }