diff --git a/rules_bazel/java/integration_test.bzl b/rules_bazel/java/integration_test.bzl index 7e9dc60fdc..e030b5f817 100644 --- a/rules_bazel/java/integration_test.bzl +++ b/rules_bazel/java/integration_test.bzl @@ -23,7 +23,7 @@ def _diff_integration_goldens_impl(ctx): rm -rf $(find ./ -type f -name 'PlaceholderFile.java') rm -r $(find ./ -type d -empty) cd .. - diff -r --context=50 codegen_tmp test/integration/goldens/{api_name} > {diff_output} + diff -r codegen_tmp test/integration/goldens/{api_name} > {diff_output} # Bash `diff` command will return exit code 1 when there are differences between the two # folders. So we explicitly `exit 0` after the diff command to avoid build failure. exit 0 diff --git a/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java index 02b173b7e1..290e1edc7c 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java @@ -165,6 +165,7 @@ protected List createClassMemberFieldDecls( .setIsStatic(true) .build())) .collect(Collectors.toList())); + fieldDeclStatements.addAll( classMemberVarExprs.values().stream() .filter(v -> !isMockVarExprFn.apply(v)) diff --git a/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java b/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java index 1363210bfb..4930e52d2e 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java @@ -160,7 +160,7 @@ protected MethodDefinition createStartStaticServerMethod( varInitExprs.add(serviceToVarInitExprFn.apply(service)); mockServiceVarExprs.add(serviceToVarExprFn.apply(service)); // Careful: Java 8 and 11 make different ordering choices if this set is not explicitly sorted. - // In Java 11, lexicographic or insertion order is not preserved. + // Context: https://github.com/googleapis/gapic-generator-java/pull/750 for (Service mixinService : context.mixinServices().stream() .sorted((s1, s2) -> s2.name().compareTo(s1.name())) diff --git a/test/integration/apis/kms/v1/cloudkms_test_mixins_v1.yaml b/test/integration/apis/kms/v1/cloudkms_test_mixins_v1.yaml index f0f19000a7..7ce51316c7 100644 --- a/test/integration/apis/kms/v1/cloudkms_test_mixins_v1.yaml +++ b/test/integration/apis/kms/v1/cloudkms_test_mixins_v1.yaml @@ -16,13 +16,13 @@ documentation: Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. rules: - # This RPC shouldn't appear in the proto, since it's been cloberred by KMS's definition in the proto. + # This RPC shouldn't appear in the proto, since it's been clobered by KMS's definition in the proto. - selector: google.iam.v1.IAMPolicy.GetIamPolicy description: |- Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. - # This RPC shouldn't appear in the proto, since it's not in the HTTP rules list below, + # This RPC shouldn't appear in the proto, since it's not in the HTTP rules list below, # even though the documentation field is set. - selector: google.iam.v1.IAMPolicy.SetIamPolicy description: |-