Skip to content

Commit

Permalink
ci(showcase): disable rest_numeric_enum for showcase testing (#1284)
Browse files Browse the repository at this point in the history
* ci(showcase): disable rest_numeric_enum feature in showcase tests
  • Loading branch information
mpeddada1 authored and lqiu96 committed Feb 23, 2023
1 parent 316621c commit d8e488f
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 92 deletions.
4 changes: 3 additions & 1 deletion showcase/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ java_gapic_library(
srcs = [":showcase_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_grpc_service_config.json",
rest_numeric_enums = True,
# TODO(#1285): Enable rest_numeric_enums once https://github.com/googleapis/gapic-showcase/issues/1255 is
# fixed.
rest_numeric_enums = False,
service_yaml = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_v1beta1.yaml",
test_deps = [
":showcase_java_grpc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ public class HttpJsonComplianceStub extends ComplianceStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<RepeatRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<RepeatResponse>newBuilder()
Expand Down Expand Up @@ -128,12 +127,11 @@ public class HttpJsonComplianceStub extends ComplianceStub {
}
serializer.putQueryParam(
fields, "serverVerify", request.getServerVerify());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create().toBody("info", request.getInfo(), true))
ProtoRestSerializer.create().toBody("info", request.getInfo(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<RepeatResponse>newBuilder()
Expand Down Expand Up @@ -183,7 +181,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
}
serializer.putQueryParam(
fields, "serverVerify", request.getServerVerify());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -246,7 +243,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
}
serializer.putQueryParam(
fields, "serverVerify", request.getServerVerify());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -309,7 +305,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
}
serializer.putQueryParam(
fields, "serverVerify", request.getServerVerify());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -369,7 +364,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
}
serializer.putQueryParam(
fields, "serverVerify", request.getServerVerify());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -402,13 +396,12 @@ public class HttpJsonComplianceStub extends ComplianceStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<RepeatRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<RepeatResponse>newBuilder()
Expand Down Expand Up @@ -438,13 +431,12 @@ public class HttpJsonComplianceStub extends ComplianceStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<RepeatRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<RepeatResponse>newBuilder()
Expand Down Expand Up @@ -472,7 +464,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<EnumRequest> serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -504,7 +495,6 @@ public class HttpJsonComplianceStub extends ComplianceStub {
ProtoRestSerializer<EnumResponse> serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "continent", request.getContinentValue());
serializer.putQueryParam(fields, "request", request.getRequest());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,12 @@ public class HttpJsonEchoStub extends EchoStub {
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<EchoRequest> serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<EchoResponse>newBuilder()
Expand Down Expand Up @@ -129,13 +128,12 @@ public class HttpJsonEchoStub extends EchoStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<ExpandRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<EchoResponse>newBuilder()
Expand Down Expand Up @@ -165,13 +163,12 @@ public class HttpJsonEchoStub extends EchoStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<PagedExpandRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<PagedExpandResponse>newBuilder()
Expand Down Expand Up @@ -201,13 +198,12 @@ public class HttpJsonEchoStub extends EchoStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<PagedExpandLegacyRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<PagedExpandResponse>newBuilder()
Expand Down Expand Up @@ -237,13 +233,12 @@ public class HttpJsonEchoStub extends EchoStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<PagedExpandRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<PagedExpandLegacyMappedResponse>newBuilder()
Expand All @@ -270,13 +265,12 @@ public class HttpJsonEchoStub extends EchoStub {
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<WaitRequest> serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -306,13 +300,12 @@ public class HttpJsonEchoStub extends EchoStub {
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<BlockRequest> serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<BlockResponse>newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ public class HttpJsonIdentityStub extends IdentityStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<CreateUserRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), true))
.toBody("*", request.toBuilder().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<User>newBuilder()
Expand Down Expand Up @@ -114,7 +113,6 @@ public class HttpJsonIdentityStub extends IdentityStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<GetUserRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -148,12 +146,11 @@ public class HttpJsonIdentityStub extends IdentityStub {
ProtoRestSerializer<UpdateUserRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create().toBody("user", request.getUser(), true))
ProtoRestSerializer.create().toBody("user", request.getUser(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.<User>newBuilder()
Expand Down Expand Up @@ -183,7 +180,6 @@ public class HttpJsonIdentityStub extends IdentityStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<DeleteUserRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -218,7 +214,6 @@ public class HttpJsonIdentityStub extends IdentityStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down
Loading

0 comments on commit d8e488f

Please sign in to comment.