From 56c7b90cfa6ca0651eb954ae84c844870e8e8c77 Mon Sep 17 00:00:00 2001 From: Mira Leung Date: Thu, 8 Oct 2020 13:42:35 -0700 Subject: [PATCH] fix: privately-scoped vars in ServiceClientTest codegen --- .../gapic/composer/ServiceClientTestClassComposer.java | 2 +- .../gapic/composer/goldens/EchoClientTest.golden | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/ServiceClientTestClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/ServiceClientTestClassComposer.java index efd9732e3b..c39c99a951 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/ServiceClientTestClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/ServiceClientTestClassComposer.java @@ -186,7 +186,7 @@ private static List createClassMemberFieldDecls( ExprStatement.withExpr( v.toBuilder() .setIsDecl(true) - .setScope(ScopeNode.PUBLIC) + .setScope(ScopeNode.PRIVATE) .setIsStatic(v.type().reference().name().startsWith("Mock")) .build())) .collect(Collectors.toList()); diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClientTest.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClientTest.golden index c1cf340662..1c026587a5 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClientTest.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoClientTest.golden @@ -37,10 +37,10 @@ import org.junit.Test; @Generated("by gapic-generator-java") public class EchoClientTest { - public static MockServiceHelper mockServiceHelper; - public static MockEcho mockEcho; - public EchoClient client; - public LocalChannelProvider channelProvider; + private static MockServiceHelper mockServiceHelper; + private static MockEcho mockEcho; + private EchoClient client; + private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() {