@Test
public void shouldPrintStates() {

  final RunStateDataPayload states = RunStateDataPayload.create(List.of(
      RunStateData.create(
          WorkflowInstance.create(WorkflowId.create("c0", "w0"), "2016-09-01"),
          "QUEUED",
          StateData.newBuilder()
              .messages(Message.info("foo"))
              .executionId("e0")
              .tries(17)
              .build()),
      RunStateData.create(
          WorkflowInstance.create(WorkflowId.create("c1", "w1"), "2016-09-02"),
          "SUBMITTED",
          StateData.newBuilder()
              .messages(Message.warning("baz"))
              .executionId("e1")
              .tries(3)
              .build())));
  cliOutput.printStates(states);
  assertThat(outContent.toString(),
      is("  WORKFLOW INSTANCE    STATE        EXECUTION ID                                    TRIES   PREVIOUS EXECUTION MESSAGE\n"
          + "\n"
          + colored(CYAN, "c0") + " " + colored(BLUE, "w0") + "\n"
          + "  2016-09-01           " + coloredBright(BLACK, "QUEUED") + "       e0                                  "
          + "            17      " + colored(GREEN, "foo") + "\n"
          + "\n"
          + colored(CYAN, "c1") + " " + colored(BLUE, "w1") + "\n"
          + "  2016-09-02           " + colored(CYAN,        "SUBMITTED") + "    e1                                  "
          + "            3       " + colored(YELLOW, "baz") + "\n"));
}