String parseAndGenerateOutput(String json) {
        JsonNode jsonNode;
        try {
            jsonNode = Jackson.mapper().readTree(json);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        String status = jsonNode.get("status").asText();
        return switch (status) {
            case statusUnknown -> "File distribution status unknown: " + jsonNode.get("message").asText();
            case statusInProgress -> "File distribution in progress:\n" + inProgressOutput(jsonNode.get("hosts"));
            case statusFinished -> "File distribution finished";
            default -> throw new RuntimeException("Unknown status " + status);
        };
    }
@Test
    public void manyHostsVariousStates() {
        String statusForTwoHosts = createStatusForTwoHosts();
        System.out.println(statusForTwoHosts);
        String output = client.parseAndGenerateOutput(statusForTwoHosts);
        assertEquals("File distribution in progress:\nlocalhost1: IN_PROGRESS (1 of 2 finished)\nlocalhost2: UNKNOWN (Connection timed out)", output);
    }