From 5925a99800e24822684b94579155390ce0a7e31b Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Thu, 27 Oct 2016 10:22:52 +0200 Subject: [PATCH] KEYCLOAK-3766 kcreg should display help when no arguments are passed to command --- .../cli/commands/AbstractAuthOptionsCmd.java | 8 +++ .../commands/AbstractGlobalOptionsCmd.java | 6 +- .../registration/cli/commands/ConfigCmd.java | 68 +++++++++---------- .../cli/commands/ConfigCredentialsCmd.java | 11 ++- .../cli/commands/ConfigInitialTokenCmd.java | 7 +- .../commands/ConfigRegistrationTokenCmd.java | 7 +- .../cli/commands/ConfigTruststoreCmd.java | 7 +- .../registration/cli/commands/CreateCmd.java | 12 +++- .../registration/cli/commands/DeleteCmd.java | 11 ++- .../registration/cli/commands/GetCmd.java | 11 ++- .../registration/cli/commands/UpdateCmd.java | 11 ++- .../cli/commands/UpdateTokenCmd.java | 11 ++- .../testsuite/cli/registration/KcRegTest.java | 50 +++++++++++--- .../cli/registration/KcRegTruststoreTest.java | 7 +- 14 files changed, 155 insertions(+), 72 deletions(-) diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractAuthOptionsCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractAuthOptionsCmd.java index d088f0b88c..7c5e5fe601 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractAuthOptionsCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractAuthOptionsCmd.java @@ -98,6 +98,14 @@ public abstract class AbstractAuthOptionsCmd extends AbstractGlobalOptionsCmd { } } + protected boolean noOptions() { + return server == null && realm == null && clientId == null && secret == null && + user == null && password == null && + keystore == null && storePass == null && keyPass == null && alias == null && + trustStore == null && trustPass == null && + token == null && config == null; + } + protected void processGlobalOptions() { super.processGlobalOptions(); diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractGlobalOptionsCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractGlobalOptionsCmd.java index d1b0db23ec..fa412ceaf2 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractGlobalOptionsCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/AbstractGlobalOptionsCmd.java @@ -27,7 +27,7 @@ public abstract class AbstractGlobalOptionsCmd implements Command { } protected boolean printHelp() { - if (help) { + if (help || nothingToDo()) { printOut(help()); return true; } @@ -35,6 +35,10 @@ public abstract class AbstractGlobalOptionsCmd implements Command { return false; } + protected boolean nothingToDo() { + return false; + } + protected String help() { return KcRegCmd.usage(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCmd.java index 4fb5e3425c..06594d7587 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCmd.java @@ -42,44 +42,44 @@ public class ConfigCmd extends AbstractAuthOptionsCmd implements Command { public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { - if (args == null || args.size() == 0) { - if (printHelp()) { - return CommandResult.SUCCESS; - } - - throw new RuntimeException("Sub-command required by '" + OsUtil.CMD + " config' - one of: 'credentials', 'truststore', 'initial-token', 'registration-token'"); - } - - String cmd = args.get(0); - switch (cmd) { - case "credentials": { - ConfigCredentialsCmd command = new ConfigCredentialsCmd(); - command.initFromParent(this); - return command.execute(commandInvocation); - } - case "truststore": { - ConfigTruststoreCmd command = new ConfigTruststoreCmd(); - command.initFromParent(this); - return command.execute(commandInvocation); - } - case "initial-token": { - ConfigInitialTokenCmd command = new ConfigInitialTokenCmd(); - command.initFromParent(this); - return command.execute(commandInvocation); - } - case "registration-token": { - ConfigRegistrationTokenCmd command = new ConfigRegistrationTokenCmd(); - command.initFromParent(this); - return command.execute(commandInvocation); - } - default: { - if (printHelp()) { - return CommandResult.SUCCESS; + if (args != null && args.size() > 0) { + String cmd = args.get(0); + switch (cmd) { + case "credentials": { + ConfigCredentialsCmd command = new ConfigCredentialsCmd(); + command.initFromParent(this); + return command.execute(commandInvocation); + } + case "truststore": { + ConfigTruststoreCmd command = new ConfigTruststoreCmd(); + command.initFromParent(this); + return command.execute(commandInvocation); + } + case "initial-token": { + ConfigInitialTokenCmd command = new ConfigInitialTokenCmd(); + command.initFromParent(this); + return command.execute(commandInvocation); + } + case "registration-token": { + ConfigRegistrationTokenCmd command = new ConfigRegistrationTokenCmd(); + command.initFromParent(this); + return command.execute(commandInvocation); + } + default: { + if (printHelp()) { + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; + } + throw new RuntimeException("Unknown sub-command: " + cmd); } - throw new RuntimeException("Unknown sub-command: " + cmd); } } + if (printHelp()) { + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; + } + + throw new RuntimeException("Sub-command required by '" + OsUtil.CMD + " config' - one of: 'credentials', 'truststore', 'initial-token', 'registration-token'"); + } finally { commandInvocation.stop(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCredentialsCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCredentialsCmd.java index 20f7d88e9a..fc2fa615c3 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCredentialsCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigCredentialsCmd.java @@ -62,18 +62,23 @@ public class ConfigCredentialsCmd extends AbstractAuthOptionsCmd implements Comm @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + return process(commandInvocation); } finally { commandInvocation.stop(); } } + @Override + protected boolean nothingToDo() { + return noOptions(); + } + public CommandResult process(CommandInvocation commandInvocation) throws CommandException, InterruptedException { // check server diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigInitialTokenCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigInitialTokenCmd.java index 5610858f39..09a757bf98 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigInitialTokenCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigInitialTokenCmd.java @@ -43,7 +43,7 @@ public class ConfigInitialTokenCmd extends AbstractAuthOptionsCmd implements Com public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } return process(commandInvocation); @@ -52,6 +52,11 @@ public class ConfigInitialTokenCmd extends AbstractAuthOptionsCmd implements Com } } + @Override + protected boolean nothingToDo() { + return noOptions() && parent.args.size() == 1; + } + public CommandResult process(CommandInvocation commandInvocation) throws CommandException, InterruptedException { List args = new ArrayList<>(); diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigRegistrationTokenCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigRegistrationTokenCmd.java index af6b984aab..ec01ea6d06 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigRegistrationTokenCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigRegistrationTokenCmd.java @@ -40,7 +40,7 @@ public class ConfigRegistrationTokenCmd extends AbstractAuthOptionsCmd implement public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } return process(commandInvocation); @@ -49,6 +49,11 @@ public class ConfigRegistrationTokenCmd extends AbstractAuthOptionsCmd implement } } + @Override + protected boolean nothingToDo() { + return noOptions() && parent.args.size() == 1; + } + public CommandResult process(CommandInvocation commandInvocation) throws CommandException, InterruptedException { List args = new ArrayList<>(); diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigTruststoreCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigTruststoreCmd.java index 7ae668a941..acc1ca36a7 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigTruststoreCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/ConfigTruststoreCmd.java @@ -40,7 +40,7 @@ public class ConfigTruststoreCmd extends AbstractAuthOptionsCmd implements Comma public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } return process(commandInvocation); @@ -49,6 +49,11 @@ public class ConfigTruststoreCmd extends AbstractAuthOptionsCmd implements Comma } } + @Override + protected boolean nothingToDo() { + return noOptions() && parent.args.size() == 1; + } + public CommandResult process(CommandInvocation commandInvocation) throws CommandException, InterruptedException { List args = new ArrayList<>(); diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/CreateCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/CreateCmd.java index 30008cab7b..49a0d1bdf2 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/CreateCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/CreateCmd.java @@ -100,12 +100,12 @@ public class CreateCmd extends AbstractAuthOptionsCmd implements Command { List attrs = new LinkedList<>(); try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + if (args != null) { Iterator it = args.iterator(); while (it.hasNext()) { @@ -230,6 +230,12 @@ public class CreateCmd extends AbstractAuthOptionsCmd implements Command { } } + @Override + protected boolean nothingToDo() { + return noOptions() && regType == null && file == null && (args == null || args.size() == 0); + } + + protected String help() { return usage(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/DeleteCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/DeleteCmd.java index 7a0102dcc6..4c3e0d9604 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/DeleteCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/DeleteCmd.java @@ -54,12 +54,12 @@ public class DeleteCmd extends AbstractAuthOptionsCmd { @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + if (args == null || args.isEmpty()) { throw new RuntimeException("CLIENT not specified"); } @@ -113,6 +113,11 @@ public class DeleteCmd extends AbstractAuthOptionsCmd { } } + @Override + protected boolean nothingToDo() { + return noOptions() && (args == null || args.size() == 0); + } + protected String help() { return usage(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/GetCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/GetCmd.java index 35936415b9..3cb580f510 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/GetCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/GetCmd.java @@ -72,12 +72,12 @@ public class GetCmd extends AbstractAuthOptionsCmd { public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + if (args == null || args.isEmpty()) { throw new RuntimeException("CLIENT not specified"); } @@ -175,6 +175,11 @@ public class GetCmd extends AbstractAuthOptionsCmd { } } + @Override + protected boolean nothingToDo() { + return noOptions() && endpoint == null && (args == null || args.size() == 0); + } + protected String help() { return usage(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateCmd.java index 23ccbe412f..8a3697ca09 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateCmd.java @@ -101,12 +101,12 @@ public class UpdateCmd extends AbstractAuthOptionsCmd { List attrs = new LinkedList<>(); try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + String clientId = null; if (args != null) { @@ -333,6 +333,11 @@ public class UpdateCmd extends AbstractAuthOptionsCmd { } } + @Override + protected boolean nothingToDo() { + return noOptions() && regType == null && file == null && (args == null || args.size() == 0); + } + protected String help() { return usage(); } diff --git a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateTokenCmd.java b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateTokenCmd.java index 3255cad75e..c7332434a5 100644 --- a/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateTokenCmd.java +++ b/integration/client-cli/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/UpdateTokenCmd.java @@ -60,12 +60,12 @@ public class UpdateTokenCmd extends AbstractAuthOptionsCmd { public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { try { - processGlobalOptions(); - if (printHelp()) { - return CommandResult.SUCCESS; + return help ? CommandResult.SUCCESS : CommandResult.FAILURE; } + processGlobalOptions(); + if (args == null || args.isEmpty()) { throw new RuntimeException("CLIENT not specified"); } @@ -132,6 +132,11 @@ public class UpdateTokenCmd extends AbstractAuthOptionsCmd { } } + @Override + protected boolean nothingToDo() { + return noOptions() && (args == null || args.size() == 0); + } + protected String help() { return usage(); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTest.java index f936d6fbf7..7da3a7e062 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTest.java @@ -51,21 +51,49 @@ public class KcRegTest extends AbstractCliTest { "Sub-command required by '" + OsUtil.CMD + " config' - one of: 'credentials', 'truststore', 'initial-token', 'registration-token'", exe.stderrLines().get(0)); + exe = execute("config credentials"); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " config credentials --server SERVER_URL --realm REALM [ARGUMENTS]", exe.stdoutLines().get(0)); + + exe = execute("config initial-token"); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " config initial-token --server SERVER --realm REALM [--delete | TOKEN] [ARGUMENTS]", exe.stdoutLines().get(0)); + + exe = execute("config registration-token"); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " config registration-token --server SERVER --realm REALM --client CLIENT [--delete | TOKEN] [ARGUMENTS]", exe.stdoutLines().get(0)); + + exe = execute("config truststore"); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " config truststore [TRUSTSTORE | --delete] [--trustpass PASSWOD] [ARGUMENTS]", exe.stdoutLines().get(0)); + exe = execute("create"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("error message", "No file nor attribute values specified", exe.stderrLines().get(0)); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " create [ARGUMENTS]", exe.stdoutLines().get(0)); + //Assert.assertEquals("error message", "No file nor attribute values specified", exe.stderrLines().get(0)); exe = execute("get"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " get CLIENT [ARGUMENTS]", exe.stdoutLines().get(0)); + //Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); exe = execute("update"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("error message", "No file nor attribute values specified", exe.stderrLines().get(0)); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " update CLIENT [ARGUMENTS]", exe.stdoutLines().get(0)); + //Assert.assertEquals("error message", "No file nor attribute values specified", exe.stderrLines().get(0)); exe = execute("delete"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " delete CLIENT [ARGUMENTS]", exe.stdoutLines().get(0)); + //Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); exe = execute("attrs"); Assert.assertEquals("exit code", 0, exe.exitCode()); @@ -73,8 +101,10 @@ public class KcRegTest extends AbstractCliTest { Assert.assertEquals("first line", "Attributes for default format:", exe.stdoutLines().get(0)); exe = execute("update-token"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); + assertExitCodeAndStdErrSize(exe, 1, 0); + Assert.assertTrue("help message returned", exe.stdoutLines().size() > 10); + Assert.assertEquals("help message", "Usage: " + OsUtil.CMD + " update-token CLIENT [ARGUMENTS]", exe.stdoutLines().get(0)); + //Assert.assertEquals("error message", "CLIENT not specified", exe.stderrLines().get(0)); exe = execute("help"); assertExitCodeAndStdErrSize(exe, 0, 0); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTruststoreTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTruststoreTest.java index 58854590f3..9a094f3888 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTruststoreTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/KcRegTruststoreTest.java @@ -78,13 +78,8 @@ public class KcRegTruststoreTest extends AbstractCliTest { } } - // Check missing argument error - KcRegExec exe = execute("config truststore"); - assertExitCodeAndStreamSizes(exe, 1, 0, 1); - Assert.assertEquals("no truststore error", "No truststore specified", exe.stderrLines().get(0)); - // configure truststore with password - exe = execute("config truststore --trustpass secret '" + truststore.getAbsolutePath() + "'"); + KcRegExec exe = execute("config truststore --trustpass secret '" + truststore.getAbsolutePath() + "'"); assertExitCodeAndStreamSizes(exe, 0, 0, 0); // perform authentication against server - asks for password, then for truststore password