PlainCliOutput implements CliOutput { @Override public void printBackfill(Backfill backfill, boolean ignored) { System.out.println(String.format("%s %s %s %s %s %s %s %s %s %s %s %s %s %s", backfill.id(), backfill.workflowId().componentId(), backfill.workflowId().id(), backfill.halted(), backfill.allTriggered(), backfill.concurrency(), backfill.start(), backfill.end(), backfill.reverse(), backfill.nextTrigger(), backfill.created().map(Instant::toString).orElse(""), backfill.lastModified().map(Instant::toString).orElse(""), backfill.description().orElse(""), backfill.triggerParameters().map(triggerParameters -> formatMap( triggerParameters.env())).orElse(""))); }  @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 wf, WorkflowState state); @Override void printWorkflows(List<Workflow> workflows); @Override void printError(String message);  }
@Test public void shouldPrintBackfill() { cliOutput.printBackfill(BACKFILL, true); assertEquals(EXPECTED_OUTPUT, outContent.toString()); }
@Test public void shouldPrintBackfillNoCreateTS() { var backfill = Backfill.newBuilder() .id("backfill-2") .start(Instant.parse("2017-01-01T00:00:00Z")) .end(Instant.parse("2017-01-02T00:00:00Z")) .workflowId(WorkflowId.create("component", "workflow2")) .concurrency(2) .description("Description") .nextTrigger(Instant.parse("2017-01-01T00:00:00Z")) .schedule(Schedule.DAYS) .reverse(false) .triggerParameters(TriggerParameters.builder().env("FOO", "bar").build()) .build(); var expectedOutput = "backfill-2 component workflow2 false false 2 2017-01-01T00:00:00Z" + " 2017-01-02T00:00:00Z false 2017-01-01T00:00:00Z Description " + "FOO=bar\n"; cliOutput.printBackfill(backfill, true); assertEquals(expectedOutput, outContent.toString()); }