Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(showcase): disable rest_numeric_enum for showcase testing #1284

Merged
merged 4 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -93,13 +93,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 @@ -128,13 +127,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 @@ -164,13 +162,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 @@ -200,13 +197,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 @@ -236,13 +232,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 @@ -269,13 +264,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 @@ -305,13 +299,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