use of com.google.api.codegen.configgen.ConfigGeneratorApi in project toolkit by googleapis.
the class ConfigGenerationTest method run.
@Override
public Object run() throws Exception {
String outFile = tempDir.getRoot().getPath() + File.separator + baselineFileName();
String serviceConfigPath = getTestDataLocator().findTestData(testName.getMethodName() + ".yaml").getPath();
ToolOptions options = ToolOptions.create();
options.set(ConfigGeneratorApi.OUTPUT_FILE, outFile);
options.set(ToolOptions.DESCRIPTOR_SET, testConfig.getDescriptorFile().toString());
options.set(ToolOptions.CONFIG_FILES, Lists.newArrayList(serviceConfigPath));
new ConfigGeneratorApi(options).run();
String outputContent = new String(Files.readAllBytes(Paths.get(outFile)), StandardCharsets.UTF_8);
return outputContent;
}
Aggregations