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 Feb 2, 2023
1 parent b7ca95f commit 70cc38d
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 @@ -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

0 comments on commit 70cc38d

Please sign in to comment.