try {
OnapCommandUtils.persistParams(params, this.profileName);
} catch (OnapCommandPersistProfileFailed e) {
- throw new RuntimeException(e);
+ throw new RuntimeException(e); // NOSONAR
}
}
try {
params = OnapCommandUtils.loadParamFromCache(this.profileName);
} catch (OnapCommandLoadProfileFailed e) {
- throw new RuntimeException(e);
+ throw new RuntimeException(e); // NOSONAR
}
for (Param p : params) {
OnapCommandPersistProfileFailed failed = new OnapCommandPersistProfileFailed("error");
assertEquals("0x1302::Failed to persist profile details, error", failed.getMessage());
+
+ failed = new OnapCommandPersistProfileFailed(new Exception("error"));
+
+ assertEquals("0x1302::Failed to persist profile details, error", failed.getMessage());
}
OnapCommandLoadProfileFailed failed = new OnapCommandLoadProfileFailed("error");
assertEquals("0x1301::Failed to load profile details, error", failed.getMessage());
+
+ failed = new OnapCommandLoadProfileFailed(new Exception("error"));
+
+ assertEquals("0x1301::Failed to load profile details, error", failed.getMessage());
}
}
} catch (Exception e) {
}
- mockConsole("microservice-create -h");
+ cli = new OnapCli(new String[] {});
+ mockConsole("sample-test -h");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
+ mockConsole("use cli-1.0");
+ try {
+ cli.handleInteractive();
+ } catch (Exception e) {
+ }
+
+ cli = new OnapCli(new String[] {});
mockConsole("set a=b");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
+ mockConsole("set");
+ try {
+ cli.handleInteractive();
+ } catch (Exception e) {
+ }
+
+ cli = new OnapCli(new String[] {});
+ mockConsole("set a=");
+ try {
+ cli.handleInteractive();
+ } catch (Exception e) {
+ }
+
+ cli = new OnapCli(new String[] {});
mockConsole("unset a");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
mockConsole("profile test");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
mockConsole("version");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
mockConsole("help");
try {
cli.handleInteractive();
} catch (Exception e) {
}
+ cli = new OnapCli(new String[] {});
mockConsoleReader();
cli.handleInteractive();