Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed May 29, 2024
1 parent 0e73927 commit dc542b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ protected static CodeGeneratorResponse write(
jos.finish();
jos.flush();

CodeGeneratorResponse.Builder responseBuilder = CodeGeneratorResponse.newBuilder();
responseBuilder
CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder();
response
.setSupportedFeatures(CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL_VALUE)
.addFileBuilder()
.setName(outputFilePath)
.setContentBytes(output.toByteString());
return responseBuilder.build();
return response.build();
}

public static CodeGeneratorResponse write(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import com.google.api.generator.engine.ast.ClassDefinition;
Expand Down Expand Up @@ -166,6 +167,11 @@ public void testEmptyGapicContext_doesNotThrow() {
Composer.composeServiceClasses(GapicContext.EMPTY);
}

@Test
public void testComposePackageInfo_emptyGapicContext_returnsNull() {
assertNull(Composer.composePackageInfo(GapicContext.EMPTY));
}

private List<GapicClass> getTestClassListFromService(Service testService) {
GapicClass testClass =
GrpcServiceCallableFactoryClassComposer.instance()
Expand Down

0 comments on commit dc542b3

Please sign in to comment.