public TestConfig(TestDataLocator testDataLocator,String tempDir,List<String> protoFiles){
  this.testDataLocator=testDataLocator;
  this.protoFiles=ImmutableList.copyOf(protoFiles);
  this.tempDir=tempDir;
  Set<String> extracted=Sets.newHashSet();
  for (  String source : protoFiles) {
    extractProtoSources(extracted,source);
  }
  this.descriptorFile=Paths.get(tempDir,"_descriptor.dsc");
  compileProtos(tempDir,protoFiles,descriptorFile.toString());
}

public TestConfig ( TestDataLocator testDataLocator , String tempDir , List < String > protoFiles ) { this . testDataLocator = testDataLocator ; this . protoFiles = ImmutableList . copyOf ( protoFiles ) ; this . tempDir = tempDir ; Set < String > extracted = Sets . newHashSet ( ) ; for ( String source : protoFiles ) { extractProtoSources ( extracted , source ) ; } this . descriptorFile = Paths . get ( tempDir , "_descriptor.dsc" ) ; compileProtos ( tempDir , protoFiles , descriptorFile . toString ( ) ) ; }
creates a test api . the passed temp dir is managed by the caller ; in a test , it is usally created by the temporaryfolder rule of junit . the passed proto files as well as their imports must be retrievable via the passed test data locator .
