static void run(String resolverPath, String rootPath, String targetDirectoryPath, String[] sources)
      throws IOException
  {
    final DataSchemaResolver schemaResolver = MultiFormatDataSchemaResolver.withBuiltinFormats(resolverPath);
    VelocityEngine velocityEngine = initVelocityEngine();
    final File targetDirectory = new File(targetDirectoryPath);
    final StringBuilder message = new StringBuilder();

    final RestSpecParser parser = new RestSpecParser();
    final RestSpecParser.ParseResult parseResult = parser.parseSources(sources);
    for (CodeUtil.Pair<ResourceSchema, File> pair : parseResult.getSchemaAndFiles())
    {

      generateFluentClientByResource(
        pair.first,
        schemaResolver,
        velocityEngine,
        targetDirectory,
        pair.second.getPath(),
        new ArrayList<>(2),
        message
      );
    }

    if (message.length() > 0)
    {
      throw new IOException(message.toString());
    }

  }
@Test()
  public void testBasic() throws Exception
  {
    final String pegasusDir = moduleDir + FS + RESOURCES_DIR + FS + "pegasus";
    final String outPath = outdir.getPath();
    FluentApiGenerator.run(pegasusDir,
            moduleDir,
            outPath,
            new String[] { moduleDir + FS + RESOURCES_DIR + FS + "idls" + FS + "testCollection.restspec.json" });

    final File apiFile = new File(outPath + FS + "com" + FS + "linkedin" + FS + "restli" + FS + "swift" + FS + "integration" + FS + "TestCollection.java");
    Assert.assertTrue(apiFile.exists());
  }