use of com.google.api.generator.gapic.model.GapicClass in project gapic-generator-java by googleapis.
the class ServiceSettingsClassComposerTest method generateServiceSettingsClasses.
@Test
public void generateServiceSettingsClasses() {
Service service = context.services().get(0);
GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, service);
Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden");
Assert.assertGoldenSamples(this.getClass(), "servicesettings", clazz.classDefinition().packageString(), clazz.samples());
}
use of com.google.api.generator.gapic.model.GapicClass in project gapic-generator-java by googleapis.
the class ServiceStubSettingsClassComposerTest method generateServiceStubSettingsClasses.
@Test
public void generateServiceStubSettingsClasses() {
Service service = context.services().get(0);
GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, service);
Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden");
Assert.assertGoldenSamples(this.getClass(), "servicesettings/stub", clazz.classDefinition().packageString(), clazz.samples());
}
use of com.google.api.generator.gapic.model.GapicClass in project gapic-generator-java by googleapis.
the class GrpcServiceCallableFactoryClassComposerTest method generateServiceClasses.
@Test
public void generateServiceClasses() {
GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho();
Service echoProtoService = context.services().get(0);
GapicClass clazz = GrpcServiceCallableFactoryClassComposer.instance().generate(context, echoProtoService);
JavaWriterVisitor visitor = new JavaWriterVisitor();
clazz.classDefinition().accept(visitor);
Utils.saveCodegenToFile(this.getClass(), "GrpcEchoCallableFactory.golden", visitor.write());
Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "GrpcEchoCallableFactory.golden");
Assert.assertCodeEquals(goldenFilePath, visitor.write());
}
use of com.google.api.generator.gapic.model.GapicClass in project gapic-generator-java by googleapis.
the class HttpJsonServiceStubClassComposerTest method generateServiceClasses.
@Test
public void generateServiceClasses() {
GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho();
Service echoProtoService = context.services().get(0);
GapicClass clazz = HttpJsonServiceStubClassComposer.instance().generate(context, echoProtoService);
JavaWriterVisitor visitor = new JavaWriterVisitor();
clazz.classDefinition().accept(visitor);
Utils.saveCodegenToFile(this.getClass(), "HttpJsonEchoStub.golden", visitor.write());
Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "HttpJsonEchoStub.golden");
Assert.assertCodeEquals(goldenFilePath, visitor.write());
}
use of com.google.api.generator.gapic.model.GapicClass in project gapic-generator-java by googleapis.
the class GrpcServiceStubClassComposerTest method generateGrpcServiceStubClass_httpBindings.
@Test
public void generateGrpcServiceStubClass_httpBindings() {
GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseTesting();
Service service = context.services().get(0);
GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service);
Assert.assertGoldenClass(this.getClass(), clazz, "GrpcTestingStub.golden");
Assert.assertEmptySamples(clazz.samples());
}
Aggregations