use of com.google.api.codegen.config.ProtoMethodModel in project toolkit by googleapis.
the class GoGapicSurfaceTransformerTest method testGetImportsRetry.
@Test
public void testGetImportsRetry() {
MethodModel method = new ProtoMethodModel(getMethod(context.getInterface(), "RetryMethod"));
transformer.addXApiImports(context, Collections.singletonList(method));
transformer.generateRetryConfigDefinitions(context, Collections.singletonList(method));
Truth.assertThat(context.getImportTypeTable().getImports()).containsKey("time");
Truth.assertThat(context.getImportTypeTable().getImports()).doesNotContainKey("cloud.google.com/go/longrunning");
}
use of com.google.api.codegen.config.ProtoMethodModel in project toolkit by googleapis.
the class GoGapicSurfaceTransformerTest method testGetExampleImportsBidiStream.
@Test
public void testGetExampleImportsBidiStream() {
MethodModel method = new ProtoMethodModel(getMethod(context.getInterface(), "BidiStreamMethod"));
transformer.addXExampleImports(context, Collections.singletonList(method));
Truth.assertThat(context.getImportTypeTable().getImports()).containsKey("io");
}
use of com.google.api.codegen.config.ProtoMethodModel in project toolkit by googleapis.
the class GoGapicSurfaceTransformerTest method testGetExampleImportsServerStream.
@Test
public void testGetExampleImportsServerStream() {
MethodModel method = new ProtoMethodModel(getMethod(context.getInterface(), "ServerStreamMethod"));
transformer.addXExampleImports(context, Collections.singletonList(method));
Truth.assertThat(context.getImportTypeTable().getImports()).containsKey("io");
}
use of com.google.api.codegen.config.ProtoMethodModel in project toolkit by googleapis.
the class GoGapicSurfaceTransformerTest method testGetImportsNotLro.
@Test
public void testGetImportsNotLro() {
MethodModel method = new ProtoMethodModel(getMethod(context.getInterface(), "NotLroMethod"));
transformer.addXApiImports(context, Collections.singletonList(method));
Truth.assertThat(context.getImportTypeTable().getImports()).doesNotContainKey("cloud.google.com/go/longrunning");
}
use of com.google.api.codegen.config.ProtoMethodModel in project toolkit by googleapis.
the class GoGapicSurfaceTransformerTest method testGetImportsPlain.
@Test
public void testGetImportsPlain() {
MethodModel method = new ProtoMethodModel(getMethod(context.getInterface(), "SimpleMethod"));
transformer.addXApiImports(context, Collections.singletonList(method));
transformer.generateRetryConfigDefinitions(context, Collections.singletonList(method));
Truth.assertThat(context.getImportTypeTable().getImports()).doesNotContainKey("time");
Truth.assertThat(context.getImportTypeTable().getImports()).doesNotContainKey("cloud.google.com/go/longrunning");
}
Aggregations