Skip to content

Commit

Permalink
fix: reverts related changes in #985 that partially allows empty serv…
Browse files Browse the repository at this point in the history
…ices be generated for sample.
  • Loading branch information
zhumin8 committed Jul 19, 2024
1 parent e6aa0ab commit 001f5e4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ public static Sample composeClassHeaderSample(
TypeNode clientType,
Map<String, ResourceName> resourceNames,
Map<String, Message> messageTypes) {
if (service.methods().isEmpty()) {
return ServiceClientMethodSampleComposer.composeEmptyServiceSample(clientType, service);
}

// Use the first pure unary RPC method's sample code as showcase, if no such method exists, use
// the first method in the service's methods list.
Method method =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ void generateServiceClasses() {
Assert.assertCodeEquals(goldenFilePath, visitor.write());
}

@Test
void generateServiceClassesEmpty() {
GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho();
Service echoProtoService = context.services().get(1);
GapicClass clazz = ServiceClientClassComposer.instance().generate(context, echoProtoService);

JavaWriterVisitor visitor = new JavaWriterVisitor();
clazz.classDefinition().accept(visitor);
GoldenFileWriter.saveCodegenToFile(this.getClass(), "EchoEmpty.golden", visitor.write());
Path goldenFilePath =
Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "EchoEmpty.golden");
Assert.assertCodeEquals(goldenFilePath, visitor.write());
}

@Test
void generateServiceClassesWicked() {
GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked();
Expand Down

This file was deleted.

0 comments on commit 001f5e4

Please sign in to comment.