Source:
<code>public void testEnableLetsEncryptSSLInteractiveDeclineTOS() throws Exception { CliProcessWrapper cli = new CliProcessWrapper(). addJavaOption("-Duser.home=" + temporaryUserHome.getRoot().toPath().toString()). addCliArgument("--controller=remote+http://" + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort()). addCliArgument("--connect"); try { cli.executeInteractive(); cli.clearOutput(); Assert.assertTrue(cli.pushLineAndWaitForResults("security enable-ssl-management --interactive --no-reload --lets-encrypt", "File name (default accounts.keystore.jks)")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_FILE_NAME, "Password (blank generated):")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_PASSWORD, "Account name (default CertAuthorityAccount)")); Assert.assertTrue(cli.pushLineAndWaitForResults(CA_ACCOUNT_NAME, "Contact email(s)")); Assert.assertTrue(cli.pushLineAndWaitForResults("admin@example.com", "Password (blank generated):")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_PASSWORD, "Alias")); Assert.assertTrue(cli.pushLineAndWaitForResults(CA_ACCOUNT_ALIAS, "Certificate authority URL (default "+ certificateAuthority.getUrl() +"):")); Assert.assertTrue(cli.pushLineAndWaitForResults(LOCALHOST_ACME_URL, "Do you agree to Let's Encrypt terms of service? y/n:")); <START> Assert.assertTrue(cli.pushLineAndWaitForResults("n", null)); <END> } catch (Throwable ex) { throw new Exception(cli.getOutput(), ex); } finally { cli.destroyProcess(); } }</code><technical_language>Missing check error message (via message code) decline TOS</technical_language>

Target:
public void testEnableLetsEncryptSSLInteractiveDeclineTOS() throws Exception { CliProcessWrapper cli = new CliProcessWrapper(). addJavaOption("-Duser.home=" + temporaryUserHome.getRoot().toPath().toString()). addCliArgument("--controller=remote+http://" + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort()). addCliArgument("--connect"); try { cli.executeInteractive(); cli.clearOutput(); Assert.assertTrue(cli.pushLineAndWaitForResults("security enable-ssl-management --interactive --no-reload --lets-encrypt", "File name (default accounts.keystore.jks)")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_FILE_NAME, "Password (blank generated):")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_PASSWORD, "Account name (default CertAuthorityAccount)")); Assert.assertTrue(cli.pushLineAndWaitForResults(CA_ACCOUNT_NAME, "Contact email(s)")); Assert.assertTrue(cli.pushLineAndWaitForResults("admin@example.com", "Password (blank generated):")); Assert.assertTrue(cli.pushLineAndWaitForResults(ACCOUNTS_KEYSTORE_PASSWORD, "Alias")); Assert.assertTrue(cli.pushLineAndWaitForResults(CA_ACCOUNT_ALIAS, "Certificate authority URL (default "+ certificateAuthority.getUrl() +"):")); Assert.assertTrue(cli.pushLineAndWaitForResults(LOCALHOST_ACME_URL, "Do you agree to Let's Encrypt terms of service? y/n:")); Assert.assertTrue(cli.pushLineAndWaitForResults("n", null)); Assert.assertTrue(cli.getOutput().contains("Ignoring, command not executed. You need to accept the TOS to create account and obtain certificates.")); } catch (Throwable ex) { throw new Exception(cli.getOutput(), ex); } finally { cli.destroyProcess(); } }