KEYCLOAK-3789 KcRegTests are failing on CI

This commit is contained in:
Marko Strukelj 2016-10-21 13:57:07 +02:00
parent 317749a7fd
commit 4ee759d9ec
7 changed files with 23 additions and 22 deletions

View File

@ -71,9 +71,9 @@ public abstract class AbstractAuthOptionsCmd extends AbstractGlobalOptionsCmd {
@Option(shortName = 't', name = "token", description = "Initial / Registration access token to use)", hasValue = true)
protected String token;
protected void init(AbstractAuthOptionsCmd parent) {
protected void initFromParent(AbstractAuthOptionsCmd parent) {
super.init(parent);
super.initFromParent(parent);
noconfig = parent.noconfig;
config = parent.config;
@ -159,7 +159,8 @@ public abstract class AbstractAuthOptionsCmd extends AbstractGlobalOptionsCmd {
initConfigData(config);
ConfigUtil.setupInMemoryHandler(config);
ConfigCredentialsCmd login = new ConfigCredentialsCmd(this);
ConfigCredentialsCmd login = new ConfigCredentialsCmd();
login.initFromParent(this);
login.init(config);
login.process(commandInvocation);

View File

@ -17,7 +17,7 @@ public abstract class AbstractGlobalOptionsCmd implements Command {
@Option(name = "help", description = "Print command specific help", hasValue = false)
protected boolean help;
protected void init(AbstractGlobalOptionsCmd parent) {
protected void initFromParent(AbstractGlobalOptionsCmd parent) {
dumpTrace = parent.dumpTrace;
help = parent.help;
}

View File

@ -53,16 +53,24 @@ public class ConfigCmd extends AbstractAuthOptionsCmd implements Command {
String cmd = args.get(0);
switch (cmd) {
case "credentials": {
return new ConfigCredentialsCmd(this).execute(commandInvocation);
ConfigCredentialsCmd command = new ConfigCredentialsCmd();
command.initFromParent(this);
return command.execute(commandInvocation);
}
case "truststore": {
return new ConfigTruststoreCmd(this).execute(commandInvocation);
ConfigTruststoreCmd command = new ConfigTruststoreCmd();
command.initFromParent(this);
return command.execute(commandInvocation);
}
case "initial-token": {
return new ConfigInitialTokenCmd(this).execute(commandInvocation);
ConfigInitialTokenCmd command = new ConfigInitialTokenCmd();
command.initFromParent(this);
return command.execute(commandInvocation);
}
case "registration-token": {
return new ConfigRegistrationTokenCmd(this).execute(commandInvocation);
ConfigRegistrationTokenCmd command = new ConfigRegistrationTokenCmd();
command.initFromParent(this);
return command.execute(commandInvocation);
}
default: {
if (printHelp()) {

View File

@ -36,11 +36,6 @@ public class ConfigCredentialsCmd extends AbstractAuthOptionsCmd implements Comm
private int sigLifetime = 600;
public ConfigCredentialsCmd() {}
public ConfigCredentialsCmd(AbstractAuthOptionsCmd parent) {
init(parent);
}
public void init(ConfigData configData) {
if (server == null) {

View File

@ -33,11 +33,10 @@ public class ConfigInitialTokenCmd extends AbstractAuthOptionsCmd implements Com
private boolean delete;
private boolean keepDomain;
public ConfigInitialTokenCmd() {}
public ConfigInitialTokenCmd(ConfigCmd parent) {
protected void initFromParent(ConfigCmd parent) {
this.parent = parent;
init(parent);
super.initFromParent(parent);
}
@Override

View File

@ -30,11 +30,10 @@ public class ConfigRegistrationTokenCmd extends AbstractAuthOptionsCmd implement
private boolean delete;
public ConfigRegistrationTokenCmd() {}
public ConfigRegistrationTokenCmd(ConfigCmd parent) {
protected void initFromParent(ConfigCmd parent) {
this.parent = parent;
init(parent);
super.initFromParent(parent);
}
@Override

View File

@ -30,11 +30,10 @@ public class ConfigTruststoreCmd extends AbstractAuthOptionsCmd implements Comma
private boolean delete;
public ConfigTruststoreCmd() {}
public ConfigTruststoreCmd(ConfigCmd parent) {
protected void initFromParent(ConfigCmd parent) {
this.parent = parent;
init(parent);
super.initFromParent(parent);
}
@Override