public static GeneratorResult run(String resolverPath,
                                    String defaultPackage,
                                    final boolean generateImported,
                                    final boolean generateDataTemplates,
                                    RestliVersion version,
                                    RestliVersion deprecatedByVersion,
                                    String targetDirectoryPath,
                                    String[] sources)
                                    throws IOException
  {
    return run(resolverPath,
               defaultPackage,
               null,
               generateImported,
               generateDataTemplates,
               version,
               deprecatedByVersion,
               targetDirectoryPath,
               sources);
  }
@Test(dataProvider = "arrayDuplicateDataProvider2")
  public void testGenerationPathOrder(RestliVersion version, String restspec1, String restspec2, boolean generateLowercasePath) throws Exception
  {
    // Given: RestLi version and spec files.
    File tmpDir = ExporterTestUtils.createTmpDir();
    final String pegasusDir = moduleDir + FS + RESOURCES_DIR + FS + "pegasus";
    final String tmpPath = tmpDir.getPath();
    final String file1 = moduleDir + FS + RESOURCES_DIR + FS + "idls" + FS + restspec1;
    final String file2 = moduleDir + FS + RESOURCES_DIR + FS + "idls" + FS + restspec2;

    // When: Generate the files defined by spec.
    GeneratorResult r = RestRequestBuilderGenerator.run(pegasusDir,
            null,
            moduleDir,
            true,
            false,
            version,
            null,
            tmpPath,
            new String[] { file1 },
            generateLowercasePath);
    GeneratorResult r2 = RestRequestBuilderGenerator.run(pegasusDir,
            null,
            moduleDir,
            true,
            false,
            version,
            null,
            tmpPath,
            new String[] { file2 },
            generateLowercasePath);

    int c = tmpDir.getCanonicalPath().length();

    // Then: Validate the Builder files were created with the correct paths.
    ArrayList<File> files = new ArrayList<>(r.getModifiedFiles());
    files.addAll(r2.getModifiedFiles());
    Assert.assertTrue(files.size() > 0);
    for (File f : files) {
      Assert.assertTrue(f.exists());
      if (!isFileSystemCaseSensitive && !generateLowercasePath) {
        // Do not validate path case since we would need to read paths from files.
        continue;
      } else if (generateLowercasePath) {
        // Validate path is lowercase.
        String path = f.getCanonicalPath().substring(c);
        int idx = path.lastIndexOf("/") + 1;
        path = path.substring(0, idx);
        Matcher matcher = LOWERCASE_PATH_PATTERN.matcher(path);
        Assert.assertTrue(matcher.find());
      }
      Assert.assertTrue(f.getCanonicalPath().endsWith(f.getAbsolutePath()));
    }

    // Clean up.
    ExporterTestUtils.rmdir(tmpDir);
  }