CliMain { private void backfillList() throws ExecutionException, InterruptedException { final Optional<String> component = Optional.ofNullable(namespace.getString(parser.backfillListComponent.getDest())); final Optional<String> workflow = Optional.ofNullable(namespace.getString(parser.backfillListWorkflow.getDest())); final boolean showAll = namespace.getBoolean(parser.backfillListShowAll.getDest()); final boolean noTruncate = namespace.getBoolean(parser.backfillListNoTruncate.getDest()); final BackfillsPayload backfillsPayload = styxClient.backfillList(component, workflow, showAll, false) .toCompletableFuture().get(); cliOutput.printBackfills(backfillsPayload.backfills(), noTruncate); } private  CliMain(
      StyxCliParser parser,
      Namespace namespace,
      String apiHost,
      CliOutput cliOutput,
      CliContext cliContext,
      boolean debug); static void main(String... args);  }
@Test public void testBackfillList() { final String component = "quux"; final String workflow = "foo"; final String start = "2017-01-01T00:00:00Z"; final String end = "2017-01-30T00:00:00Z"; final Backfill backfill = Backfill.newBuilder() .id("backfill-2") .start(Instant.parse(start)) .end(Instant.parse(end)) .workflowId(WorkflowId.create(component, workflow)) .concurrency(1) .description("Description") .nextTrigger(Instant.parse("2017-01-01T00:00:00Z")) .schedule(Schedule.DAYS) .created(currentTime) .lastModified(currentTime) .build(); final BackfillsPayload backfillsPayload = BackfillsPayload.create( List.of(BackfillPayload.create(backfill, Optional.empty()))); when(client.backfillList(Optional.of(component), Optional.of(workflow), false, false)) .thenReturn(CompletableFuture.completedFuture(backfillsPayload)); CliMain.run(cliContext, "backfill", "list", "-c", component, "-w", workflow, "--no-trunc"); verify(client).backfillList(Optional.of(component), Optional.of(workflow), false, false); verify(cliOutput).printBackfills(backfillsPayload.backfills(), true); }