JsonCliOutput implements CliOutput { @Override public void printWorkflow(Workflow workflow, WorkflowState state) { printJson(WorkflowWithState.create(workflow, state)); }  @Override void printStates(RunStateDataPayload runStateDataPayload); @Override void printEvents(List<EventInfo> eventInfos); @Override void printBackfill(Backfill backfill, boolean ignored); @Override void printBackfillPayload(BackfillPayload backfillPayload, boolean ignored); @Override void printBackfills(List<BackfillPayload> backfills, boolean ignored); @Override void printResources(List<Resource> resources); @Override void printMessage(String message); @Override void printWorkflow(Workflow workflow, WorkflowState state); @Override void printWorkflows(List<Workflow> workflows); @Override void printError(String message);  }
@Test public void shouldPrintWorkflow() throws IOException { final Workflow workflow = Workflow.create("foo1", WorkflowConfiguration.builder() .id("bar1") .schedule(Schedule.DAYS) .offset("6h") .dockerImage("foo/bar:baz") .dockerArgs(List.of("foo", "the", "bar")) .dockerTerminationLogging(true) .secret(Secret.create("secret-foo", "/foo-secret")) .serviceAccount("foo@bar.baz") .resources("r1", "r2") .env("FOO", "foo", "BAR", "bar") .commitSha("deadbeef") .build()); final WorkflowState state = WorkflowState.builder() .enabled(true) .nextNaturalTrigger(OffsetDateTime.of(2018, 1, 2, 3, 4, 5, 6, ZoneOffset.UTC).toInstant()) .nextNaturalOffsetTrigger(OffsetDateTime.of(2018, 1, 2, 9, 4, 5, 6, ZoneOffset.UTC).toInstant()) .build(); cliOutput.printWorkflow(workflow, state); assertThat(OBJECT_MAPPER.readValue(outContent.toString(), WorkflowWithState.class), is(WorkflowWithState.create(workflow, state))); }