@Test
public void testWorkflowCreate() throws Exception {

  final String component = "quux";
  final Path workflowsFile = fileFromResource("workflows.yaml");
  final List<WorkflowConfiguration> expected = Json.YAML_MAPPER
      .reader().forType(WorkflowConfiguration.class)
      .<WorkflowConfiguration>readValues(workflowsFile.toFile())
      .readAll();
  assertThat(expected, is(not(Matchers.empty())));
  when(client.createOrUpdateWorkflow(any(), any())).thenAnswer(a -> {
    final String comp = a.getArgument(0);
    final WorkflowConfiguration wfConfig = a.getArgument(1);
    return CompletableFuture.completedFuture(Workflow.create(comp, wfConfig));
  });
  CliMain.run(cliContext, "workflow", "create", component, "-f", workflowsFile.toString());
  for (WorkflowConfiguration workflowConfiguration : expected) {
    verify(client).createOrUpdateWorkflow(component, workflowConfiguration);
    verify(cliOutput).printMessage("Workflow " + workflowConfiguration.id() + " in component "
        + component + " created.");
  }
}