Search in sources :

Example 1 with UFServer

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");
}
Also used : UFServer(bio.terra.cli.serialization.userfacing.UFServer) UFConfig(bio.terra.cli.serialization.userfacing.UFConfig) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with UFServer

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);
}
Also used : UFServer(bio.terra.cli.serialization.userfacing.UFServer) Server(bio.terra.cli.businessobject.Server) UFServer(bio.terra.cli.serialization.userfacing.UFServer)

Aggregations

UFServer (bio.terra.cli.serialization.userfacing.UFServer)2 Server (bio.terra.cli.businessobject.Server)1 UFConfig (bio.terra.cli.serialization.userfacing.UFConfig)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1