@Override
  protected int command() {
    if (!validateConfigFilePresent()) {
      return 1;
    }

    final MigrationConfig config;
    try {
      config = MigrationConfig.load(getConfigFile());
    } catch (KsqlException | MigrationException e) {
      LOGGER.error(e.getMessage());
      return 1;
    }

    return command(
            config,
            MigrationsUtil::getKsqlClient,
            getMigrationsDir(getConfigFile(), config),
            Clock.systemDefaultZone()
    );
  }
@Test
  public void shouldApplyInsertStatement() throws Exception {
    // Given:
    command = PARSER.parse("-v", "3");
    createMigrationFile(1, NAME, migrationsDir, COMMAND);
    createMigrationFile(3, NAME, migrationsDir, INSERTS);
    givenCurrentMigrationVersion("1");
    givenAppliedMigration(1, NAME, MigrationState.MIGRATED);

    // When:
    final int result = command.command(config, (cfg, headers) -> ksqlClient, migrationsDir, Clock.fixed(
        Instant.ofEpochMilli(1000), ZoneId.systemDefault()));

    // Then:
    assertThat(result, is(0));
    final InOrder inOrder = inOrder(ksqlClient);
    verifyMigratedVersion(inOrder, 3, "1", MigrationState.MIGRATED,
        () -> {
          inOrder.verify(ksqlClient).insertInto("`FOO`", new KsqlObject(ImmutableMap.of("`A`", "abcd")));
          inOrder.verify(ksqlClient).insertInto("`FOO`", new KsqlObject(ImmutableMap.of("`A`", "efgh")));
          inOrder.verify(ksqlClient).insertInto("`FOO`", new KsqlObject(ImmutableMap.of("`A`", "ijkl")));
        });
    inOrder.verify(ksqlClient).close();
    inOrder.verifyNoMoreInteractions();
  }