Search in sources :

Example 1 with DiscoConfigGeneratorApi

use of com.google.api.codegen.configgen.DiscoConfigGeneratorApi in project toolkit by googleapis.

the class DiscoConfigGenerationTest method run.

@Override
public String run() throws Exception {
    String outFile = tempDir.getRoot().getPath() + File.separator + baselineFileName();
    String discoveryFile = getTestDataLocator().findTestData(discoveryFileName).getFile();
    ToolOptions options = ToolOptions.create();
    options.set(DiscoConfigGeneratorApi.OUTPUT_FILE, outFile);
    options.set(DiscoConfigGeneratorApi.DISCOVERY_DOC, discoveryFile);
    new DiscoConfigGeneratorApi(options).run();
    return new String(Files.readAllBytes(Paths.get(outFile)), StandardCharsets.UTF_8);
}
Also used : DiscoConfigGeneratorApi(com.google.api.codegen.configgen.DiscoConfigGeneratorApi) ToolOptions(com.google.api.tools.framework.tools.ToolOptions)

Aggregations

DiscoConfigGeneratorApi (com.google.api.codegen.configgen.DiscoConfigGeneratorApi)1 ToolOptions (com.google.api.tools.framework.tools.ToolOptions)1