diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden index b1d8da085a..ed6f22313a 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/GrpcTestingStub.golden @@ -277,6 +277,7 @@ public class GrpcTestingStub extends TestingStub { params.put("name", String.valueOf(request.getName())); params.put( "test_to_verify.name", String.valueOf(request.getTestToVerify().getName())); + params.put("type", String.valueOf(request.getType())); return params.build(); } }) diff --git a/src/test/java/com/google/api/generator/gapic/composer/goldens/TestingClientTest.golden b/src/test/java/com/google/api/generator/gapic/composer/goldens/TestingClientTest.golden index f0dc05e18a..5c6dfb6a0e 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/goldens/TestingClientTest.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/goldens/TestingClientTest.golden @@ -481,6 +481,7 @@ public class TestingClientTest { Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); Assert.assertEquals(request.getFoo(), actualRequest.getFoo()); Assert.assertEquals(request.getTestToVerify(), actualRequest.getTestToVerify()); + Assert.assertEquals(request.getType(), actualRequest.getType()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), diff --git a/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java b/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java index f238f3e7cd..59a0775b69 100644 --- a/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java +++ b/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java @@ -70,7 +70,7 @@ public void parseHttpAnnotation_multipleBindings() { HttpRuleParser.parseHttpBindings(rpcMethod, inputMessage, messages); assertTrue(httpBindingsOpt.isPresent()); assertThat(httpBindingsOpt.get()) - .containsExactly("answer", "foo", "name", "test_to_verify.name"); + .containsExactly("answer", "foo", "name", "test_to_verify.name", "type"); } @Test diff --git a/src/test/java/com/google/api/generator/gapic/testdata/testing.proto b/src/test/java/com/google/api/generator/gapic/testdata/testing.proto index 28432bffaa..490e1d17cc 100644 --- a/src/test/java/com/google/api/generator/gapic/testdata/testing.proto +++ b/src/test/java/com/google/api/generator/gapic/testdata/testing.proto @@ -120,6 +120,8 @@ service Testing { post: "/v1beta1/{test_to_verify.name=sessions/*/tests/*}:check" body: "*" } + // Test enums in HTTP fields. + additional_bindings { post: "/v1beta1/{type}:check" body: "*" } }; } } @@ -410,6 +412,9 @@ message VerifyTestRequest { string foo = 4; Test test_to_verify = 5; + + // For testing enums in HTTP fields. + Issue.Type type = 6; } message VerifyTestResponse {