use of bio.terra.cli.serialization.userfacing.UFServer in project terra-cli by DataBiosphere.
the class Config method server.
@Test
@DisplayName("config server set and server set are equivalent")
void server() throws IOException {
// It's fine that this test hard-codes server names. We're just testing server configuration is
// saved correctly; we're not actually making calls to the server.
// `terra server set --name=verily-devel`
TestCommand.runCommandExpectSuccess("server", "set", "--name=verily-devel", "--quiet");
// `terra config get server`
UFServer getValue = TestCommand.runAndParseCommandExpectSuccess(UFServer.class, "config", "get", "server");
assertEquals("verily-devel", getValue.name, "server set affects config get");
// `terra config list`
UFConfig config = TestCommand.runAndParseCommandExpectSuccess(UFConfig.class, "config", "list");
assertEquals("verily-devel", config.serverName, "server set affects config list");
// `terra config set server --name=broad-dev`
TestCommand.runCommandExpectSuccess("server", "set", "--name=broad-dev", "--quiet");
// `terra config get server`
getValue = TestCommand.runAndParseCommandExpectSuccess(UFServer.class, "config", "get", "server");
assertEquals("broad-dev", getValue.name, "config set server affects config get");
// `terra config list`
config = TestCommand.runAndParseCommandExpectSuccess(UFConfig.class, "config", "list");
assertEquals("broad-dev", config.serverName, "config set server affects config list");
}
use of bio.terra.cli.serialization.userfacing.UFServer in project terra-cli by DataBiosphere.
the class List method printText.
/**
* Print this command's output in text format.
*/
private void printText(java.util.List<UFServer> returnValue) {
Server currentServer = Context.getServer();
TablePrinter<UFServer> printer = Columns::values;
// print the UFServers, and highlight the current one
String text = printer.print(returnValue, s -> currentServer.getName().equals(s.name));
OUT.println(text);
}
Aggregations