CliMain { private void backfillCreate() throws ExecutionException, InterruptedException { final String component = namespace.getString(parser.backfillCreateComponent.getDest()); final String workflow = namespace.getString(parser.backfillCreateWorkflow.getDest()); final String start = namespace.getString(parser.backfillCreateStart.getDest()); final String end = namespace.getString(parser.backfillCreateEnd.getDest()); final boolean reverse = namespace.getBoolean(parser.backfillCreateReverse.getDest()); final int concurrency = namespace.getInt(parser.backfillCreateConcurrency.getDest()); final String description = namespace.getString(parser.backfillCreateDescription.getDest()); final TriggerParameters triggerParameters = TriggerParameters.builder() .env(parser.getEnvVars(namespace, parser.backfillCreateEnv)) .build(); final BackfillInput configuration = BackfillInput.newBuilder() .component(component) .workflow(workflow) .start(Instant.parse(start)) .end(Instant.parse(end)) .reverse(reverse) .concurrency(concurrency) .description(description) .triggerParameters(triggerParameters) .build(); final boolean allowFuture = namespace.getBoolean(parser.backfillCreateAllowFuture.getDest()); final Backfill backfill = styxClient.backfillCreate(configuration, allowFuture) .toCompletableFuture().get(); cliOutput.printBackfill(backfill, true); } private  CliMain(
      StyxCliParser parser,
      Namespace namespace,
      String apiHost,
      CliOutput cliOutput,
      CliContext cliContext,
      boolean debug); static void main(String... args);  }
@Test public void testBackfillCreate() { final String component = "quux"; 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, "foo")) .concurrency(1) .nextTrigger(Instant.parse("2017-01-01T00:00:00Z")) .schedule(Schedule.DAYS) .created(currentTime) .lastModified(currentTime) .build(); final BackfillInput expectedInput = BackfillInput.newBuilder() .component(backfill.workflowId().componentId()) .workflow(backfill.workflowId().id()) .start(backfill.start()) .end(backfill.end()) .reverse(backfill.reverse()) .concurrency(backfill.concurrency()) .triggerParameters(TriggerParameters.zero()) .build(); when(client.backfillCreate(expectedInput, false)) .thenReturn(CompletableFuture.completedFuture(backfill)); CliMain.run(cliContext, "backfill", "create", component, "foo", "2017-01-01", "2017-01-30", "1"); verify(client).backfillCreate(expectedInput, false); verify(cliOutput).printBackfill(backfill, true); }