From 1114f1863bf5ae15ee56631fd824a2269e91746d Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Mon, 13 May 2024 16:25:13 -0400 Subject: [PATCH 01/29] fix: prepare to generate grafeas (#2761) In this PR: - Add suffix to sample source folder - Add unit tests Context: - The package name of grafeas is `io.grafeas.v1` which is not starts with `com`. When copying samples to destination directory, we need to change the suffix of source directory. - grafeas doesn't have a valid api_id (empty string). Before this change, the `api_id` will be populated as `{library.api_shortname}.googleapis.com`, which is not correct. `api_id` should not be populated to `.repo-metadata.json` if set to empty string. With the library entry added in generation configuration: ``` - api_shortname: containeranalysis name_pretty: Grafeas product_documentation: https://grafeas.io api_description: n/a client_documentation: "https://cloud.google.com/java/docs/reference/grafeas/latest/overview" release_level: stable distribution_name: "io.grafeas:grafeas" api_id: "" codeowner_team: "@googleapis/aap-dpes" library_name: grafeas requires_billing: false GAPICs: - proto_path: grafeas/v1 ``` The generated java-grafeas is in https://github.com/googleapis/google-cloud-java/pull/10820 --- .../src/main/java/example_main.txt | 0 .../src/test/java/example_test.txt | 0 .../src/main/java/example_proto_main.txt | 0 .../src/main/java/com/example_com_sample.txt | 0 .../src/main/java/io/example_io_sample.txt | 0 .../test/utilities_unit_tests.py | 84 ++++++++++++++++--- library_generation/utils/utilities.sh | 13 ++- 7 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/main/java/example_main.txt create mode 100644 library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/test/java/example_test.txt create mode 100644 library_generation/test/resources/test_mv_src/proto/destination/java_gapic_srcjar/proto/src/main/java/example_proto_main.txt create mode 100644 library_generation/test/resources/test_mv_src/samples/destination_com/java_gapic_srcjar/samples/snippets/generated/src/main/java/com/example_com_sample.txt create mode 100644 library_generation/test/resources/test_mv_src/samples/destination_io/java_gapic_srcjar/samples/snippets/generated/src/main/java/io/example_io_sample.txt diff --git a/library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/main/java/example_main.txt b/library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/main/java/example_main.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/test/java/example_test.txt b/library_generation/test/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/test/java/example_test.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library_generation/test/resources/test_mv_src/proto/destination/java_gapic_srcjar/proto/src/main/java/example_proto_main.txt b/library_generation/test/resources/test_mv_src/proto/destination/java_gapic_srcjar/proto/src/main/java/example_proto_main.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library_generation/test/resources/test_mv_src/samples/destination_com/java_gapic_srcjar/samples/snippets/generated/src/main/java/com/example_com_sample.txt b/library_generation/test/resources/test_mv_src/samples/destination_com/java_gapic_srcjar/samples/snippets/generated/src/main/java/com/example_com_sample.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library_generation/test/resources/test_mv_src/samples/destination_io/java_gapic_srcjar/samples/snippets/generated/src/main/java/io/example_io_sample.txt b/library_generation/test/resources/test_mv_src/samples/destination_io/java_gapic_srcjar/samples/snippets/generated/src/main/java/io/example_io_sample.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library_generation/test/utilities_unit_tests.py b/library_generation/test/utilities_unit_tests.py index 736eba26e4..96c03087fa 100644 --- a/library_generation/test/utilities_unit_tests.py +++ b/library_generation/test/utilities_unit_tests.py @@ -102,6 +102,65 @@ def test_sh_util_nonexistent_function_fails(self): with self.assertRaises(RuntimeError): result = util.sh_util("nonexistent_function") + def test_mv_src_files_gapic_main_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/gapic") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files gapic main destination") + self.assertTrue( + os.path.isfile("destination/gapic-example/src/main/java/example_main.txt") + ) + shutil.rmtree("destination/gapic-example") + os.chdir(previous_dir) + + def test_mv_src_files_gapic_test_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/gapic") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files gapic test destination") + self.assertTrue( + os.path.isfile("destination/gapic-example/src/test/java/example_test.txt") + ) + shutil.rmtree("destination/gapic-example") + os.chdir(previous_dir) + + def test_mv_src_files_proto_main_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/proto") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files proto main destination") + self.assertTrue( + os.path.isfile( + "destination/proto-example/src/main/java/example_proto_main.txt" + ) + ) + shutil.rmtree("destination/proto-example") + os.chdir(previous_dir) + + def test_mv_src_files_sample_suffix_io_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/samples") + util.sh_util("mv_src_files samples main destination_io") + self.assertTrue( + os.path.isfile( + "destination_io/samples/snippets/generated/io/example_io_sample.txt" + ) + ) + shutil.rmtree("destination_io/samples") + os.chdir(previous_dir) + + def test_mv_src_files_sample_suffix_com_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/samples") + util.sh_util("mv_src_files samples main destination_com") + self.assertTrue( + os.path.isfile( + "destination_com/samples/snippets/generated/com/example_com_sample.txt" + ) + ) + shutil.rmtree("destination_com/samples") + os.chdir(previous_dir) + def test_eprint_valid_input_succeeds(self): test_input = "This is some test input" # create a stdio capture object @@ -247,7 +306,7 @@ def test_gapic_inputs_parse_no_service_yaml_returns_empty_string(self): def test_generate_prerequisite_files_non_monorepo_success(self): library_path = self.__setup_prerequisite_files( - num_libraries=1, library_type="GAPIC_COMBO" + combination=1, library_type="GAPIC_COMBO" ) file_comparator.compare_files( @@ -266,7 +325,7 @@ def test_generate_prerequisite_files_non_monorepo_success(self): self.__remove_prerequisite_files(path=library_path, is_monorepo=False) def test_generate_prerequisite_files_monorepo_success(self): - library_path = self.__setup_prerequisite_files(num_libraries=2) + library_path = self.__setup_prerequisite_files(combination=2) file_comparator.compare_files( f"{library_path}/.repo-metadata.json", @@ -317,7 +376,10 @@ def test_prepare_repo_split_repo_success(self): shutil.rmtree(repo_config.output_folder) def __setup_prerequisite_files( - self, num_libraries: int, library_type: str = "GAPIC_AUTO" + self, + combination: int, + library_type: str = "GAPIC_AUTO", + library: LibraryConfig = library_1, ) -> str: library_path = f"{resources_dir}/goldens" files = [ @@ -326,12 +388,12 @@ def __setup_prerequisite_files( f"{library_path}/owlbot.py", ] cleanup(files) - config = self.__get_a_gen_config(num_libraries, library_type=library_type) + config = self.__get_a_gen_config(combination, library_type=library_type) proto_path = "google/cloud/baremetalsolution/v2" transport = "grpc" util.generate_prerequisite_files( config=config, - library=library_1, + library=library, proto_path=proto_path, transport=transport, library_path=library_path, @@ -340,20 +402,20 @@ def __setup_prerequisite_files( @staticmethod def __get_a_gen_config( - num_libraries: int, library_type: str = "GAPIC_AUTO" + combination: int, library_type: str = "GAPIC_AUTO" ) -> GenerationConfig: """ Returns an object of GenerationConfig with one to three of LibraryConfig objects. Other attributes are set to empty str. - :param num_libraries: the number of LibraryConfig objects associated with + :param combination: combination of LibraryConfig objects associated with the GenerationConfig. Only support 1, 2 or 3. :return: an object of GenerationConfig """ - if num_libraries == 2: + if combination == 2: libraries = [library_1, library_2] - elif num_libraries == 3: - libraries = [library_1, library_2, library_3] + elif combination == 3: + libraries = [library_with_empty_api_id, library_2] else: libraries = [library_1] @@ -361,7 +423,7 @@ def __get_a_gen_config( # library_type) for library in libraries: library.library_type = library_type - if num_libraries == 1: + if combination == 1: # treat this as a HW library case to generate a real-life # repo-metadata library.extra_versioned_modules = "test-module" diff --git a/library_generation/utils/utilities.sh b/library_generation/utils/utilities.sh index 16ad766ce5..237d3c23a9 100755 --- a/library_generation/utils/utilities.sh +++ b/library_generation/utils/utilities.sh @@ -32,8 +32,10 @@ mv_src_files() { local type=$2 # one of main, test local destination_path=$3 if [ "${category}" == "samples" ]; then - src_suffix="samples/snippets/generated/src/main/java/com" + src_suffix="samples/snippets/generated/src/main/java" folder_suffix="samples/snippets/generated" + mkdir -p "${destination_path}/${folder_suffix}" + cp -r "${destination_path}/java_gapic_srcjar/${src_suffix}"/* "${destination_path}/${folder_suffix}" elif [ "${category}" == "proto" ]; then src_suffix="${category}/src/${type}/java" folder_suffix="${category}-${folder_name}/src/${type}" @@ -41,11 +43,14 @@ mv_src_files() { src_suffix="src/${type}" folder_suffix="${category}-${folder_name}/src" fi + + if [ "${category}" == "samples" ]; then + return + fi + mkdir -p "${destination_path}/${folder_suffix}" cp -r "${destination_path}/java_gapic_srcjar/${src_suffix}" "${destination_path}/${folder_suffix}" - if [ "${category}" != "samples" ]; then - rm -r -f "${destination_path}/${folder_suffix}/java/META-INF" - fi + rm -r -f "${destination_path}/${folder_suffix}/java/META-INF" } # unzip jar file From d67eaf85c409dc7cf653dfb6d753d39a77292135 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 15:02:45 +0200 Subject: [PATCH 02/29] deps: update dependency jinja2 to v3.1.4 [security] (#2742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [Jinja2](https://togithub.com/pallets/jinja) ([changelog](https://jinja.palletsprojects.com/changes/)) | `==3.1.3` -> `==3.1.4` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/Jinja2/3.1.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/Jinja2/3.1.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/Jinja2/3.1.3/3.1.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/Jinja2/3.1.3/3.1.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. ### GitHub Vulnerability Alerts #### [CVE-2024-34064](https://togithub.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj) The `xmlattr` filter in affected versions of Jinja accepts keys containing non-attribute characters. XML/HTML attributes cannot contain spaces, `/`, `>`, or `=`, as each would then be interpreted as starting a separate attribute. If an application accepts keys (as opposed to only values) as user input, and renders these in pages that other users see as well, an attacker could use this to inject other attributes and perform XSS. The fix for the previous GHSA-h5c8-rqwp-cp95 CVE-2024-22195 only addressed spaces but not other characters. Accepting keys as user input is now explicitly considered an unintended use case of the `xmlattr` filter, and code that does so without otherwise validating the input should be flagged as insecure, regardless of Jinja version. Accepting _values_ as user input continues to be safe. --- ### Release Notes
pallets/jinja (Jinja2) ### [`v3.1.4`](https://togithub.com/pallets/jinja/blob/HEAD/CHANGES.rst#Version-314) [Compare Source](https://togithub.com/pallets/jinja/compare/3.1.3...3.1.4) Released 2024-05-05 - The `xmlattr` filter does not allow keys with `/` solidus, `>` greater-than sign, or `=` equals sign, in addition to disallowing spaces. Regardless of any validation done by Jinja, user input should never be used as keys to this filter, or must be separately validated first. :ghsa:`h75v-3vvj-5mfj`
--- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- library_generation/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library_generation/requirements.txt b/library_generation/requirements.txt index 387b83a755..ad0e77b389 100644 --- a/library_generation/requirements.txt +++ b/library_generation/requirements.txt @@ -5,7 +5,7 @@ black==24.4.2 click==8.1.7 gitdb==4.0.11 GitPython==3.1.43 -Jinja2==3.1.3 +Jinja2==3.1.4 lxml==5.2.1 MarkupSafe==2.1.5 mypy-extensions==1.0.0 From df7e211e534516f9596e230598b70fdbfdea1ac3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 15:31:00 +0200 Subject: [PATCH 03/29] deps: update dependency lxml to v5.2.2 (#2766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [lxml](https://lxml.de/) ([source](https://togithub.com/lxml/lxml), [changelog](https://git.launchpad.net/lxml/plain/CHANGES.txt)) | `==5.2.1` -> `==5.2.2` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
lxml/lxml (lxml) ### [`v5.2.2`](https://togithub.com/lxml/lxml/blob/HEAD/CHANGES.txt#522-2024--) [Compare Source](https://togithub.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2) \================== ## Bugs fixed - [GH#417](https://togithub.com/GH/lxml/issues/417): The `test_feed_parser` test could fail if `lxml_html_clean` was not installed. It is now skipped in that case. - [LP#2059910](https://togithub.com/LP/lxml/issues/2059910): The minimum CPU architecture for the Linux x86 binary wheels was set back to "core2", without SSE 4.2. - If libxml2 uses iconv, the compile time version is available as `etree.ICONV_COMPILED_VERSION`.
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- library_generation/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library_generation/requirements.txt b/library_generation/requirements.txt index ad0e77b389..51c8289ad2 100644 --- a/library_generation/requirements.txt +++ b/library_generation/requirements.txt @@ -6,7 +6,7 @@ click==8.1.7 gitdb==4.0.11 GitPython==3.1.43 Jinja2==3.1.4 -lxml==5.2.1 +lxml==5.2.2 MarkupSafe==2.1.5 mypy-extensions==1.0.0 packaging==23.2 From 891b01d0d35384df3269cdd8b37102b2587c9188 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 19:12:04 +0200 Subject: [PATCH 04/29] deps: update dependency com.fasterxml.jackson:jackson-bom to v2.17.1 (#2732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.fasterxml.jackson:jackson-bom](https://togithub.com/FasterXML/jackson-bom) | `2.17.0` -> `2.17.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.fasterxml.jackson:jackson-bom/2.17.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.fasterxml.jackson:jackson-bom/2.17.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.fasterxml.jackson:jackson-bom/2.17.0/2.17.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.fasterxml.jackson:jackson-bom/2.17.0/2.17.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- java-shared-dependencies/third-party-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index e6dccf5fd2..b6aff494a2 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -27,7 +27,7 @@ 1.23 0.31.1 3.0.2 - 2.17.0 + 2.17.1 2.27.1 1.16.1 4.4.16 From 22b7398f07a77935c0c002c78e8e30dca5979652 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 20:00:54 +0200 Subject: [PATCH 05/29] deps: update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0 (#2768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.oauth-client:google-oauth-client-bom](https://togithub.com/googleapis/google-oauth-java-client/tree/master/google-oauth-client-bom) ([source](https://togithub.com/googleapis/google-oauth-java-client)) | `1.35.0` -> `1.36.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/google-oauth-java-client (com.google.oauth-client:google-oauth-client-bom) ### [`v1.36.0`](https://togithub.com/googleapis/google-oauth-java-client/blob/HEAD/CHANGELOG.md#1360-2024-05-10) [Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.35.0...v1.36.0) ##### Features - Servlet classes that use the jakarta namespace ([#​1115](https://togithub.com/googleapis/google-oauth-java-client/issues/1115)) ([11d6a3c](https://togithub.com/googleapis/google-oauth-java-client/commit/11d6a3cb30c4ebfe4fc4e196d99f5764c6ade878))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- java-shared-dependencies/first-party-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index 4f1e8fabd2..f90b6e4a1b 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -23,7 +23,7 @@ UTF-8 ${project.artifactId} 1.5.0 - 1.35.0 + 1.36.0 2.4.0 From 0a5c7c4075ee986028535c424e4a62458a25f8d2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 21:00:46 +0200 Subject: [PATCH 06/29] deps: update opentelemetry-java monorepo to v1.38.0 (#2769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.opentelemetry:opentelemetry-api](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-bom](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
open-telemetry/opentelemetry-java (io.opentelemetry:opentelemetry-api) ### [`v1.38.0`](https://togithub.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1380-2024-05-10) ##### API - Stabilize synchronous gauge ([#​6419](https://togithub.com/open-telemetry/opentelemetry-java/pull/6419)) ##### Incubator - Add put(AttributeKey, T) overload to EventBuilder ([#​6331](https://togithub.com/open-telemetry/opentelemetry-java/pull/6331)) ##### Baggage - Baggage filters space-only keys ([#​6431](https://togithub.com/open-telemetry/opentelemetry-java/pull/6431)) ##### SDK - Add experimental scope config to enable / disable scopes (i.e. meter, logger, tracer) ([#​6375](https://togithub.com/open-telemetry/opentelemetry-java/pull/6375)) ##### Traces - Add ReadableSpan#getAttributes ([#​6382](https://togithub.com/open-telemetry/opentelemetry-java/pull/6382)) - Use standard ArrayList size rather than max number of links for initial span links allocation ([#​6252](https://togithub.com/open-telemetry/opentelemetry-java/pull/6252)) ##### Metrics - Use low precision Clock#now when computing timestamp for exemplars ([#​6417](https://togithub.com/open-telemetry/opentelemetry-java/pull/6417)) - Update invalid instrument name log message now that forward slash `/` is valid ([#​6343](https://togithub.com/open-telemetry/opentelemetry-java/pull/6343)) ##### Exporters - Introduce low allocation OTLP marshalers. If using autoconfigure, opt in via `OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=REUSABLE_DATA`. - Low allocation OTLP logs marshaler ([#​6429](https://togithub.com/open-telemetry/opentelemetry-java/pull/6429)) - Low allocation OTLP metrics marshaler ([#​6422](https://togithub.com/open-telemetry/opentelemetry-java/pull/6422)) - Low allocation OTLP trace marshaler ([#​6410](https://togithub.com/open-telemetry/opentelemetry-java/pull/6410)) - Add memory mode support to OTLP exporters ([#​6430](https://togithub.com/open-telemetry/opentelemetry-java/pull/6430)) - Marshal span status description without allocation ([#​6423](https://togithub.com/open-telemetry/opentelemetry-java/pull/6423)) - Add private constructors for stateless marshalers ([#​6434](https://togithub.com/open-telemetry/opentelemetry-java/pull/6434)) - Mark opentelemetry-exporter-sender-jdk stable ([#​6357](https://togithub.com/open-telemetry/opentelemetry-java/pull/6357)) - PrometheusHttpServer prevent concurrent reads when reusable memory mode ([#​6371](https://togithub.com/open-telemetry/opentelemetry-java/pull/6371)) - Ignore TLS components (SSLContext, TrustManager, KeyManager) if plain HTTP protocol is used for exporting ([#​6329](https://togithub.com/open-telemetry/opentelemetry-java/pull/6329)) - Add is_remote_parent span flags to OTLP exported Spans and SpanLinks ([#​6388](https://togithub.com/open-telemetry/opentelemetry-java/pull/6388)) - Add missing fields to OTLP metric exporters `toString()` ([#​6402](https://togithub.com/open-telemetry/opentelemetry-java/pull/6402)) ##### Extensions - Rename otel.config.file to otel.experimental.config.file for autoconfigure ([#​6396](https://togithub.com/open-telemetry/opentelemetry-java/pull/6396)) ##### OpenCensus Shim - Fix opencensus shim spanBuilderWithRemoteParent behavior ([#​6415](https://togithub.com/open-telemetry/opentelemetry-java/pull/6415)) ##### Tooling - Add additional API incubator docs ([#​6356](https://togithub.com/open-telemetry/opentelemetry-java/pull/6356)) - Run build on java 21 ([#​6370](https://togithub.com/open-telemetry/opentelemetry-java/pull/6370)) - Fix running tests with java 8 on macos ([#​6411](https://togithub.com/open-telemetry/opentelemetry-java/pull/6411)) - Move away from deprecated gradle enterprise APIs ([#​6363](https://togithub.com/open-telemetry/opentelemetry-java/pull/6363))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/dependencies.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 2157e1f410..b0992283d5 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -32,7 +32,7 @@ 2.10.1 33.1.0-jre 3.25.3 - 1.37.0 + 1.38.0 8 2.27.1 3.0.0 diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 7dc4cf0e9a..a5b1c1bc17 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -39,7 +39,7 @@ maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-g maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.37.1 maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.23.0 maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.23.0 -maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.37.0 +maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.38.0 maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1 maven.io_opencensus_opencensus_contrib_grpc_metrics=io.opencensus:opencensus-contrib-grpc-metrics:0.31.1 maven.io_opencensus_opencensus_contrib_http_util=io.opencensus:opencensus-contrib-http-util:0.31.1 From a39aa07d013c9c097ad93fd68cf97da1c7d9ff03 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 21:28:05 +0200 Subject: [PATCH 07/29] deps: update dependency com.google.cloud:grpc-gcp to v1.6.0 (#2767) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:grpc-gcp](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java/tree/master/grpc-gcp) ([source](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java)) | `1.5.0` -> `1.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> --- java-shared-dependencies/first-party-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index f90b6e4a1b..fb20d5b454 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -22,7 +22,7 @@ UTF-8 ${project.artifactId} - 1.5.0 + 1.6.0 1.36.0 2.4.0 From 3d7ab40311ccebc881bb5cbed7cf150355133f78 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 21:47:04 +0200 Subject: [PATCH 08/29] test(deps): update dependency org.mockito:mockito-core to v5.12.0 (#2770) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `5.11.0` -> `5.12.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
mockito/mockito (org.mockito:mockito-core) ### [`v5.12.0`](https://togithub.com/mockito/mockito/releases/tag/v5.12.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 5.12.0 - 2024-05-11 - [25 commit(s)](https://togithub.com/mockito/mockito/compare/v5.11.0...v5.12.0) by Piotr Przybylak, Stefano Cordio, Tim van der Lippe, dependabot\[bot], jonghoonpark - Bump com.gradle.enterprise from 3.17.2 to 3.17.3 [(#​3341)](https://togithub.com/mockito/mockito/pull/3341) - Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.23 to 1.9.24 [(#​3339)](https://togithub.com/mockito/mockito/pull/3339) - Bump versions.bytebuddy from 1.14.14 to 1.14.15 [(#​3338)](https://togithub.com/mockito/mockito/pull/3338) - Bump org.shipkit:shipkit-auto-version from 2.0.6 to 2.0.7 [(#​3337)](https://togithub.com/mockito/mockito/pull/3337) - Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.23 to 1.9.24 [(#​3336)](https://togithub.com/mockito/mockito/pull/3336) - Fixes [#​3331](https://togithub.com/mockito/mockito/issues/3331) : Fix `AdditionalMatchers.and()` and `AdditionalMatchers.or()` not to swap the order of matchers [(#​3335)](https://togithub.com/mockito/mockito/pull/3335) - AdditionalMatchers.and() and or() swap matcher order [(#​3331)](https://togithub.com/mockito/mockito/issues/3331) - Bump gradle/wrapper-validation-action from 3.3.1 to 3.3.2 [(#​3327)](https://togithub.com/mockito/mockito/pull/3327) - Bump versions.bytebuddy from 1.14.13 to 1.14.14 [(#​3324)](https://togithub.com/mockito/mockito/pull/3324) - Bump org.shipkit:shipkit-auto-version from 2.0.5 to 2.0.6 [(#​3322)](https://togithub.com/mockito/mockito/pull/3322) - Bump gradle/wrapper-validation-action from 3.3.0 to 3.3.1 [(#​3320)](https://togithub.com/mockito/mockito/pull/3320) - Bump com.gradle.enterprise from 3.17 to 3.17.2 [(#​3318)](https://togithub.com/mockito/mockito/pull/3318) - Bump gradle/wrapper-validation-action from 2.1.2 to 3.3.0 [(#​3317)](https://togithub.com/mockito/mockito/pull/3317) - Update codecov-action version [(#​3316)](https://togithub.com/mockito/mockito/pull/3316) - Bump com.google.googlejavaformat:google-java-format from 1.21.0 to 1.22.0 [(#​3312)](https://togithub.com/mockito/mockito/pull/3312) - Bump com.gradle.enterprise from 3.16.2 to 3.17 [(#​3311)](https://togithub.com/mockito/mockito/pull/3311) - Bump versions.bytebuddy from 1.14.12 to 1.14.13 [(#​3308)](https://togithub.com/mockito/mockito/pull/3308) - Fix README logo [(#​3305)](https://togithub.com/mockito/mockito/pull/3305) - Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2 [(#​3303)](https://togithub.com/mockito/mockito/pull/3303) - Bump org.shipkit:shipkit-auto-version from 2.0.4 to 2.0.5 [(#​3298)](https://togithub.com/mockito/mockito/pull/3298) - Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 1.9.23 [(#​3296)](https://togithub.com/mockito/mockito/pull/3296) - Bump org.eclipse.platform:org.eclipse.osgi from 3.18.600 to 3.19.0 [(#​3295)](https://togithub.com/mockito/mockito/pull/3295) - Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23 [(#​3292)](https://togithub.com/mockito/mockito/pull/3292) - Bump com.google.googlejavaformat:google-java-format from 1.20.0 to 1.21.0 [(#​3291)](https://togithub.com/mockito/mockito/pull/3291) - Fixes [#​3286](https://togithub.com/mockito/mockito/issues/3286) : Mockito.only() points to the wanted call as unwanted if it is the first being calledIssue3286 [(#​3287)](https://togithub.com/mockito/mockito/pull/3287) - Mockito.only() points to the wanted call as unwanted if it is the first being called. [(#​3286)](https://togithub.com/mockito/mockito/issues/3286) - Bump org.codehaus.groovy:groovy from 3.0.20 to 3.0.21 [(#​3284)](https://togithub.com/mockito/mockito/pull/3284)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> --- java-shared-dependencies/dependency-analyzer/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-shared-dependencies/dependency-analyzer/pom.xml b/java-shared-dependencies/dependency-analyzer/pom.xml index 8e8508a706..e58eb6b573 100644 --- a/java-shared-dependencies/dependency-analyzer/pom.xml +++ b/java-shared-dependencies/dependency-analyzer/pom.xml @@ -56,7 +56,7 @@ org.mockito mockito-core - 5.11.0 + 5.12.0 test From b87356c1d80559fd5ca85ee0edfa3e5f24db6b17 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 21:48:59 +0200 Subject: [PATCH 09/29] deps: update dependency commons-codec:commons-codec to v1.17.0 (#2710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [commons-codec:commons-codec](https://commons.apache.org/proper/commons-codec/) ([source](https://togithub.com/apache/commons-codec)) | `1.16.1` -> `1.17.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/commons-codec:commons-codec/1.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/commons-codec:commons-codec/1.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/commons-codec:commons-codec/1.16.1/1.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/commons-codec:commons-codec/1.16.1/1.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
apache/commons-codec (commons-codec:commons-codec) ### [`v1.17.0`](https://togithub.com/apache/commons-codec/blob/HEAD/RELEASE-NOTES.txt#Apache-Commons-Codec-1170-RELEASE-NOTES) The Apache Commons Codec component contains encoder and decoders for various formats such as Base16, Base32, Base64, digest, and Hexadecimal. In addition to these widely used encoders and decoders, the codec package also maintains a collection of phonetic encoding utilities. Feature and fix release. Requires a minimum of Java 8.
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- java-shared-dependencies/third-party-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index b6aff494a2..081410c65f 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -29,7 +29,7 @@ 3.0.2 2.17.1 2.27.1 - 1.16.1 + 1.17.0 4.4.16 4.5.14 From 908db6f453b1915e2fd4097d5cf639f054829c39 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 22:00:27 +0200 Subject: [PATCH 10/29] deps: update googleapis/java-cloud-bom digest to db4265f (#2755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | googleapis/java-cloud-bom | action | digest | `f3c611a` -> `db4265f` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 16bd20a361..01b2a3188c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -327,7 +327,7 @@ jobs: run: | mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip - name: Validate gapic-generator-java-bom - uses: googleapis/java-cloud-bom/tests/validate-bom@f3c611a09b556e81029d5588afe22ca6a15b0cef + uses: googleapis/java-cloud-bom/tests/validate-bom@db4265ffa7e23c64ae37d9804394569e4577b3e2 with: bom-path: gapic-generator-java-bom/pom.xml From a4726206146a503822f685caa1e4d04273b738dc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 22:47:36 +0200 Subject: [PATCH 11/29] deps: update dependency net.bytebuddy:byte-buddy to v1.14.15 (#2753) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [net.bytebuddy:byte-buddy](https://bytebuddy.net) | `1.14.14` -> `1.14.15` | [![age](https://developer.mend.io/api/mc/badges/age/maven/net.bytebuddy:byte-buddy/1.14.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/net.bytebuddy:byte-buddy/1.14.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/net.bytebuddy:byte-buddy/1.14.14/1.14.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.bytebuddy:byte-buddy/1.14.14/1.14.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gax-java/dependencies.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index a5b1c1bc17..4f50fa9904 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -83,5 +83,5 @@ maven.org_mockito_mockito_core=org.mockito:mockito-core:2.28.2 maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3 maven.com_google_truth_truth=com.google.truth:truth:1.4.2 maven.com_googlecode_java_diff_utils_diffutils=com.googlecode.java-diff-utils:diffutils:1.3.0 -maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.14.14 +maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.14.15 maven.org_objenesis_objenesis=org.objenesis:objenesis:2.6 From 4e31d7dd917c76229c3cfe18b0f98d561c9f7d3b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 May 2024 22:57:06 +0200 Subject: [PATCH 12/29] deps: update dependency com.google.errorprone:error_prone_annotations to v2.27.1 (#2709) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://togithub.com/google/error-prone)) | `2.26.1` -> `2.27.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.errorprone:error_prone_annotations/2.27.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.errorprone:error_prone_annotations/2.27.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.errorprone:error_prone_annotations/2.26.1/2.27.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.errorprone:error_prone_annotations/2.26.1/2.27.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
google/error-prone (com.google.errorprone:error_prone_annotations) ### [`v2.27.1`](https://togithub.com/google/error-prone/releases/tag/v2.27.1): Error Prone 2.27.1 [Compare Source](https://togithub.com/google/error-prone/compare/v2.27.0...v2.27.1) This release contains all of the changes in [2.27.0](https://togithub.com/google/error-prone/releases/tag/v2.27.0), plus a bug fix to [`ClassInitializationDeadlock`](https://errorprone.info/bugpattern/ClassInitializationDeadlock) ([https://github.com/google/error-prone/issues/4378](https://togithub.com/google/error-prone/issues/4378)) Full Changelog: https://github.com/google/error-prone/compare/v2.27.0...v2.27.1 ### [`v2.27.0`](https://togithub.com/google/error-prone/releases/tag/v2.27.0): Error Prone 2.27.0 [Compare Source](https://togithub.com/google/error-prone/compare/v2.26.1...v2.27.0) New checks: - [`ClassInitializationDeadlock`](https://errorprone.info/bugpattern/ClassInitializationDeadlock) detects class initializers that reference subtypes of the current class, which can result in deadlocks. - [`MockitoDoSetup`](https://errorprone.info/bugpattern/MockitoDoSetup) suggests using `when`/`thenReturn` over `doReturn`/`when` for additional type safety. - [`VoidUsed`](https://errorprone.info/bugpattern/VoidUsed) suggests using a literal `null` instead of referring to a `Void`-typed variable. Modified checks: - `TruthSelfEquals` has been renamed and generalized as [`SelfAssertion`](https://errorprone.info/bugpattern/SelfAssertion) - [`RedundantSetterCall`](https://errorprone.info/bugpattern/RedundantSetterCall) has been improved, and enabled as an error oby default Closed issues: [#​4291](https://togithub.com/google/error-prone/issues/4291). [#​4308](https://togithub.com/google/error-prone/issues/4308), [#​4343](https://togithub.com/google/error-prone/issues/4343), [#​4320](https://togithub.com/google/error-prone/issues/4320) Full Changelog: https://github.com/google/error-prone/compare/v2.26.1...v2.27.0
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gax-java/dependencies.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 4f50fa9904..ba75434727 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -63,7 +63,7 @@ maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.2 maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.14.0 maven.com_google_android_annotations=com.google.android:annotations:4.1.1.4 maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.2 -maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.26.1 +maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.27.1 maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:2.8 maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.10.4 maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.10.4 From 986c090a043f06ef98c9787cedf3c89cf7365017 Mon Sep 17 00:00:00 2001 From: Blake Li Date: Tue, 14 May 2024 22:28:16 -0400 Subject: [PATCH 13/29] fix: Replace deprecated protobuf methods. (#2764) `isSynthetic()` is deprecated and will be [removed](https://github.com/protocolbuffers/protobuf/commit/1aeacd4f4eb4e0aa05d6336e2988a565e475e9a0#diff-2228551d02c6661809ca7103db9512eef4c2d01f35556d42316543d92a89edefL2846-L2847) in protobuf-java 4.26.0, replace it so that we can prepare for protobuf-java upgrade. Per [official doc](https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md) of protobuf, an optional field is implemented as a "synthetic" oneof field internally. Also see b/266950618#comment123 for suggested replacements of `isSynthetic()`. --- .../com/google/api/generator/gapic/protoparser/Parser.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java index c7d0b95a3d..747faa25c3 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java @@ -1063,12 +1063,10 @@ private static Field parseField( .setType(TypeParser.parseType(fieldDescriptor)) .setIsMessage(fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) .setIsEnum(fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.ENUM) - .setIsContainedInOneof( - fieldDescriptor.getContainingOneof() != null - && !fieldDescriptor.getContainingOneof().isSynthetic()) + .setIsContainedInOneof(fieldDescriptor.getRealContainingOneof() != null) .setIsProto3Optional( fieldDescriptor.getContainingOneof() != null - && fieldDescriptor.getContainingOneof().isSynthetic()) + && fieldDescriptor.getRealContainingOneof() == null) .setIsRepeated(fieldDescriptor.isRepeated()) .setIsRequired(isRequired) .setFieldInfoFormat(fieldInfoFormat) From 96e6626eb2dda867b5d8d81f3ec706b5a995a3c2 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Wed, 15 May 2024 10:47:06 -0400 Subject: [PATCH 14/29] chore: remove platformdirs (#2774) In this PR: - Remove a redundant dependency, `platformdirs`. --- library_generation/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/library_generation/requirements.txt b/library_generation/requirements.txt index 51c8289ad2..9b5d9d200e 100644 --- a/library_generation/requirements.txt +++ b/library_generation/requirements.txt @@ -11,7 +11,6 @@ MarkupSafe==2.1.5 mypy-extensions==1.0.0 packaging==23.2 pathspec==0.12.1 -platformdirs==4.2.1 PyYAML==6.0.1 smmap==5.0.1 typing==3.7.4.3 From 26322b21547db7b76b31702f48d6fb124c6822a6 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Wed, 15 May 2024 17:53:18 -0400 Subject: [PATCH 15/29] chore: exclude `prediction.proto` (#2775) In this PR: - Exclude `google/cloud/visionai/v1/prediction.proto` until cl/631529749 is submitted Test generated client in https://github.com/googleapis/google-cloud-java/pull/10845. --- library_generation/generate_library.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library_generation/generate_library.sh b/library_generation/generate_library.sh index 88c2052b56..f6875bfe6d 100755 --- a/library_generation/generate_library.sh +++ b/library_generation/generate_library.sh @@ -170,6 +170,12 @@ case "${proto_path}" in # and //google/cloud/oslogin/v1beta1:google-cloud-oslogin-v1-java proto_files="${proto_files} google/cloud/oslogin/common/common.proto" ;; + "google/cloud/visionai/v1"*) + # this proto is excluded in //google/cloud/visionai/v1:google-cloud-visionai-v1-java + # we can remove this exclusion after cl/631529749 is submitted. + removed_proto="google/cloud/visionai/v1/prediction.proto" + proto_files="${proto_files//${removed_proto}/}" + ;; "google/rpc") # this proto is excluded from //google/rpc:google-rpc-java removed_proto="google/rpc/http.proto" From dadb6b99c50a7915b2f9f6cc713a81253519ff46 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 09:39:39 -0400 Subject: [PATCH 16/29] chore(main): release 2.40.1 (#2729) :robot: I have created a release *beep* *boop* ---
2.40.1 ## [2.40.1](https://github.com/googleapis/sdk-platform-java/compare/v2.40.0...v2.40.1) (2024-05-15) ### Bug Fixes * [common-protos] An existing method `UpdateVehicleLocation` is ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) * [common-protos] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2751](https://github.com/googleapis/sdk-platform-java/issues/2751)) ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) * [iam] An existing method `UpdateVehicleLocation` is removed from ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) * [iam] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2752](https://github.com/googleapis/sdk-platform-java/issues/2752)) ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) * do not populate repo level change while removing library ([#2740](https://github.com/googleapis/sdk-platform-java/issues/2740)) ([43e62b9](https://github.com/googleapis/sdk-platform-java/commit/43e62b998958abd4ca96b83800380c9696ff693f)) * only append `.api.grpc` suffix to group id if the artifact id starts with `proto-` or `grpc-` ([#2731](https://github.com/googleapis/sdk-platform-java/issues/2731)) ([8e87b2e](https://github.com/googleapis/sdk-platform-java/commit/8e87b2e9a28a1797efb2eea531d25094b4438e0d)) * opentelemetry-bom to be in third-party-dependencies BOM ([#2736](https://github.com/googleapis/sdk-platform-java/issues/2736)) ([4ecc89b](https://github.com/googleapis/sdk-platform-java/commit/4ecc89bfff1a83e501b2fdc5a04bba47d83a7c00)) * prepare to generate grafeas ([#2761](https://github.com/googleapis/sdk-platform-java/issues/2761)) ([1114f18](https://github.com/googleapis/sdk-platform-java/commit/1114f1863bf5ae15ee56631fd824a2269e91746d)) * Replace deprecated protobuf methods. ([#2764](https://github.com/googleapis/sdk-platform-java/issues/2764)) ([986c090](https://github.com/googleapis/sdk-platform-java/commit/986c090a043f06ef98c9787cedf3c89cf7365017)) ### Dependencies * update dependency black to v24.4.2 ([#2660](https://github.com/googleapis/sdk-platform-java/issues/2660)) ([1cbb681](https://github.com/googleapis/sdk-platform-java/commit/1cbb681f3f395afee4be63cd6b96fefda7083d97)) * update dependency com.fasterxml.jackson:jackson-bom to v2.17.1 ([#2732](https://github.com/googleapis/sdk-platform-java/issues/2732)) ([891b01d](https://github.com/googleapis/sdk-platform-java/commit/891b01d0d35384df3269cdd8b37102b2587c9188)) * update dependency com.google.cloud:grpc-gcp to v1.6.0 ([#2767](https://github.com/googleapis/sdk-platform-java/issues/2767)) ([a39aa07](https://github.com/googleapis/sdk-platform-java/commit/a39aa07d013c9c097ad93fd68cf97da1c7d9ff03)) * update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2708](https://github.com/googleapis/sdk-platform-java/issues/2708)) ([4d7d246](https://github.com/googleapis/sdk-platform-java/commit/4d7d246e821797155792c5f1ad0c1704ec2766d4)) * update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2709](https://github.com/googleapis/sdk-platform-java/issues/2709)) ([4e31d7d](https://github.com/googleapis/sdk-platform-java/commit/4e31d7dd917c76229c3cfe18b0f98d561c9f7d3b)) * update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0 ([#2768](https://github.com/googleapis/sdk-platform-java/issues/2768)) ([22b7398](https://github.com/googleapis/sdk-platform-java/commit/22b7398f07a77935c0c002c78e8e30dca5979652)) * update dependency commons-codec:commons-codec to v1.17.0 ([#2710](https://github.com/googleapis/sdk-platform-java/issues/2710)) ([b87356c](https://github.com/googleapis/sdk-platform-java/commit/b87356c1d80559fd5ca85ee0edfa3e5f24db6b17)) * update dependency jinja2 to v3.1.4 [security] ([#2742](https://github.com/googleapis/sdk-platform-java/issues/2742)) ([d67eaf8](https://github.com/googleapis/sdk-platform-java/commit/d67eaf85c409dc7cf653dfb6d753d39a77292135)) * update dependency lxml to v5.2.2 ([#2766](https://github.com/googleapis/sdk-platform-java/issues/2766)) ([df7e211](https://github.com/googleapis/sdk-platform-java/commit/df7e211e534516f9596e230598b70fdbfdea1ac3)) * update dependency markupsafe to v2.1.5 ([#2657](https://github.com/googleapis/sdk-platform-java/issues/2657)) ([805baf8](https://github.com/googleapis/sdk-platform-java/commit/805baf87cfd70bb74b345cff93a6a6e02ade3dd7)) * update dependency net.bytebuddy:byte-buddy to v1.14.15 ([#2753](https://github.com/googleapis/sdk-platform-java/issues/2753)) ([a472620](https://github.com/googleapis/sdk-platform-java/commit/a4726206146a503822f685caa1e4d04273b738dc)) * update dependency platformdirs to v4.2.1 ([#2662](https://github.com/googleapis/sdk-platform-java/issues/2662)) ([dbdcc91](https://github.com/googleapis/sdk-platform-java/commit/dbdcc91e91ca19eca7c098b6131e3faa90f3386e)) * update googleapis/java-cloud-bom digest to db4265f ([#2755](https://github.com/googleapis/sdk-platform-java/issues/2755)) ([908db6f](https://github.com/googleapis/sdk-platform-java/commit/908db6f453b1915e2fd4097d5cf639f054829c39)) * update googleapis/java-cloud-bom digest to f3c611a ([#2700](https://github.com/googleapis/sdk-platform-java/issues/2700)) ([d254e9b](https://github.com/googleapis/sdk-platform-java/commit/d254e9bd67ec12802158d48f3c06dc618e0df903)) * update opentelemetry-java monorepo to v1.38.0 ([#2769](https://github.com/googleapis/sdk-platform-java/issues/2769)) ([0a5c7c4](https://github.com/googleapis/sdk-platform-java/commit/0a5c7c4075ee986028535c424e4a62458a25f8d2))
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> --- .cloudbuild/graalvm/cloudbuild-test-a.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b.yaml | 2 +- .cloudbuild/graalvm/cloudbuild.yaml | 2 +- ...cloudbuild-library-generation-release.yaml | 2 +- .release-please-manifest.json | 2 +- CHANGELOG.md | 34 +++++++++++++++++++ WORKSPACE | 2 +- api-common-java/pom.xml | 4 +-- coverage-report/pom.xml | 8 ++--- gapic-generator-java-bom/pom.xml | 26 +++++++------- gapic-generator-java-pom-parent/pom.xml | 2 +- gapic-generator-java/pom.xml | 6 ++-- gax-java/README.md | 12 +++---- gax-java/dependencies.properties | 8 ++--- gax-java/gax-bom/pom.xml | 20 +++++------ gax-java/gax-grpc/pom.xml | 4 +-- gax-java/gax-httpjson/pom.xml | 4 +-- gax-java/gax/pom.xml | 4 +-- gax-java/pom.xml | 14 ++++---- .../grpc-google-common-protos/pom.xml | 4 +-- java-common-protos/pom.xml | 10 +++--- .../proto-google-common-protos/pom.xml | 4 +-- java-core/google-cloud-core-bom/pom.xml | 10 +++--- java-core/google-cloud-core-grpc/pom.xml | 4 +-- java-core/google-cloud-core-http/pom.xml | 4 +-- java-core/google-cloud-core/pom.xml | 4 +-- java-core/pom.xml | 6 ++-- java-iam/grpc-google-iam-v1/pom.xml | 4 +-- java-iam/grpc-google-iam-v2/pom.xml | 4 +-- java-iam/grpc-google-iam-v2beta/pom.xml | 4 +-- java-iam/pom.xml | 22 ++++++------ java-iam/proto-google-iam-v1/pom.xml | 4 +-- java-iam/proto-google-iam-v2/pom.xml | 4 +-- java-iam/proto-google-iam-v2beta/pom.xml | 4 +-- java-shared-dependencies/README.md | 2 +- .../dependency-convergence-check/pom.xml | 2 +- .../first-party-dependencies/pom.xml | 10 +++--- java-shared-dependencies/pom.xml | 8 ++--- .../third-party-dependencies/pom.xml | 4 +-- .../upper-bound-check/pom.xml | 4 +-- sdk-platform-java-config/pom.xml | 4 +-- showcase/pom.xml | 2 +- versions.txt | 32 ++++++++--------- 43 files changed, 176 insertions(+), 142 deletions(-) diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 407902e01b..5e3a2085f2 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index d12f0e3147..a3627df046 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 5da0e1ffed..ed6077ac07 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' steps: # GraalVM A build diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml index 4c5e07d450..53adadf000 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _GAPIC_GENERATOR_JAVA_VERSION: '2.40.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.40.1' # {x-version-update:gapic-generator-java:current} _IMAGE_ID: "gcr.io/cloud-devrel-public-resources/java-library-generation:${_GAPIC_GENERATOR_JAVA_VERSION}" steps: # Library generation build diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 69efe8f538..8d572e9c90 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.40.0" + ".": "2.40.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b42bc76aa..5e6d6ee75c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## [2.40.1](https://github.com/googleapis/sdk-platform-java/compare/v2.40.0...v2.40.1) (2024-05-15) + + +### Bug Fixes + +* [common-protos] An existing method `UpdateVehicleLocation` is ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) +* [common-protos] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2751](https://github.com/googleapis/sdk-platform-java/issues/2751)) ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) +* [iam] An existing method `UpdateVehicleLocation` is removed from ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) +* [iam] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2752](https://github.com/googleapis/sdk-platform-java/issues/2752)) ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) +* do not populate repo level change while removing library ([#2740](https://github.com/googleapis/sdk-platform-java/issues/2740)) ([43e62b9](https://github.com/googleapis/sdk-platform-java/commit/43e62b998958abd4ca96b83800380c9696ff693f)) +* only append `.api.grpc` suffix to group id if the artifact id starts with `proto-` or `grpc-` ([#2731](https://github.com/googleapis/sdk-platform-java/issues/2731)) ([8e87b2e](https://github.com/googleapis/sdk-platform-java/commit/8e87b2e9a28a1797efb2eea531d25094b4438e0d)) +* opentelemetry-bom to be in third-party-dependencies BOM ([#2736](https://github.com/googleapis/sdk-platform-java/issues/2736)) ([4ecc89b](https://github.com/googleapis/sdk-platform-java/commit/4ecc89bfff1a83e501b2fdc5a04bba47d83a7c00)) +* prepare to generate grafeas ([#2761](https://github.com/googleapis/sdk-platform-java/issues/2761)) ([1114f18](https://github.com/googleapis/sdk-platform-java/commit/1114f1863bf5ae15ee56631fd824a2269e91746d)) +* Replace deprecated protobuf methods. ([#2764](https://github.com/googleapis/sdk-platform-java/issues/2764)) ([986c090](https://github.com/googleapis/sdk-platform-java/commit/986c090a043f06ef98c9787cedf3c89cf7365017)) + + +### Dependencies + +* update dependency black to v24.4.2 ([#2660](https://github.com/googleapis/sdk-platform-java/issues/2660)) ([1cbb681](https://github.com/googleapis/sdk-platform-java/commit/1cbb681f3f395afee4be63cd6b96fefda7083d97)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.17.1 ([#2732](https://github.com/googleapis/sdk-platform-java/issues/2732)) ([891b01d](https://github.com/googleapis/sdk-platform-java/commit/891b01d0d35384df3269cdd8b37102b2587c9188)) +* update dependency com.google.cloud:grpc-gcp to v1.6.0 ([#2767](https://github.com/googleapis/sdk-platform-java/issues/2767)) ([a39aa07](https://github.com/googleapis/sdk-platform-java/commit/a39aa07d013c9c097ad93fd68cf97da1c7d9ff03)) +* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2708](https://github.com/googleapis/sdk-platform-java/issues/2708)) ([4d7d246](https://github.com/googleapis/sdk-platform-java/commit/4d7d246e821797155792c5f1ad0c1704ec2766d4)) +* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2709](https://github.com/googleapis/sdk-platform-java/issues/2709)) ([4e31d7d](https://github.com/googleapis/sdk-platform-java/commit/4e31d7dd917c76229c3cfe18b0f98d561c9f7d3b)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0 ([#2768](https://github.com/googleapis/sdk-platform-java/issues/2768)) ([22b7398](https://github.com/googleapis/sdk-platform-java/commit/22b7398f07a77935c0c002c78e8e30dca5979652)) +* update dependency commons-codec:commons-codec to v1.17.0 ([#2710](https://github.com/googleapis/sdk-platform-java/issues/2710)) ([b87356c](https://github.com/googleapis/sdk-platform-java/commit/b87356c1d80559fd5ca85ee0edfa3e5f24db6b17)) +* update dependency jinja2 to v3.1.4 [security] ([#2742](https://github.com/googleapis/sdk-platform-java/issues/2742)) ([d67eaf8](https://github.com/googleapis/sdk-platform-java/commit/d67eaf85c409dc7cf653dfb6d753d39a77292135)) +* update dependency lxml to v5.2.2 ([#2766](https://github.com/googleapis/sdk-platform-java/issues/2766)) ([df7e211](https://github.com/googleapis/sdk-platform-java/commit/df7e211e534516f9596e230598b70fdbfdea1ac3)) +* update dependency markupsafe to v2.1.5 ([#2657](https://github.com/googleapis/sdk-platform-java/issues/2657)) ([805baf8](https://github.com/googleapis/sdk-platform-java/commit/805baf87cfd70bb74b345cff93a6a6e02ade3dd7)) +* update dependency net.bytebuddy:byte-buddy to v1.14.15 ([#2753](https://github.com/googleapis/sdk-platform-java/issues/2753)) ([a472620](https://github.com/googleapis/sdk-platform-java/commit/a4726206146a503822f685caa1e4d04273b738dc)) +* update dependency platformdirs to v4.2.1 ([#2662](https://github.com/googleapis/sdk-platform-java/issues/2662)) ([dbdcc91](https://github.com/googleapis/sdk-platform-java/commit/dbdcc91e91ca19eca7c098b6131e3faa90f3386e)) +* update googleapis/java-cloud-bom digest to db4265f ([#2755](https://github.com/googleapis/sdk-platform-java/issues/2755)) ([908db6f](https://github.com/googleapis/sdk-platform-java/commit/908db6f453b1915e2fd4097d5cf639f054829c39)) +* update googleapis/java-cloud-bom digest to f3c611a ([#2700](https://github.com/googleapis/sdk-platform-java/issues/2700)) ([d254e9b](https://github.com/googleapis/sdk-platform-java/commit/d254e9bd67ec12802158d48f3c06dc618e0df903)) +* update opentelemetry-java monorepo to v1.38.0 ([#2769](https://github.com/googleapis/sdk-platform-java/issues/2769)) ([0a5c7c4](https://github.com/googleapis/sdk-platform-java/commit/0a5c7c4075ee986028535c424e4a62458a25f8d2)) + ## [2.40.0](https://github.com/googleapis/sdk-platform-java/compare/v2.39.0...v2.40.0) (2024-05-02) diff --git a/WORKSPACE b/WORKSPACE index 58d3212a0b..af7365e254 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -60,7 +60,7 @@ maven_install( repositories = ["https://repo.maven.apache.org/maven2/"], ) -_gapic_generator_java_version = "2.40.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.40.1" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index c8740cd068..1c7e731f69 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.31.1-SNAPSHOT + 2.31.1 API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 231269f42d..9606b778ff 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax-grpc - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax-httpjson - 2.48.1-SNAPSHOT + 2.48.1 com.google.api api-common - 2.31.1-SNAPSHOT + 2.31.1 diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index ea55047998..feb19d6bee 100644 --- a/gapic-generator-java-bom/pom.xml +++ b/gapic-generator-java-bom/pom.xml @@ -4,7 +4,7 @@ com.google.api gapic-generator-java-bom pom - 2.40.1-SNAPSHOT + 2.40.1 GAPIC Generator Java BOM BOM for the libraries in gapic-generator-java repository. Users should not @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.31.1-SNAPSHOT + 2.31.1 com.google.api gax-bom - 2.48.1-SNAPSHOT + 2.48.1 pom import com.google.api gapic-generator-java - 2.40.1-SNAPSHOT + 2.40.1 com.google.api.grpc grpc-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 com.google.api.grpc proto-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 com.google.api.grpc proto-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc proto-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc proto-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index b0992283d5..b38835573e 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 730ef82950..5142fb06f7 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.google.api gapic-generator-java - 2.40.1-SNAPSHOT + 2.40.1 GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.40.1-SNAPSHOT + 2.40.1 pom import diff --git a/gax-java/README.md b/gax-java/README.md index 2f74b63d7d..ca0b8c73b9 100644 --- a/gax-java/README.md +++ b/gax-java/README.md @@ -34,27 +34,27 @@ If you are using Maven, add this to your pom.xml file com.google.api gax - 2.48.0 + 2.48.1 com.google.api gax-grpc - 2.48.0 + 2.48.1 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.48.0', - 'com.google.api:gax-grpc:2.48.0' +compile 'com.google.api:gax:2.48.1', + 'com.google.api:gax-grpc:2.48.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.48.0" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.48.0" +libraryDependencies += "com.google.api" % "gax" % "2.48.1" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.48.1" ``` [//]: # ({x-version-update-end}) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index ba75434727..721b6dec8c 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -8,16 +8,16 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=2.48.1-SNAPSHOT +version.gax=2.48.1 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.48.1-SNAPSHOT +version.gax_grpc=2.48.1 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.48.1-SNAPSHOT +version.gax_bom=2.48.1 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.48.1-SNAPSHOT +version.gax_httpjson=2.48.1 # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 15ec6bf612..47e9425eab 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 2.48.1-SNAPSHOT + 2.48.1 pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -43,55 +43,55 @@ com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 test-jar testlib com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 testlib com.google.api gax-grpc - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax-grpc - 2.48.1-SNAPSHOT + 2.48.1 test-jar testlib com.google.api gax-grpc - 2.48.1-SNAPSHOT + 2.48.1 testlib com.google.api gax-httpjson - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax-httpjson - 2.48.1-SNAPSHOT + 2.48.1 test-jar testlib com.google.api gax-httpjson - 2.48.1-SNAPSHOT + 2.48.1 testlib diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index bf50b8527e..69cca436f2 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-grpc - 2.48.1-SNAPSHOT + 2.48.1 jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index ff8930f609..1751f191ad 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-httpjson - 2.48.1-SNAPSHOT + 2.48.1 jar GAX (Google Api eXtensions) for Java (HTTP JSON) Google Api eXtensions for Java (HTTP JSON) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index 07fb0d7006..eecd19287d 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.48.1-SNAPSHOT + 2.48.1 jar GAX (Google Api eXtensions) for Java (Core) Google Api eXtensions for Java (Core) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 5966898fc4..9f37b7e2f3 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.48.1-SNAPSHOT + 2.48.1 GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.31.1-SNAPSHOT + 2.31.1 com.google.auth @@ -108,24 +108,24 @@ com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 com.google.api gax - 2.48.1-SNAPSHOT + 2.48.1 test-jar testlib com.google.api.grpc proto-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 com.google.api.grpc grpc-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 io.grpc diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index 2adbd8e308..b62b83c80c 100644 --- a/java-common-protos/grpc-google-common-protos/pom.xml +++ b/java-common-protos/grpc-google-common-protos/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index 64315b9c39..4dddb20f6c 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -4,7 +4,7 @@ com.google.api.grpc google-common-protos-parent pom - 2.39.1-SNAPSHOT + 2.39.1 Google Common Protos Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -61,7 +61,7 @@ com.google.cloud third-party-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import @@ -75,7 +75,7 @@ com.google.api.grpc grpc-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 io.grpc @@ -87,7 +87,7 @@ com.google.api.grpc proto-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 com.google.guava diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index eda6659fb8..c1d18c7629 100644 --- a/java-common-protos/proto-google-common-protos/pom.xml +++ b/java-common-protos/proto-google-common-protos/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index f32a426f1f..65df39f3e9 100644 --- a/java-core/google-cloud-core-bom/pom.xml +++ b/java-core/google-cloud-core-bom/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.cloud google-cloud-core-bom - 2.38.1-SNAPSHOT + 2.38.1 pom com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.38.1-SNAPSHOT + 2.38.1 com.google.cloud google-cloud-core-grpc - 2.38.1-SNAPSHOT + 2.38.1 com.google.cloud google-cloud-core-http - 2.38.1-SNAPSHOT + 2.38.1 diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index e34018d001..68ba010f4c 100644 --- a/java-core/google-cloud-core-grpc/pom.xml +++ b/java-core/google-cloud-core-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-grpc - 2.38.1-SNAPSHOT + 2.38.1 jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1-SNAPSHOT + 2.38.1 google-cloud-core-grpc diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml index fd9d09276d..e7b4474a3d 100644 --- a/java-core/google-cloud-core-http/pom.xml +++ b/java-core/google-cloud-core-http/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-http - 2.38.1-SNAPSHOT + 2.38.1 jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1-SNAPSHOT + 2.38.1 google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index 2fdb90a847..9dbdf6f044 100644 --- a/java-core/google-cloud-core/pom.xml +++ b/java-core/google-cloud-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core - 2.38.1-SNAPSHOT + 2.38.1 jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1-SNAPSHOT + 2.38.1 google-cloud-core diff --git a/java-core/pom.xml b/java-core/pom.xml index af452d0855..de8f3ecbfe 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.38.1-SNAPSHOT + 2.38.1 Google Cloud Core Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 56c5b61de2..edd93185cf 100644 --- a/java-iam/grpc-google-iam-v1/pom.xml +++ b/java-iam/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 5838319a4f..6fc5ad8af2 100644 --- a/java-iam/grpc-google-iam-v2/pom.xml +++ b/java-iam/grpc-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index 5918a05c71..a13438359a 100644 --- a/java-iam/grpc-google-iam-v2beta/pom.xml +++ b/java-iam/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 8f2e4c1266..1d5f355ef2 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.34.1-SNAPSHOT + 1.34.1 Google IAM Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -60,7 +60,7 @@ com.google.cloud third-party-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import @@ -88,44 +88,44 @@ com.google.api gax-bom - 2.48.1-SNAPSHOT + 2.48.1 pom import com.google.api.grpc proto-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc proto-google-common-protos - 2.39.1-SNAPSHOT + 2.39.1 com.google.api.grpc proto-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc grpc-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 com.google.api.grpc proto-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index c402cd98fe..ef031e86f6 100644 --- a/java-iam/proto-google-iam-v1/pom.xml +++ b/java-iam/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.34.1-SNAPSHOT + 1.34.1 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index e80853e336..f2a0ac698d 100644 --- a/java-iam/proto-google-iam-v2/pom.xml +++ b/java-iam/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.34.1-SNAPSHOT + 1.34.1 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index 31bce8419f..6cbc0e19d9 100644 --- a/java-iam/proto-google-iam-v2beta/pom.xml +++ b/java-iam/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.34.1-SNAPSHOT + 1.34.1 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1-SNAPSHOT + 1.34.1 diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md index 196798fd10..0e0617c7d5 100644 --- a/java-shared-dependencies/README.md +++ b/java-shared-dependencies/README.md @@ -14,7 +14,7 @@ If you are using Maven, add this to the `dependencyManagement` section. com.google.cloud google-cloud-shared-dependencies - 3.30.0 + 3.30.1 pom import diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index aafee63670..b611338bbe 100644 --- a/java-shared-dependencies/dependency-convergence-check/pom.xml +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud shared-dependencies-dependency-convergence-test - 3.30.1-SNAPSHOT + 3.30.1 Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies An dependency convergence test case for the shared dependencies BOM. A failure of this test case means diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index fb20d5b454..1b8e80fff8 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud first-party-dependencies pom - 3.30.1-SNAPSHOT + 3.30.1 Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.40.1-SNAPSHOT + 2.40.1 pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.38.1-SNAPSHOT + 2.38.1 pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.38.1-SNAPSHOT + 2.38.1 test-jar com.google.cloud google-cloud-core - 2.38.1-SNAPSHOT + 2.38.1 tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index 935504dbcd..c06a9c1cba 100644 --- a/java-shared-dependencies/pom.xml +++ b/java-shared-dependencies/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-shared-dependencies pom - 3.30.1-SNAPSHOT + 3.30.1 first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import com.google.cloud third-party-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 081410c65f..b69931fe44 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud third-party-dependencies pom - 3.30.1-SNAPSHOT + 3.30.1 Google Cloud Third-party Shared Dependencies Shared third-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1-SNAPSHOT + 2.40.1 ../../gapic-generator-java-pom-parent diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index 12d0bf6253..d101d5d230 100644 --- a/java-shared-dependencies/upper-bound-check/pom.xml +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -4,7 +4,7 @@ com.google.cloud shared-dependencies-upper-bound-test pom - 3.30.1-SNAPSHOT + 3.30.1 Upper bound test for Google Cloud Shared Dependencies An upper bound test case for the shared dependencies BOM. A failure of this test case means @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index 5139be537c..c0bdbc5c6a 100644 --- a/sdk-platform-java-config/pom.xml +++ b/sdk-platform-java-config/pom.xml @@ -4,7 +4,7 @@ com.google.cloud sdk-platform-java-config pom - 3.30.1-SNAPSHOT + 3.30.1 SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -17,6 +17,6 @@ - 3.30.1-SNAPSHOT + 3.30.1 \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index 32c5cfc469..1eeac050a0 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1-SNAPSHOT + 3.30.1 pom import diff --git a/versions.txt b/versions.txt index 143167c1ea..ce09bd31dc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.40.0:2.40.1-SNAPSHOT -api-common:2.31.0:2.31.1-SNAPSHOT -gax:2.48.0:2.48.1-SNAPSHOT -gax-grpc:2.48.0:2.48.1-SNAPSHOT -gax-httpjson:0.133.0:0.133.1-SNAPSHOT -proto-google-common-protos:2.39.0:2.39.1-SNAPSHOT -grpc-google-common-protos:2.39.0:2.39.1-SNAPSHOT -proto-google-iam-v1:1.34.0:1.34.1-SNAPSHOT -grpc-google-iam-v1:1.34.0:1.34.1-SNAPSHOT -proto-google-iam-v2beta:1.34.0:1.34.1-SNAPSHOT -grpc-google-iam-v2beta:1.34.0:1.34.1-SNAPSHOT -google-iam-policy:1.34.0:1.34.1-SNAPSHOT -proto-google-iam-v2:1.34.0:1.34.1-SNAPSHOT -grpc-google-iam-v2:1.34.0:1.34.1-SNAPSHOT -google-cloud-core:2.38.0:2.38.1-SNAPSHOT -google-cloud-shared-dependencies:3.30.0:3.30.1-SNAPSHOT +gapic-generator-java:2.40.1:2.40.1 +api-common:2.31.1:2.31.1 +gax:2.48.1:2.48.1 +gax-grpc:2.48.1:2.48.1 +gax-httpjson:0.133.1:0.133.1 +proto-google-common-protos:2.39.1:2.39.1 +grpc-google-common-protos:2.39.1:2.39.1 +proto-google-iam-v1:1.34.1:1.34.1 +grpc-google-iam-v1:1.34.1:1.34.1 +proto-google-iam-v2beta:1.34.1:1.34.1 +grpc-google-iam-v2beta:1.34.1:1.34.1 +google-iam-policy:1.34.1:1.34.1 +proto-google-iam-v2:1.34.1:1.34.1 +grpc-google-iam-v2:1.34.1:1.34.1 +google-cloud-core:2.38.1:2.38.1 +google-cloud-shared-dependencies:3.30.1:3.30.1 From 2170bc0cc0ef29d74982e2b3f9d45868e847b209 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 10:56:23 -0400 Subject: [PATCH 17/29] chore(main): release 2.40.2-SNAPSHOT (#2777) :robot: I have created a release *beep* *boop* ---
2.40.2-SNAPSHOT ### Updating meta-information for bleeding-edge SNAPSHOT release.
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .cloudbuild/graalvm/cloudbuild-test-a.yaml | 2 +- .cloudbuild/graalvm/cloudbuild-test-b.yaml | 2 +- .cloudbuild/graalvm/cloudbuild.yaml | 2 +- ...cloudbuild-library-generation-release.yaml | 2 +- WORKSPACE | 2 +- api-common-java/pom.xml | 4 +-- coverage-report/pom.xml | 8 ++--- gapic-generator-java-bom/pom.xml | 26 +++++++-------- gapic-generator-java-pom-parent/pom.xml | 2 +- gapic-generator-java/pom.xml | 6 ++-- gax-java/dependencies.properties | 8 ++--- gax-java/gax-bom/pom.xml | 20 ++++++------ gax-java/gax-grpc/pom.xml | 4 +-- gax-java/gax-httpjson/pom.xml | 4 +-- gax-java/gax/pom.xml | 4 +-- gax-java/pom.xml | 14 ++++---- .../grpc-google-common-protos/pom.xml | 4 +-- java-common-protos/pom.xml | 10 +++--- .../proto-google-common-protos/pom.xml | 4 +-- java-core/google-cloud-core-bom/pom.xml | 10 +++--- java-core/google-cloud-core-grpc/pom.xml | 4 +-- java-core/google-cloud-core-http/pom.xml | 4 +-- java-core/google-cloud-core/pom.xml | 4 +-- java-core/pom.xml | 6 ++-- java-iam/grpc-google-iam-v1/pom.xml | 4 +-- java-iam/grpc-google-iam-v2/pom.xml | 4 +-- java-iam/grpc-google-iam-v2beta/pom.xml | 4 +-- java-iam/pom.xml | 22 ++++++------- java-iam/proto-google-iam-v1/pom.xml | 4 +-- java-iam/proto-google-iam-v2/pom.xml | 4 +-- java-iam/proto-google-iam-v2beta/pom.xml | 4 +-- .../dependency-convergence-check/pom.xml | 2 +- .../first-party-dependencies/pom.xml | 10 +++--- java-shared-dependencies/pom.xml | 8 ++--- .../third-party-dependencies/pom.xml | 4 +-- .../upper-bound-check/pom.xml | 4 +-- sdk-platform-java-config/pom.xml | 4 +-- showcase/pom.xml | 2 +- versions.txt | 32 +++++++++---------- 39 files changed, 134 insertions(+), 134 deletions(-) diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 5e3a2085f2..4d25973e13 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index a3627df046..58048cb5d6 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' options: machineType: 'E2_HIGHCPU_8' diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index ed6077ac07..2c458fdad8 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.30.1' # {x-version-update:google-cloud-shared-dependencies:current} + _SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} _JAVA_SHARED_CONFIG_VERSION: '1.7.7' steps: # GraalVM A build diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml index 53adadf000..fc320d3ec6 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-release.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _GAPIC_GENERATOR_JAVA_VERSION: '2.40.1' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.40.2-SNAPSHOT' # {x-version-update:gapic-generator-java:current} _IMAGE_ID: "gcr.io/cloud-devrel-public-resources/java-library-generation:${_GAPIC_GENERATOR_JAVA_VERSION}" steps: # Library generation build diff --git a/WORKSPACE b/WORKSPACE index af7365e254..2fd277796d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -60,7 +60,7 @@ maven_install( repositories = ["https://repo.maven.apache.org/maven2/"], ) -_gapic_generator_java_version = "2.40.1" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.40.2-SNAPSHOT" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index 1c7e731f69..fe6403145a 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.31.1 + 2.31.2-SNAPSHOT API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 9606b778ff..26f46f7c5a 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax-grpc - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax-httpjson - 2.48.1 + 2.48.2-SNAPSHOT com.google.api api-common - 2.31.1 + 2.31.2-SNAPSHOT
diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index feb19d6bee..1f02832d9c 100644 --- a/gapic-generator-java-bom/pom.xml +++ b/gapic-generator-java-bom/pom.xml @@ -4,7 +4,7 @@ com.google.api gapic-generator-java-bom pom - 2.40.1 + 2.40.2-SNAPSHOT GAPIC Generator Java BOM BOM for the libraries in gapic-generator-java repository. Users should not @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -75,61 +75,61 @@ com.google.api api-common - 2.31.1 + 2.31.2-SNAPSHOT com.google.api gax-bom - 2.48.1 + 2.48.2-SNAPSHOT pom import com.google.api gapic-generator-java - 2.40.1 + 2.40.2-SNAPSHOT com.google.api.grpc grpc-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc proto-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT
diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index b38835573e..f044a8a0c0 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 5142fb06f7..750887cb89 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.google.api gapic-generator-java - 2.40.1 + 2.40.2-SNAPSHOT GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.40.1 + 2.40.2-SNAPSHOT pom import diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 721b6dec8c..3dc2183988 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -8,16 +8,16 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=2.48.1 +version.gax=2.48.2-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.48.1 +version.gax_grpc=2.48.2-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.48.1 +version.gax_bom=2.48.2-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.48.1 +version.gax_httpjson=2.48.2-SNAPSHOT # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 47e9425eab..e3fa2b1769 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 2.48.1 + 2.48.2-SNAPSHOT pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -43,55 +43,55 @@ com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT test-jar testlib com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT testlib com.google.api gax-grpc - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax-grpc - 2.48.1 + 2.48.2-SNAPSHOT test-jar testlib com.google.api gax-grpc - 2.48.1 + 2.48.2-SNAPSHOT testlib com.google.api gax-httpjson - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax-httpjson - 2.48.1 + 2.48.2-SNAPSHOT test-jar testlib com.google.api gax-httpjson - 2.48.1 + 2.48.2-SNAPSHOT testlib
diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 69cca436f2..b25e708814 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-grpc - 2.48.1 + 2.48.2-SNAPSHOT jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 1751f191ad..c1016d17bd 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-httpjson - 2.48.1 + 2.48.2-SNAPSHOT jar GAX (Google Api eXtensions) for Java (HTTP JSON) Google Api eXtensions for Java (HTTP JSON) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index eecd19287d..7f706b741a 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.48.1 + 2.48.2-SNAPSHOT jar GAX (Google Api eXtensions) for Java (Core) Google Api eXtensions for Java (Core) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 9f37b7e2f3..c434186653 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.48.1 + 2.48.2-SNAPSHOT GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.31.1 + 2.31.2-SNAPSHOT com.google.auth @@ -108,24 +108,24 @@ com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT com.google.api gax - 2.48.1 + 2.48.2-SNAPSHOT test-jar testlib com.google.api.grpc proto-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT com.google.api.grpc grpc-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT io.grpc diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index b62b83c80c..5b2ae91463 100644 --- a/java-common-protos/grpc-google-common-protos/pom.xml +++ b/java-common-protos/grpc-google-common-protos/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index 4dddb20f6c..95955a1151 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -4,7 +4,7 @@ com.google.api.grpc google-common-protos-parent pom - 2.39.1 + 2.39.2-SNAPSHOT Google Common Protos Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -61,7 +61,7 @@ com.google.cloud third-party-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import @@ -75,7 +75,7 @@ com.google.api.grpc grpc-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT io.grpc @@ -87,7 +87,7 @@ com.google.api.grpc proto-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT com.google.guava diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index c1d18c7629..3c9d5235f8 100644 --- a/java-common-protos/proto-google-common-protos/pom.xml +++ b/java-common-protos/proto-google-common-protos/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index 65df39f3e9..5347942c16 100644 --- a/java-core/google-cloud-core-bom/pom.xml +++ b/java-core/google-cloud-core-bom/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.cloud google-cloud-core-bom - 2.38.1 + 2.38.2-SNAPSHOT pom com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.38.1 + 2.38.2-SNAPSHOT com.google.cloud google-cloud-core-grpc - 2.38.1 + 2.38.2-SNAPSHOT com.google.cloud google-cloud-core-http - 2.38.1 + 2.38.2-SNAPSHOT diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index 68ba010f4c..463b022ef6 100644 --- a/java-core/google-cloud-core-grpc/pom.xml +++ b/java-core/google-cloud-core-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-grpc - 2.38.1 + 2.38.2-SNAPSHOT jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1 + 2.38.2-SNAPSHOT google-cloud-core-grpc diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml index e7b4474a3d..4aae033b7c 100644 --- a/java-core/google-cloud-core-http/pom.xml +++ b/java-core/google-cloud-core-http/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-http - 2.38.1 + 2.38.2-SNAPSHOT jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1 + 2.38.2-SNAPSHOT google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index 9dbdf6f044..90659cc850 100644 --- a/java-core/google-cloud-core/pom.xml +++ b/java-core/google-cloud-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core - 2.38.1 + 2.38.2-SNAPSHOT jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.38.1 + 2.38.2-SNAPSHOT google-cloud-core diff --git a/java-core/pom.xml b/java-core/pom.xml index de8f3ecbfe..588a56afff 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.38.1 + 2.38.2-SNAPSHOT Google Cloud Core Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index edd93185cf..1bc75ee715 100644 --- a/java-iam/grpc-google-iam-v1/pom.xml +++ b/java-iam/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 6fc5ad8af2..92399a1f72 100644 --- a/java-iam/grpc-google-iam-v2/pom.xml +++ b/java-iam/grpc-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index a13438359a..9da885ec4a 100644 --- a/java-iam/grpc-google-iam-v2beta/pom.xml +++ b/java-iam/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 1d5f355ef2..75bc36941a 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.34.1 + 1.34.2-SNAPSHOT Google IAM Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -60,7 +60,7 @@ com.google.cloud third-party-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import @@ -88,44 +88,44 @@ com.google.api gax-bom - 2.48.1 + 2.48.2-SNAPSHOT pom import com.google.api.grpc proto-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.39.1 + 2.39.2-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index ef031e86f6..0aba06a20f 100644 --- a/java-iam/proto-google-iam-v1/pom.xml +++ b/java-iam/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.34.1 + 1.34.2-SNAPSHOT proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index f2a0ac698d..f4f824a06e 100644 --- a/java-iam/proto-google-iam-v2/pom.xml +++ b/java-iam/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.34.1 + 1.34.2-SNAPSHOT proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index 6cbc0e19d9..185afeff7c 100644 --- a/java-iam/proto-google-iam-v2beta/pom.xml +++ b/java-iam/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.34.1 + 1.34.2-SNAPSHOT proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.34.1 + 1.34.2-SNAPSHOT diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index b611338bbe..eeefcefcd6 100644 --- a/java-shared-dependencies/dependency-convergence-check/pom.xml +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud shared-dependencies-dependency-convergence-test - 3.30.1 + 3.30.2-SNAPSHOT Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies An dependency convergence test case for the shared dependencies BOM. A failure of this test case means diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index 1b8e80fff8..7dc67140d8 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud first-party-dependencies pom - 3.30.1 + 3.30.2-SNAPSHOT Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.40.1 + 2.40.2-SNAPSHOT pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.38.1 + 2.38.2-SNAPSHOT pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.38.1 + 2.38.2-SNAPSHOT test-jar com.google.cloud google-cloud-core - 2.38.1 + 2.38.2-SNAPSHOT tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index c06a9c1cba..39f6da7c4d 100644 --- a/java-shared-dependencies/pom.xml +++ b/java-shared-dependencies/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-shared-dependencies pom - 3.30.1 + 3.30.2-SNAPSHOT first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import com.google.cloud third-party-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index b69931fe44..6d798069f8 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud third-party-dependencies pom - 3.30.1 + 3.30.2-SNAPSHOT Google Cloud Third-party Shared Dependencies Shared third-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.40.1 + 2.40.2-SNAPSHOT ../../gapic-generator-java-pom-parent diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index d101d5d230..ee94f4bdf8 100644 --- a/java-shared-dependencies/upper-bound-check/pom.xml +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -4,7 +4,7 @@ com.google.cloud shared-dependencies-upper-bound-test pom - 3.30.1 + 3.30.2-SNAPSHOT Upper bound test for Google Cloud Shared Dependencies An upper bound test case for the shared dependencies BOM. A failure of this test case means @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index c0bdbc5c6a..15d5b2eb25 100644 --- a/sdk-platform-java-config/pom.xml +++ b/sdk-platform-java-config/pom.xml @@ -4,7 +4,7 @@ com.google.cloud sdk-platform-java-config pom - 3.30.1 + 3.30.2-SNAPSHOT SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -17,6 +17,6 @@ - 3.30.1 + 3.30.2-SNAPSHOT \ No newline at end of file diff --git a/showcase/pom.xml b/showcase/pom.xml index 1eeac050a0..cc884b6ca9 100644 --- a/showcase/pom.xml +++ b/showcase/pom.xml @@ -34,7 +34,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.30.1 + 3.30.2-SNAPSHOT pom import diff --git a/versions.txt b/versions.txt index ce09bd31dc..489dd8d991 100644 --- a/versions.txt +++ b/versions.txt @@ -1,19 +1,19 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.40.1:2.40.1 -api-common:2.31.1:2.31.1 -gax:2.48.1:2.48.1 -gax-grpc:2.48.1:2.48.1 -gax-httpjson:0.133.1:0.133.1 -proto-google-common-protos:2.39.1:2.39.1 -grpc-google-common-protos:2.39.1:2.39.1 -proto-google-iam-v1:1.34.1:1.34.1 -grpc-google-iam-v1:1.34.1:1.34.1 -proto-google-iam-v2beta:1.34.1:1.34.1 -grpc-google-iam-v2beta:1.34.1:1.34.1 -google-iam-policy:1.34.1:1.34.1 -proto-google-iam-v2:1.34.1:1.34.1 -grpc-google-iam-v2:1.34.1:1.34.1 -google-cloud-core:2.38.1:2.38.1 -google-cloud-shared-dependencies:3.30.1:3.30.1 +gapic-generator-java:2.40.1:2.40.2-SNAPSHOT +api-common:2.31.1:2.31.2-SNAPSHOT +gax:2.48.1:2.48.2-SNAPSHOT +gax-grpc:2.48.1:2.48.2-SNAPSHOT +gax-httpjson:0.133.1:0.133.2-SNAPSHOT +proto-google-common-protos:2.39.1:2.39.2-SNAPSHOT +grpc-google-common-protos:2.39.1:2.39.2-SNAPSHOT +proto-google-iam-v1:1.34.1:1.34.2-SNAPSHOT +grpc-google-iam-v1:1.34.1:1.34.2-SNAPSHOT +proto-google-iam-v2beta:1.34.1:1.34.2-SNAPSHOT +grpc-google-iam-v2beta:1.34.1:1.34.2-SNAPSHOT +google-iam-policy:1.34.1:1.34.2-SNAPSHOT +proto-google-iam-v2:1.34.1:1.34.2-SNAPSHOT +grpc-google-iam-v2:1.34.1:1.34.2-SNAPSHOT +google-cloud-core:2.38.1:2.38.2-SNAPSHOT +google-cloud-shared-dependencies:3.30.1:3.30.2-SNAPSHOT From f8ea0a086ddff10a2484a1e2ea249d4832a02f34 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 16 May 2024 11:37:08 -0400 Subject: [PATCH 18/29] feat: add a github client (#2747) In this PR: - Add a github client to retrieve pull request status from a repository. - Add unit test. --- .../dependency-analyzer/pom.xml | 12 ++ .../google/cloud/external/DepsDevClient.java | 15 ++- .../google/cloud/external/GitHubClient.java | 113 ++++++++++++++++++ .../java/com/google/cloud/model/Interval.java | 16 +++ .../com/google/cloud/model/PullRequest.java | 17 +++ .../cloud/model/PullRequestStatistics.java | 15 +++ .../cloud/external/GitHubClientTest.java | 65 ++++++++++ .../pull_request_sample_response.txt | 1 + 8 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java create mode 100644 java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java create mode 100644 java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java create mode 100644 java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java create mode 100644 java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java create mode 100644 java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt diff --git a/java-shared-dependencies/dependency-analyzer/pom.xml b/java-shared-dependencies/dependency-analyzer/pom.xml index e58eb6b573..2d8121e84d 100644 --- a/java-shared-dependencies/dependency-analyzer/pom.xml +++ b/java-shared-dependencies/dependency-analyzer/pom.xml @@ -38,6 +38,18 @@ + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + + fake_value + + + diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java index a42c46a64a..49e9cd0cd4 100644 --- a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java @@ -26,15 +26,24 @@ import java.util.List; import java.util.stream.Collectors; +/** + * DepsDevClient is a class that sends HTTP requests to the Deps.dev RESTful API. + * + *

This class simplifies the process of making API calls by handling authentication, request + * construction, and response parsing. It uses the {@link java.net.http.HttpClient} for sending + * requests and {@link com.google.gson.Gson} for handling JSON serialization/deserialization. + */ public class DepsDevClient { private final HttpClient client; - public final Gson gson; + private final Gson gson; private final static String ADVISORY_URL_BASE = "https://api.deps.dev/v3/advisories/%s"; - private final static String DEPENDENCY_URLBASE = "https://api.deps.dev/v3/systems/%s/packages/%s/versions/%s:dependencies"; + private final static String DEPENDENCY_URLBASE = + "https://api.deps.dev/v3/systems/%s/packages/%s/versions/%s:dependencies"; - public final static String QUERY_URL_BASE = "https://api.deps.dev/v3/query?versionKey.system=%s&versionKey.name=%s&versionKey.version=%s"; + public final static String QUERY_URL_BASE = + "https://api.deps.dev/v3/query?versionKey.system=%s&versionKey.name=%s&versionKey.version=%s"; public DepsDevClient(HttpClient client) { this.client = client; diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java new file mode 100644 index 0000000000..5c66a1af1a --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java @@ -0,0 +1,113 @@ +package com.google.cloud.external; + +import com.google.cloud.model.Interval; +import com.google.cloud.model.PullRequest; +import com.google.cloud.model.PullRequestStatistics; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * GitHubClient is a class that sends HTTP requests to the GitHub RESTful API. It provides methods + * for interacting with various GitHub resources such as repositories, issues, users, etc. + * + *

This class simplifies the process of making API calls by handling authentication, request + * construction, and response parsing. It uses the {@link java.net.http.HttpClient} for sending + * requests and {@link com.google.gson.Gson} for handling JSON serialization/deserialization. + */ +public class GitHubClient { + private final HttpClient client; + private final Gson gson; + private static final String PULL_REQUESTS_BASE = + "https://api.github.com/repos/%s/%s/pulls?state=all&per_page=100&page=%s"; + private static final int MAX_PULL_REQUEST_NUM = 1000; + private static final String OPEN_STATE = "open"; + + public GitHubClient(HttpClient client) { + this.client = client; + this.gson = new GsonBuilder().create(); + } + + public PullRequestStatistics listMonthlyPullRequestStatusOf(String organization, String repo) + throws URISyntaxException, IOException, InterruptedException { + return listPullRequestStatus(organization, repo, Interval.MONTHLY); + } + + private PullRequestStatistics listPullRequestStatus( + String organization, String repo, Interval interval) + throws URISyntaxException, IOException, InterruptedException { + List pullRequests = listPullRequests(organization, repo); + ZonedDateTime now = ZonedDateTime.now(); + long created = + pullRequests.stream() + .distinct() + .filter(pullRequest -> pullRequest.state().equals(OPEN_STATE)) + .filter( + pullRequest -> { + ZonedDateTime createdAt = utcTimeFrom(pullRequest.createdAt()); + return now.minusDays(interval.getDays()).isBefore(createdAt); + }) + .count(); + + long merged = + pullRequests.stream() + .distinct() + .filter(pullRequest -> Objects.nonNull(pullRequest.mergedAt())) + .filter( + pullRequest -> { + ZonedDateTime createdAt = utcTimeFrom(pullRequest.mergedAt()); + return now.minusDays(interval.getDays()).isBefore(createdAt); + }) + .count(); + + return new PullRequestStatistics(created, merged, interval); + } + + private List listPullRequests(String organization, String repo) + throws URISyntaxException, IOException, InterruptedException { + List pullRequests = new ArrayList<>(); + int page = 1; + while (pullRequests.size() < MAX_PULL_REQUEST_NUM) { + HttpResponse response = getResponse(getPullRequestsUrl(organization, repo, page)); + pullRequests.addAll( + gson.fromJson(response.body(), new TypeToken>() {}.getType())); + page++; + } + + return pullRequests; + } + + private String getPullRequestsUrl(String organization, String repo, int page) { + return String.format(PULL_REQUESTS_BASE, organization, repo, page); + } + + private ZonedDateTime utcTimeFrom(String time) { + ZoneId zoneIdUTC = ZoneId.of("UTC"); + Instant instant = Instant.parse(time); + return instant.atZone(zoneIdUTC); + } + + private HttpResponse getResponse(String endpoint) + throws URISyntaxException, IOException, InterruptedException { + HttpRequest request = + HttpRequest.newBuilder() + .header("Authorization", System.getenv("GITHUB_TOKEN")) + .uri(new URI(endpoint)) + .GET() + .build(); + return client.send(request, BodyHandlers.ofString()); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java new file mode 100644 index 0000000000..eead68c1a8 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java @@ -0,0 +1,16 @@ +package com.google.cloud.model; + +public enum Interval { + WEEKLY(7), + MONTHLY(30); + + private final int days; + + Interval(int days) { + this.days = days; + } + + public int getDays() { + return days; + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java new file mode 100644 index 0000000000..04734225f3 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java @@ -0,0 +1,17 @@ +package com.google.cloud.model; + +import com.google.gson.annotations.SerializedName; + +/** + * A record that represents a GitHub pull request. + * + * @param url The url of the pull request. + * @param state The state of the pull request, e.g., open, merged. + * @param createdAt The creation time of the pull request. + * @param mergedAt The merged time of the pull request; null if not merged. + */ +public record PullRequest( + String url, + String state, + @SerializedName("created_at") String createdAt, + @SerializedName("merged_at") String mergedAt) {} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java new file mode 100644 index 0000000000..f151569f73 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java @@ -0,0 +1,15 @@ +package com.google.cloud.model; + +/** + * A record that represents statistics about pull requests within a specified time interval. + * + *

The pull request statistics is used to show pull request freshness in the package information + * report. + * + *

For example, x pull requests are created and y pull requests are merged in the last 30 days. + * + * @param created The number of pull requests created within the interval. + * @param merged The number of pull requests merged within the interval. + * @param interval The time interval over which the statistics were collected. + */ +public record PullRequestStatistics(long created, long merged, Interval interval) {} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java new file mode 100644 index 0000000000..dae0d1fc79 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java @@ -0,0 +1,65 @@ +package com.google.cloud.external; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.cloud.model.Interval; +import com.google.cloud.model.PullRequestStatistics; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandler; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import org.junit.Before; +import org.junit.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +public class GitHubClientTest { + + private HttpResponse response; + private GitHubClient client; + + @Before + public void setUp() throws IOException, InterruptedException { + HttpClient httpClient = mock(HttpClient.class); + client = new GitHubClient(httpClient); + response = mock(HttpResponse.class); + when(httpClient.send(any(HttpRequest.class), any(BodyHandler.class))).thenReturn(response); + } + + @Test + public void testListMonthlyPullRequestStatusSucceeds() + throws URISyntaxException, IOException, InterruptedException { + ZonedDateTime fixedNow = ZonedDateTime.parse("2024-05-22T09:33:52Z"); + ZonedDateTime lastMonth = ZonedDateTime.parse("2024-04-22T09:33:52Z"); + Instant prInstant = Instant.parse("2024-05-10T09:33:52Z"); + ZonedDateTime prTime = ZonedDateTime.parse("2024-05-10T09:33:52Z"); + String responseBody = + Files.readString(Path.of("src/test/resources/pull_request_sample_response.txt")); + + try (MockedStatic mockedLocalDateTime = Mockito.mockStatic(ZonedDateTime.class); + MockedStatic mockedInstant = Mockito.mockStatic(Instant.class)) { + mockedLocalDateTime.when(ZonedDateTime::now).thenReturn(fixedNow); + mockedInstant.when(() -> Instant.parse(Mockito.anyString())).thenReturn(prInstant); + when(fixedNow.minusDays(30)).thenReturn(lastMonth); + when(prInstant.atZone(ZoneId.of("UTC"))).thenReturn(prTime); + when(response.body()).thenReturn(responseBody); + String org = ""; + String repo = ""; + PullRequestStatistics status = client.listMonthlyPullRequestStatusOf(org, repo); + + assertEquals(Interval.MONTHLY, status.interval()); + assertEquals(3, status.created()); + assertEquals(7, status.merged()); + } + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt b/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt new file mode 100644 index 0000000000..6a91ff6d04 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt @@ -0,0 +1 @@ +[{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771","id":1869761809,"node_id":"PR_kwDOD7wwCM5vck0R","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2771","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2771.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2771.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771","number":2771,"state":"open","locked":false,"title":"chore: Migrate Gapic-Generator-Java to JUnit5","user":{"login":"lqiu96","id":6621793,"node_id":"MDQ6VXNlcjY2MjE3OTM=","avatar_url":"https://avatars.githubusercontent.com/u/6621793?v=4","gravatar_id":"","url":"https://api.github.com/users/lqiu96","html_url":"https://github.com/lqiu96","followers_url":"https://api.github.com/users/lqiu96/followers","following_url":"https://api.github.com/users/lqiu96/following{/other_user}","gists_url":"https://api.github.com/users/lqiu96/gists{/gist_id}","starred_url":"https://api.github.com/users/lqiu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lqiu96/subscriptions","organizations_url":"https://api.github.com/users/lqiu96/orgs","repos_url":"https://api.github.com/users/lqiu96/repos","events_url":"https://api.github.com/users/lqiu96/events{/privacy}","received_events_url":"https://api.github.com/users/lqiu96/received_events","type":"User","site_admin":false},"body":"Fixes: https://github.com/googleapis/sdk-platform-java/issues/2725","created_at":"2024-05-14T19:49:38Z","updated_at":"2024-05-14T19:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27a9dcb008bc1c9658c98d4e9d2f08d8e167e9b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132010215,"node_id":"LA_kwDOD7wwCM8AAAABMeRC5w","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20l","name":"size: l","color":"1d0ef7","default":false,"description":"Pull request size is large."}],"milestone":null,"draft":true,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a73482f9a4e93bed1544bf47b2e2bc6f452c8eee","head":{"label":"googleapis:gapic-generator-junit5","ref":"gapic-generator-junit5","sha":"a73482f9a4e93bed1544bf47b2e2bc6f452c8eee","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"b87356c1d80559fd5ca85ee0edfa3e5f24db6b17","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2771"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a73482f9a4e93bed1544bf47b2e2bc6f452c8eee"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770","id":1869660712,"node_id":"PR_kwDOD7wwCM5vcMIo","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2770","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2770.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2770.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770","number":2770,"state":"closed","locked":false,"title":"test(deps): update dependency org.mockito:mockito-core to v5.12.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `5.11.0` -> `5.12.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n

\nmockito/mockito (org.mockito:mockito-core)\n\n### [`v5.12.0`](https://togithub.com/mockito/mockito/releases/tag/v5.12.0)\n\n*Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)*\n\n##### 5.12.0\n\n- 2024-05-11 - [25 commit(s)](https://togithub.com/mockito/mockito/compare/v5.11.0...v5.12.0) by Piotr Przybylak, Stefano Cordio, Tim van der Lippe, dependabot\\[bot], jonghoonpark\n- Bump com.gradle.enterprise from 3.17.2 to 3.17.3 [(#​3341)](https://togithub.com/mockito/mockito/pull/3341)\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.23 to 1.9.24 [(#​3339)](https://togithub.com/mockito/mockito/pull/3339)\n- Bump versions.bytebuddy from 1.14.14 to 1.14.15 [(#​3338)](https://togithub.com/mockito/mockito/pull/3338)\n- Bump org.shipkit:shipkit-auto-version from 2.0.6 to 2.0.7 [(#​3337)](https://togithub.com/mockito/mockito/pull/3337)\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.23 to 1.9.24 [(#​3336)](https://togithub.com/mockito/mockito/pull/3336)\n- Fixes [#​3331](https://togithub.com/mockito/mockito/issues/3331) : Fix `AdditionalMatchers.and()` and `AdditionalMatchers.or()` not to swap the order of matchers [(#​3335)](https://togithub.com/mockito/mockito/pull/3335)\n- AdditionalMatchers.and() and or() swap matcher order [(#​3331)](https://togithub.com/mockito/mockito/issues/3331)\n- Bump gradle/wrapper-validation-action from 3.3.1 to 3.3.2 [(#​3327)](https://togithub.com/mockito/mockito/pull/3327)\n- Bump versions.bytebuddy from 1.14.13 to 1.14.14 [(#​3324)](https://togithub.com/mockito/mockito/pull/3324)\n- Bump org.shipkit:shipkit-auto-version from 2.0.5 to 2.0.6 [(#​3322)](https://togithub.com/mockito/mockito/pull/3322)\n- Bump gradle/wrapper-validation-action from 3.3.0 to 3.3.1 [(#​3320)](https://togithub.com/mockito/mockito/pull/3320)\n- Bump com.gradle.enterprise from 3.17 to 3.17.2 [(#​3318)](https://togithub.com/mockito/mockito/pull/3318)\n- Bump gradle/wrapper-validation-action from 2.1.2 to 3.3.0 [(#​3317)](https://togithub.com/mockito/mockito/pull/3317)\n- Update codecov-action version [(#​3316)](https://togithub.com/mockito/mockito/pull/3316)\n- Bump com.google.googlejavaformat:google-java-format from 1.21.0 to 1.22.0 [(#​3312)](https://togithub.com/mockito/mockito/pull/3312)\n- Bump com.gradle.enterprise from 3.16.2 to 3.17 [(#​3311)](https://togithub.com/mockito/mockito/pull/3311)\n- Bump versions.bytebuddy from 1.14.12 to 1.14.13 [(#​3308)](https://togithub.com/mockito/mockito/pull/3308)\n- Fix README logo [(#​3305)](https://togithub.com/mockito/mockito/pull/3305)\n- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2 [(#​3303)](https://togithub.com/mockito/mockito/pull/3303)\n- Bump org.shipkit:shipkit-auto-version from 2.0.4 to 2.0.5 [(#​3298)](https://togithub.com/mockito/mockito/pull/3298)\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 1.9.23 [(#​3296)](https://togithub.com/mockito/mockito/pull/3296)\n- Bump org.eclipse.platform:org.eclipse.osgi from 3.18.600 to 3.19.0 [(#​3295)](https://togithub.com/mockito/mockito/pull/3295)\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23 [(#​3292)](https://togithub.com/mockito/mockito/pull/3292)\n- Bump com.google.googlejavaformat:google-java-format from 1.20.0 to 1.21.0 [(#​3291)](https://togithub.com/mockito/mockito/pull/3291)\n- Fixes [#​3286](https://togithub.com/mockito/mockito/issues/3286) : Mockito.only() points to the wanted call as unwanted if it is the first being calledIssue3286 [(#​3287)](https://togithub.com/mockito/mockito/pull/3287)\n- Mockito.only() points to the wanted call as unwanted if it is the first being called. [(#​3286)](https://togithub.com/mockito/mockito/issues/3286)\n- Bump org.codehaus.groovy:groovy from 3.0.20 to 3.0.21 [(#​3284)](https://togithub.com/mockito/mockito/pull/3284)\n\n
\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T19:02:21Z","updated_at":"2024-05-14T19:47:04Z","closed_at":"2024-05-14T19:47:04Z","merged_at":"2024-05-14T19:47:04Z","merge_commit_sha":"3d7ab40311ccebc881bb5cbed7cf150355133f78","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/ef3f0769652205d6f341b68b79a10bab6e14ea75","head":{"label":"renovate-bot:renovate/mockito-monorepo","ref":"renovate/mockito-monorepo","sha":"ef3f0769652205d6f341b68b79a10bab6e14ea75","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"a39aa07d013c9c097ad93fd68cf97da1c7d9ff03","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2770"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/ef3f0769652205d6f341b68b79a10bab6e14ea75"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"test(deps): update dependency org.mockito:mockito-core to v5.12.0 (#2770)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n| [org.mockito:mockito-core](https://togithub.com/mockito/mockito) |\r\n`5.11.0` -> `5.12.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
\r\nmockito/mockito (org.mockito:mockito-core)\r\n\r\n###\r\n[`v5.12.0`](https://togithub.com/mockito/mockito/releases/tag/v5.12.0)\r\n\r\n*Changelog generated by [Shipkit Changelog Gradle\r\nPlugin](https://togithub.com/shipkit/shipkit-changelog)*\r\n\r\n##### 5.12.0\r\n\r\n- 2024-05-11 - [25\r\ncommit(s)](https://togithub.com/mockito/mockito/compare/v5.11.0...v5.12.0)\r\nby Piotr Przybylak, Stefano Cordio, Tim van der Lippe, dependabot\\[bot],\r\njonghoonpark\r\n- Bump com.gradle.enterprise from 3.17.2 to 3.17.3\r\n[(#​3341)](https://togithub.com/mockito/mockito/pull/3341)\r\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.23 to 1.9.24\r\n[(#​3339)](https://togithub.com/mockito/mockito/pull/3339)\r\n- Bump versions.bytebuddy from 1.14.14 to 1.14.15\r\n[(#​3338)](https://togithub.com/mockito/mockito/pull/3338)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.6 to 2.0.7\r\n[(#​3337)](https://togithub.com/mockito/mockito/pull/3337)\r\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.23 to 1.9.24\r\n[(#​3336)](https://togithub.com/mockito/mockito/pull/3336)\r\n- Fixes [#​3331](https://togithub.com/mockito/mockito/issues/3331)\r\n: Fix `AdditionalMatchers.and()` and `AdditionalMatchers.or()` not to\r\nswap the order of matchers\r\n[(#​3335)](https://togithub.com/mockito/mockito/pull/3335)\r\n- AdditionalMatchers.and() and or() swap matcher order\r\n[(#​3331)](https://togithub.com/mockito/mockito/issues/3331)\r\n- Bump gradle/wrapper-validation-action from 3.3.1 to 3.3.2\r\n[(#​3327)](https://togithub.com/mockito/mockito/pull/3327)\r\n- Bump versions.bytebuddy from 1.14.13 to 1.14.14\r\n[(#​3324)](https://togithub.com/mockito/mockito/pull/3324)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.5 to 2.0.6\r\n[(#​3322)](https://togithub.com/mockito/mockito/pull/3322)\r\n- Bump gradle/wrapper-validation-action from 3.3.0 to 3.3.1\r\n[(#​3320)](https://togithub.com/mockito/mockito/pull/3320)\r\n- Bump com.gradle.enterprise from 3.17 to 3.17.2\r\n[(#​3318)](https://togithub.com/mockito/mockito/pull/3318)\r\n- Bump gradle/wrapper-validation-action from 2.1.2 to 3.3.0\r\n[(#​3317)](https://togithub.com/mockito/mockito/pull/3317)\r\n- Update codecov-action version\r\n[(#​3316)](https://togithub.com/mockito/mockito/pull/3316)\r\n- Bump com.google.googlejavaformat:google-java-format from 1.21.0 to\r\n1.22.0 [(#​3312)](https://togithub.com/mockito/mockito/pull/3312)\r\n- Bump com.gradle.enterprise from 3.16.2 to 3.17\r\n[(#​3311)](https://togithub.com/mockito/mockito/pull/3311)\r\n- Bump versions.bytebuddy from 1.14.12 to 1.14.13\r\n[(#​3308)](https://togithub.com/mockito/mockito/pull/3308)\r\n- Fix README logo\r\n[(#​3305)](https://togithub.com/mockito/mockito/pull/3305)\r\n- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2\r\n[(#​3303)](https://togithub.com/mockito/mockito/pull/3303)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.4 to 2.0.5\r\n[(#​3298)](https://togithub.com/mockito/mockito/pull/3298)\r\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 1.9.23\r\n[(#​3296)](https://togithub.com/mockito/mockito/pull/3296)\r\n- Bump org.eclipse.platform:org.eclipse.osgi from 3.18.600 to 3.19.0\r\n[(#​3295)](https://togithub.com/mockito/mockito/pull/3295)\r\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23\r\n[(#​3292)](https://togithub.com/mockito/mockito/pull/3292)\r\n- Bump com.google.googlejavaformat:google-java-format from 1.20.0 to\r\n1.21.0 [(#​3291)](https://togithub.com/mockito/mockito/pull/3291)\r\n- Fixes [#​3286](https://togithub.com/mockito/mockito/issues/3286)\r\n: Mockito.only() points to the wanted call as unwanted if it is the\r\nfirst being calledIssue3286\r\n[(#​3287)](https://togithub.com/mockito/mockito/pull/3287)\r\n- Mockito.only() points to the wanted call as unwanted if it is the\r\nfirst being called.\r\n[(#​3286)](https://togithub.com/mockito/mockito/issues/3286)\r\n- Bump org.codehaus.groovy:groovy from 3.0.20 to 3.0.21\r\n[(#​3284)](https://togithub.com/mockito/mockito/pull/3284)\r\n\r\n
\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update\r\nagain.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n\r\n\r\nCo-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769","id":1869542291,"node_id":"PR_kwDOD7wwCM5vbvOT","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2769","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2769.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2769.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769","number":2769,"state":"closed","locked":false,"title":"deps: update opentelemetry-java monorepo to v1.38.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [io.opentelemetry:opentelemetry-api](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n| [io.opentelemetry:opentelemetry-bom](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
\nopen-telemetry/opentelemetry-java (io.opentelemetry:opentelemetry-api)\n\n### [`v1.38.0`](https://togithub.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1380-2024-05-10)\n\n##### API\n\n- Stabilize synchronous gauge\n ([#​6419](https://togithub.com/open-telemetry/opentelemetry-java/pull/6419))\n\n##### Incubator\n\n- Add put(AttributeKey, T) overload to EventBuilder\n ([#​6331](https://togithub.com/open-telemetry/opentelemetry-java/pull/6331))\n\n##### Baggage\n\n- Baggage filters space-only keys\n ([#​6431](https://togithub.com/open-telemetry/opentelemetry-java/pull/6431))\n\n##### SDK\n\n- Add experimental scope config to enable / disable scopes (i.e. meter, logger, tracer)\n ([#​6375](https://togithub.com/open-telemetry/opentelemetry-java/pull/6375))\n\n##### Traces\n\n- Add ReadableSpan#getAttributes\n ([#​6382](https://togithub.com/open-telemetry/opentelemetry-java/pull/6382))\n- Use standard ArrayList size rather than max number of links for initial span links allocation\n ([#​6252](https://togithub.com/open-telemetry/opentelemetry-java/pull/6252))\n\n##### Metrics\n\n- Use low precision Clock#now when computing timestamp for exemplars\n ([#​6417](https://togithub.com/open-telemetry/opentelemetry-java/pull/6417))\n- Update invalid instrument name log message now that forward slash `/` is valid\n ([#​6343](https://togithub.com/open-telemetry/opentelemetry-java/pull/6343))\n\n##### Exporters\n\n- Introduce low allocation OTLP marshalers. If using autoconfigure, opt in\n via `OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=REUSABLE_DATA`.\n - Low allocation OTLP logs marshaler\n ([#​6429](https://togithub.com/open-telemetry/opentelemetry-java/pull/6429))\n - Low allocation OTLP metrics marshaler\n ([#​6422](https://togithub.com/open-telemetry/opentelemetry-java/pull/6422))\n - Low allocation OTLP trace marshaler\n ([#​6410](https://togithub.com/open-telemetry/opentelemetry-java/pull/6410))\n - Add memory mode support to OTLP exporters\n ([#​6430](https://togithub.com/open-telemetry/opentelemetry-java/pull/6430))\n - Marshal span status description without allocation\n ([#​6423](https://togithub.com/open-telemetry/opentelemetry-java/pull/6423))\n - Add private constructors for stateless marshalers\n ([#​6434](https://togithub.com/open-telemetry/opentelemetry-java/pull/6434))\n- Mark opentelemetry-exporter-sender-jdk stable\n ([#​6357](https://togithub.com/open-telemetry/opentelemetry-java/pull/6357))\n- PrometheusHttpServer prevent concurrent reads when reusable memory mode\n ([#​6371](https://togithub.com/open-telemetry/opentelemetry-java/pull/6371))\n- Ignore TLS components (SSLContext, TrustManager, KeyManager) if plain HTTP protocol is used for\n exporting\n ([#​6329](https://togithub.com/open-telemetry/opentelemetry-java/pull/6329))\n- Add is_remote_parent span flags to OTLP exported Spans and SpanLinks\n ([#​6388](https://togithub.com/open-telemetry/opentelemetry-java/pull/6388))\n- Add missing fields to OTLP metric exporters `toString()`\n ([#​6402](https://togithub.com/open-telemetry/opentelemetry-java/pull/6402))\n\n##### Extensions\n\n- Rename otel.config.file to otel.experimental.config.file for autoconfigure\n ([#​6396](https://togithub.com/open-telemetry/opentelemetry-java/pull/6396))\n\n##### OpenCensus Shim\n\n- Fix opencensus shim spanBuilderWithRemoteParent behavior\n ([#​6415](https://togithub.com/open-telemetry/opentelemetry-java/pull/6415))\n\n##### Tooling\n\n- Add additional API incubator docs\n ([#​6356](https://togithub.com/open-telemetry/opentelemetry-java/pull/6356))\n- Run build on java 21\n ([#​6370](https://togithub.com/open-telemetry/opentelemetry-java/pull/6370))\n- Fix running tests with java 8 on macos\n ([#​6411](https://togithub.com/open-telemetry/opentelemetry-java/pull/6411))\n- Move away from deprecated gradle enterprise APIs\n ([#​6363](https://togithub.com/open-telemetry/opentelemetry-java/pull/6363))\n\n
\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T18:02:11Z","updated_at":"2024-05-14T19:02:28Z","closed_at":"2024-05-14T19:00:46Z","merged_at":"2024-05-14T19:00:46Z","merge_commit_sha":"0a5c7c4075ee986028535c424e4a62458a25f8d2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/d7e77cb79599612686fe4f7d7eb45ee25206b27f","head":{"label":"renovate-bot:renovate/opentelemetry-java-monorepo","ref":"renovate/opentelemetry-java-monorepo","sha":"d7e77cb79599612686fe4f7d7eb45ee25206b27f","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"22b7398f07a77935c0c002c78e8e30dca5979652","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2769"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/d7e77cb79599612686fe4f7d7eb45ee25206b27f"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"deps: update opentelemetry-java monorepo to v1.38.0 (#2769)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n|\r\n[io.opentelemetry:opentelemetry-api](https://togithub.com/open-telemetry/opentelemetry-java)\r\n| `1.37.0` -> `1.38.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n|\r\n[io.opentelemetry:opentelemetry-bom](https://togithub.com/open-telemetry/opentelemetry-java)\r\n| `1.37.0` -> `1.38.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
\r\nopen-telemetry/opentelemetry-java\r\n(io.opentelemetry:opentelemetry-api)\r\n\r\n###\r\n[`v1.38.0`](https://togithub.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1380-2024-05-10)\r\n\r\n##### API\r\n\r\n- Stabilize synchronous gauge\r\n\r\n([#​6419](https://togithub.com/open-telemetry/opentelemetry-java/pull/6419))\r\n\r\n##### Incubator\r\n\r\n- Add put(AttributeKey, T) overload to EventBuilder\r\n\r\n([#​6331](https://togithub.com/open-telemetry/opentelemetry-java/pull/6331))\r\n\r\n##### Baggage\r\n\r\n- Baggage filters space-only keys\r\n\r\n([#​6431](https://togithub.com/open-telemetry/opentelemetry-java/pull/6431))\r\n\r\n##### SDK\r\n\r\n- Add experimental scope config to enable / disable scopes (i.e. meter,\r\nlogger, tracer)\r\n\r\n([#​6375](https://togithub.com/open-telemetry/opentelemetry-java/pull/6375))\r\n\r\n##### Traces\r\n\r\n- Add ReadableSpan#getAttributes\r\n\r\n([#​6382](https://togithub.com/open-telemetry/opentelemetry-java/pull/6382))\r\n- Use standard ArrayList size rather than max number of links for\r\ninitial span links allocation\r\n\r\n([#​6252](https://togithub.com/open-telemetry/opentelemetry-java/pull/6252))\r\n\r\n##### Metrics\r\n\r\n- Use low precision Clock#now when computing timestamp for exemplars\r\n\r\n([#​6417](https://togithub.com/open-telemetry/opentelemetry-java/pull/6417))\r\n- Update invalid instrument name log message now that forward slash `/`\r\nis valid\r\n\r\n([#​6343](https://togithub.com/open-telemetry/opentelemetry-java/pull/6343))\r\n\r\n##### Exporters\r\n\r\n- Introduce low allocation OTLP marshalers. If using autoconfigure, opt\r\nin\r\n via `OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=REUSABLE_DATA`.\r\n - Low allocation OTLP logs marshaler\r\n\r\n([#​6429](https://togithub.com/open-telemetry/opentelemetry-java/pull/6429))\r\n - Low allocation OTLP metrics marshaler\r\n\r\n([#​6422](https://togithub.com/open-telemetry/opentelemetry-java/pull/6422))\r\n - Low allocation OTLP trace marshaler\r\n\r\n([#​6410](https://togithub.com/open-telemetry/opentelemetry-java/pull/6410))\r\n - Add memory mode support to OTLP exporters\r\n\r\n([#​6430](https://togithub.com/open-telemetry/opentelemetry-java/pull/6430))\r\n - Marshal span status description without allocation\r\n\r\n([#​6423](https://togithub.com/open-telemetry/opentelemetry-java/pull/6423))\r\n - Add private constructors for stateless marshalers\r\n\r\n([#​6434](https://togithub.com/open-telemetry/opentelemetry-java/pull/6434))\r\n- Mark opentelemetry-exporter-sender-jdk stable\r\n\r\n([#​6357](https://togithub.com/open-telemetry/opentelemetry-java/pull/6357))\r\n- PrometheusHttpServer prevent concurrent reads when reusable memory\r\nmode\r\n\r\n([#​6371](https://togithub.com/open-telemetry/opentelemetry-java/pull/6371))\r\n- Ignore TLS components (SSLContext, TrustManager, KeyManager) if plain\r\nHTTP protocol is used for\r\n exporting\r\n\r\n([#​6329](https://togithub.com/open-telemetry/opentelemetry-java/pull/6329))\r\n- Add is_remote_parent span flags to OTLP exported Spans and SpanLinks\r\n\r\n([#​6388](https://togithub.com/open-telemetry/opentelemetry-java/pull/6388))\r\n- Add missing fields to OTLP metric exporters `toString()`\r\n\r\n([#​6402](https://togithub.com/open-telemetry/opentelemetry-java/pull/6402))\r\n\r\n##### Extensions\r\n\r\n- Rename otel.config.file to otel.experimental.config.file for\r\nautoconfigure\r\n\r\n([#​6396](https://togithub.com/open-telemetry/opentelemetry-java/pull/6396))\r\n\r\n##### OpenCensus Shim\r\n\r\n- Fix opencensus shim spanBuilderWithRemoteParent behavior\r\n\r\n([#​6415](https://togithub.com/open-telemetry/opentelemetry-java/pull/6415))\r\n\r\n##### Tooling\r\n\r\n- Add additional API incubator docs\r\n\r\n([#​6356](https://togithub.com/open-telemetry/opentelemetry-java/pull/6356))\r\n- Run build on java 21\r\n\r\n([#​6370](https://togithub.com/open-telemetry/opentelemetry-java/pull/6370))\r\n- Fix running tests with java 8 on macos\r\n\r\n([#​6411](https://togithub.com/open-telemetry/opentelemetry-java/pull/6411))\r\n- Move away from deprecated gradle enterprise APIs\r\n\r\n([#​6363](https://togithub.com/open-telemetry/opentelemetry-java/pull/6363))\r\n\r\n
\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about these\r\nupdates again.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768","id":1869472682,"node_id":"PR_kwDOD7wwCM5vbeOq","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2768","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2768.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2768.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768","number":2768,"state":"closed","locked":false,"title":"deps: update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [com.google.oauth-client:google-oauth-client-bom](https://togithub.com/googleapis/google-oauth-java-client/tree/master/google-oauth-client-bom) ([source](https://togithub.com/googleapis/google-oauth-java-client)) | `1.35.0` -> `1.36.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
\ngoogleapis/google-oauth-java-client (com.google.oauth-client:google-oauth-client-bom)\n\n### [`v1.36.0`](https://togithub.com/googleapis/google-oauth-java-client/blob/HEAD/CHANGELOG.md#1360-2024-05-10)\n\n[Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.35.0...v1.36.0)\n\n##### Features\n\n- Servlet classes that use the jakarta namespace ([#​1115](https://togithub.com/googleapis/google-oauth-java-client/issues/1115)) ([11d6a3c](https://togithub.com/googleapis/google-oauth-java-client/commit/11d6a3cb30c4ebfe4fc4e196d99f5764c6ade878))\n\n
\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T17:13:38Z","updated_at":"2024-05-14T18:02:15Z","closed_at":"2024-05-14T18:00:55Z","merged_at":"2024-05-14T18:00:54Z","merge_commit_sha":"22b7398f07a77935c0c002c78e8e30dca5979652","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/e62880459e145b9d968eac09a2c6a9d7e5f56011","head":{"label":"renovate-bot:renovate/google.oauth-client.version","ref":"renovate/google.oauth-client.version","sha":"e62880459e145b9d968eac09a2c6a9d7e5f56011","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"891b01d0d35384df3269cdd8b37102b2587c9188","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2768"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/e62880459e145b9d968eac09a2c6a9d7e5f56011"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767","id":1869018134,"node_id":"PR_kwDOD7wwCM5vZvQW","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2767","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2767.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2767.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767","number":2767,"state":"closed","locked":false,"title":"deps: update dependency com.google.cloud:grpc-gcp to v1.6.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [com.google.cloud:grpc-gcp](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java/tree/master/grpc-gcp) ([source](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java)) | `1.5.0` -> `1.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T13:32:19Z","updated_at":"2024-05-14T19:28:05Z","closed_at":"2024-05-14T19:28:05Z","merged_at":"2024-05-14T19:28:05Z","merge_commit_sha":"a39aa07d013c9c097ad93fd68cf97da1c7d9ff03","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/3e5ff9a2c6975d83614c91b669840eb41eff8591","head":{"label":"renovate-bot:renovate/grpc-gcp.version","ref":"renovate/grpc-gcp.version","sha":"3e5ff9a2c6975d83614c91b669840eb41eff8591","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"0a5c7c4075ee986028535c424e4a62458a25f8d2","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2767"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/3e5ff9a2c6975d83614c91b669840eb41eff8591"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766","id":1868945618,"node_id":"PR_kwDOD7wwCM5vZdjS","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2766","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2766.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2766.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766","number":2766,"state":"closed","locked":false,"title":"deps: update dependency lxml to v5.2.2","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [lxml](https://lxml.de/) ([source](https://togithub.com/lxml/lxml), [changelog](https://git.launchpad.net/lxml/plain/CHANGES.txt)) | `==5.2.1` -> `==5.2.2` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
\nlxml/lxml (lxml)\n\n### [`v5.2.2`](https://togithub.com/lxml/lxml/blob/HEAD/CHANGES.txt#522-2024--)\n\n[Compare Source](https://togithub.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2)\n\n\\==================\n\n## Bugs fixed\n\n- [GH#417](https://togithub.com/GH/lxml/issues/417): The `test_feed_parser` test could fail if `lxml_html_clean` was not installed.\n It is now skipped in that case.\n\n- [LP#2059910](https://togithub.com/LP/lxml/issues/2059910): The minimum CPU architecture for the Linux x86 binary wheels was set back to\n \"core2\", without SSE 4.2.\n\n- If libxml2 uses iconv, the compile time version is available as `etree.ICONV_COMPILED_VERSION`.\n\n
\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T13:04:09Z","updated_at":"2024-05-14T13:32:28Z","closed_at":"2024-05-14T13:31:00Z","merged_at":"2024-05-14T13:31:00Z","merge_commit_sha":"df7e211e534516f9596e230598b70fdbfdea1ac3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/c3275f72abbe839e2443a3c96abcea7aa8f993fb","head":{"label":"renovate-bot:renovate/lxml-5.x","ref":"renovate/lxml-5.x","sha":"c3275f72abbe839e2443a3c96abcea7aa8f993fb","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"d67eaf85c409dc7cf653dfb6d753d39a77292135","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2766"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/c3275f72abbe839e2443a3c96abcea7aa8f993fb"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"deps: update dependency lxml to v5.2.2 (#2766)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n| [lxml](https://lxml.de/) ([source](https://togithub.com/lxml/lxml),\r\n[changelog](https://git.launchpad.net/lxml/plain/CHANGES.txt)) |\r\n`==5.2.1` -> `==5.2.2` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
\r\nlxml/lxml (lxml)\r\n\r\n###\r\n[`v5.2.2`](https://togithub.com/lxml/lxml/blob/HEAD/CHANGES.txt#522-2024--)\r\n\r\n[Compare\r\nSource](https://togithub.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2)\r\n\r\n\\==================\r\n\r\n## Bugs fixed\r\n\r\n- [GH#417](https://togithub.com/GH/lxml/issues/417): The\r\n`test_feed_parser` test could fail if `lxml_html_clean` was not\r\ninstalled.\r\n It is now skipped in that case.\r\n\r\n- [LP#2059910](https://togithub.com/LP/lxml/issues/2059910): The minimum\r\nCPU architecture for the Linux x86 binary wheels was set back to\r\n \"core2\", without SSE 4.2.\r\n\r\n- If libxml2 uses iconv, the compile time version is available as\r\n`etree.ICONV_COMPILED_VERSION`.\r\n\r\n
\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update\r\nagain.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765","id":1865466886,"node_id":"PR_kwDOD7wwCM5vMMQG","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2765","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2765.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2765.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765","number":2765,"state":"open","locked":false,"title":"chore: centralize hermetic build workflow implementations","user":{"login":"diegomarquezp","id":22083784,"node_id":"MDQ6VXNlcjIyMDgzNzg0","avatar_url":"https://avatars.githubusercontent.com/u/22083784?v=4","gravatar_id":"","url":"https://api.github.com/users/diegomarquezp","html_url":"https://github.com/diegomarquezp","followers_url":"https://api.github.com/users/diegomarquezp/followers","following_url":"https://api.github.com/users/diegomarquezp/following{/other_user}","gists_url":"https://api.github.com/users/diegomarquezp/gists{/gist_id}","starred_url":"https://api.github.com/users/diegomarquezp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegomarquezp/subscriptions","organizations_url":"https://api.github.com/users/diegomarquezp/orgs","repos_url":"https://api.github.com/users/diegomarquezp/repos","events_url":"https://api.github.com/users/diegomarquezp/events{/privacy}","received_events_url":"https://api.github.com/users/diegomarquezp/received_events","type":"User","site_admin":false},"body":"This PR transfers the workflows and their implementations involved in hermetic library generation (i.e. `update_googleapis_committish.yaml` and `hermetic_library_generation.yaml`).\r\n\r\nThe purpose is to simplify the hermetic build setup requirements in HW libraries and google-cloud-java to simply declare two workflows that will delegate all the logic to the workflows and their corresponding scripts stored in sdk-platform-java. \r\n\r\n### Follow ups:\r\n - In google-cloud-java, remove `generation/update_googleapis_commit.sh` and `hermetic_library_generation.sh`, plus the workflows that use them.","created_at":"2024-05-12T23:06:41Z","updated_at":"2024-05-13T00:38:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e766e435c1f6db3c165f22322e93d67fb3923c5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132010215,"node_id":"LA_kwDOD7wwCM8AAAABMeRC5w","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20l","name":"size: l","color":"1d0ef7","default":false,"description":"Pull request size is large."}],"milestone":null,"draft":true,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1","head":{"label":"googleapis:centralized-hermetic-workflows","ref":"centralized-hermetic-workflows","sha":"95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"e1e1fb66d95adc08baea71c5a0607c20d5a57a8b","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2765"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764","id":1864782648,"node_id":"PR_kwDOD7wwCM5vJlM4","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2764","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2764.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2764.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764","number":2764,"state":"open","locked":false,"title":"fix: Replace deprecated protobuf methods.","user":{"login":"blakeli0","id":3975769,"node_id":"MDQ6VXNlcjM5NzU3Njk=","avatar_url":"https://avatars.githubusercontent.com/u/3975769?v=4","gravatar_id":"","url":"https://api.github.com/users/blakeli0","html_url":"https://github.com/blakeli0","followers_url":"https://api.github.com/users/blakeli0/followers","following_url":"https://api.github.com/users/blakeli0/following{/other_user}","gists_url":"https://api.github.com/users/blakeli0/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeli0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeli0/subscriptions","organizations_url":"https://api.github.com/users/blakeli0/orgs","repos_url":"https://api.github.com/users/blakeli0/repos","events_url":"https://api.github.com/users/blakeli0/events{/privacy}","received_events_url":"https://api.github.com/users/blakeli0/received_events","type":"User","site_admin":false},"body":"`isSynthetic()` is deprecated and will be [removed](https://github.com/protocolbuffers/protobuf/commit/1aeacd4f4eb4e0aa05d6336e2988a565e475e9a0#diff-2228551d02c6661809ca7103db9512eef4c2d01f35556d42316543d92a89edefL2846-L2847) in protobuf-java 4.26.0, replace it so that we can prepare for protobuf-java upgrade.\r\n\r\nPer [official doc](https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md) of protobuf. See b/266950618#comment123 for suggested replacements of `isSynthetic()`.","created_at":"2024-05-11T06:01:40Z","updated_at":"2024-05-14T21:17:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75927728d5154dd597511184a0b0d801aa00624d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"suztomo","id":28604,"node_id":"MDQ6VXNlcjI4NjA0","avatar_url":"https://avatars.githubusercontent.com/u/28604?v=4","gravatar_id":"","url":"https://api.github.com/users/suztomo","html_url":"https://github.com/suztomo","followers_url":"https://api.github.com/users/suztomo/followers","following_url":"https://api.github.com/users/suztomo/following{/other_user}","gists_url":"https://api.github.com/users/suztomo/gists{/gist_id}","starred_url":"https://api.github.com/users/suztomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suztomo/subscriptions","organizations_url":"https://api.github.com/users/suztomo/orgs","repos_url":"https://api.github.com/users/suztomo/repos","events_url":"https://api.github.com/users/suztomo/events{/privacy}","received_events_url":"https://api.github.com/users/suztomo/received_events","type":"User","site_admin":false},{"login":"lqiu96","id":6621793,"node_id":"MDQ6VXNlcjY2MjE3OTM=","avatar_url":"https://avatars.githubusercontent.com/u/6621793?v=4","gravatar_id":"","url":"https://api.github.com/users/lqiu96","html_url":"https://github.com/lqiu96","followers_url":"https://api.github.com/users/lqiu96/followers","following_url":"https://api.github.com/users/lqiu96/following{/other_user}","gists_url":"https://api.github.com/users/lqiu96/gists{/gist_id}","starred_url":"https://api.github.com/users/lqiu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lqiu96/subscriptions","organizations_url":"https://api.github.com/users/lqiu96/orgs","repos_url":"https://api.github.com/users/lqiu96/repos","events_url":"https://api.github.com/users/lqiu96/events{/privacy}","received_events_url":"https://api.github.com/users/lqiu96/received_events","type":"User","site_admin":false}],"requested_teams":[{"name":"cloud-java-team-teamsync","id":5195423,"node_id":"T_kwDOAQAgO84AT0af","slug":"cloud-java-team-teamsync","description":"TeamSync managed team","privacy":"closed","notification_setting":"notifications_enabled","url":"https://api.github.com/organizations/16785467/team/5195423","html_url":"https://github.com/orgs/googleapis/teams/cloud-java-team-teamsync","members_url":"https://api.github.com/organizations/16785467/team/5195423/members{/member}","repositories_url":"https://api.github.com/organizations/16785467/team/5195423/repos","permission":"pull","parent":null}],"labels":[{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/28b1139f428096392ab3aac15ddd2b512dd37c06","head":{"label":"googleapis:fix-deprecated-proto-methods","ref":"fix-deprecated-proto-methods","sha":"28b1139f428096392ab3aac15ddd2b512dd37c06","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"a4726206146a503822f685caa1e4d04273b738dc","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2764"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/28b1139f428096392ab3aac15ddd2b512dd37c06"}},"author_association":"COLLABORATOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761","id":1862759879,"node_id":"PR_kwDOD7wwCM5vB3XH","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2761","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2761.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2761.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761","number":2761,"state":"closed","locked":false,"title":"fix: prepare to generate grafeas","user":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"body":"In this PR:\r\n- Add suffix to sample source folder\r\n- Add unit tests\r\n\r\nContext:\r\n- The package name of grafeas is `io.grafeas.v1` which is not starts with `com`. When copying samples to destination directory, we need to change the suffix of source directory.\r\n- grafeas doesn't have a valid api_id (empty string). Before this change, the `api_id` will be populated as `{library.api_shortname}.googleapis.com`, which is not correct. `api_id` should not be populated to `.repo-metadata.json` if set to empty string.\r\n\r\nWith the library entry added in generation configuration:\r\n```\r\n- api_shortname: containeranalysis\r\n name_pretty: Grafeas\r\n product_documentation: https://grafeas.io\r\n api_description: n/a\r\n client_documentation: \"https://cloud.google.com/java/docs/reference/grafeas/latest/overview\"\r\n release_level: stable\r\n distribution_name: \"io.grafeas:grafeas\"\r\n api_id: \"\"\r\n codeowner_team: \"@googleapis/aap-dpes\"\r\n library_name: grafeas\r\n requires_billing: false\r\n GAPICs:\r\n - proto_path: grafeas/v1\r\n ```\r\n\r\nThe generated java-grafeas is in https://github.com/googleapis/google-cloud-java/pull/10820","created_at":"2024-05-09T20:31:50Z","updated_at":"2024-05-13T20:25:14Z","closed_at":"2024-05-13T20:25:13Z","merged_at":"2024-05-13T20:25:13Z","merge_commit_sha":"1114f1863bf5ae15ee56631fd824a2269e91746d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5133297485,"node_id":"LA_kwDOD7wwCM8AAAABMffnTQ","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20m","name":"size: m","color":"c406d7","default":false,"description":"Pull request size is medium."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a8cfbdcfd9744e0df19cab4589354c18a8ad70f7","head":{"label":"googleapis:fix/generate-grafeas","ref":"fix/generate-grafeas","sha":"a8cfbdcfd9744e0df19cab4589354c18a8ad70f7","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"e1e1fb66d95adc08baea71c5a0607c20d5a57a8b","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2761"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a8cfbdcfd9744e0df19cab4589354c18a8ad70f7"}},"author_association":"COLLABORATOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760","id":1862713220,"node_id":"PR_kwDOD7wwCM5vBr-E","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2760","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2760.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2760.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760","number":2760,"state":"closed","locked":false,"title":"ci: increase graalvm ci machine type","user":{"login":"burkedavison","id":40617934,"node_id":"MDQ6VXNlcjQwNjE3OTM0","avatar_url":"https://avatars.githubusercontent.com/u/40617934?v=4","gravatar_id":"","url":"https://api.github.com/users/burkedavison","html_url":"https://github.com/burkedavison","followers_url":"https://api.github.com/users/burkedavison/followers","following_url":"https://api.github.com/users/burkedavison/following{/other_user}","gists_url":"https://api.github.com/users/burkedavison/gists{/gist_id}","starred_url":"https://api.github.com/users/burkedavison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burkedavison/subscriptions","organizations_url":"https://api.github.com/users/burkedavison/orgs","repos_url":"https://api.github.com/users/burkedavison/repos","events_url":"https://api.github.com/users/burkedavison/events{/privacy}","received_events_url":"https://api.github.com/users/burkedavison/received_events","type":"User","site_admin":false},"body":"8m33s, 8m44s, 10m43s, 11m28s, 9m41s, 10m47s\r\n\r\nThese test times are all shorter than the ci / build (11) check, making these checks no longer the bottle neck.","created_at":"2024-05-09T20:00:47Z","updated_at":"2024-05-09T20:23:56Z","closed_at":"2024-05-09T20:23:55Z","merged_at":"2024-05-09T20:23:55Z","merge_commit_sha":"197331ba864b0036bb39f0f18d15d81205057808","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132322442,"node_id":"LA_kwDOD7wwCM8AAAABMekGig","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20s","name":"size: s","color":"af9955","default":false,"description":"Pull request size is small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/db9bcb0eba9435390f7c84729028cc0273d79af4","head":{"label":"googleapis:beefier-graalvm-machines","ref":"beefier-graalvm-machines","sha":"db9bcb0eba9435390f7c84729028cc0273d79af4","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"69f5aecbb7d615eddf38ef236a944800edb8d731","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2760"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/db9bcb0eba9435390f7c84729028cc0273d79af4"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"burkedavison","id":40617934,"node_id":"MDQ6VXNlcjQwNjE3OTM0","avatar_url":"https://avatars.githubusercontent.com/u/40617934?v=4","gravatar_id":"","url":"https://api.github.com/users/burkedavison","html_url":"https://github.com/burkedavison","followers_url":"https://api.github.com/users/burkedavison/followers","following_url":"https://api.github.com/users/burkedavison/following{/other_user}","gists_url":"https://api.github.com/users/burkedavison/gists{/gist_id}","starred_url":"https://api.github.com/users/burkedavison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burkedavison/subscriptions","organizations_url":"https://api.github.com/users/burkedavison/orgs","repos_url":"https://api.github.com/users/burkedavison/repos","events_url":"https://api.github.com/users/burkedavison/events{/privacy}","received_events_url":"https://api.github.com/users/burkedavison/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"ci: increase graalvm ci machine type (#2760)","commit_message":"8m33s, 8m44s, 10m43s, 11m28s, 9m41s, 10m47s\r\n\r\nThese test times are all shorter than the ci / build (11) check, making\r\nthese checks no longer the bottle neck."},"active_lock_reason":null}] \ No newline at end of file From c4ce1403b0c43fee4dc80be60f43f6952e57f4ff Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 16 May 2024 14:43:19 -0400 Subject: [PATCH 19/29] chore: exclude `google-api-client-bom` from google api dependencies group (#2781) In this PR: - Exclude `google-api-client-bom` from google api dependencies group --- renovate.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index a6303eaf38..55c61cc419 100644 --- a/renovate.json +++ b/renovate.json @@ -161,7 +161,11 @@ }, { "matchPackagePatterns": [ - "^com.google.api" + "com.google.api.grpc:grpc-google-common-protos", + "com.google.api.grpc:grpc-google-iam-v1", + "com.google.api.grpc:proto-google-common-protos", + "com.google.api.grpc:proto-google-iam-v1", + "com.google.api:api-common" ], "groupName": "Google API dependencies" }, From c2ba1d4e29f6abd3e6ea77c22587313775d9c2e4 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 16 May 2024 14:58:30 -0400 Subject: [PATCH 20/29] chore: use Junit5 in java core (#2754) Fix #2726. `BaseSerializationTest` will not migrate to Junit 5 because downstream libraries, e.g., java-logging, are extending this class and these libraries still use Junit 4. Migrating this class to Junit 5 will cause test failures in downstream libraries. --- gapic-generator-java-pom-parent/pom.xml | 1 + java-core/google-cloud-core-grpc/pom.xml | 14 ++- .../grpc/BaseGrpcServiceExceptionTest.java | 16 +-- .../cloud/grpc/GrpcTransportOptionsTest.java | 20 +-- .../cloud/grpc/SharedResourceHolderTest.java | 42 ++++--- java-core/google-cloud-core-http/pom.xml | 14 ++- .../http/BaseHttpServiceExceptionTest.java | 18 +-- .../cloud/http/CensusHttpModuleTest.java | 44 +++---- .../cloud/http/HttpTransportOptionsTest.java | 41 +++--- java-core/google-cloud-core/pom.xml | 14 ++- .../com/google/cloud/AsyncPageImplTest.java | 14 +-- .../google/cloud/BaseSerializationTest.java | 4 + .../cloud/BaseServiceExceptionTest.java | 18 +-- .../google/cloud/BaseWriteChannelTest.java | 37 +++--- .../com/google/cloud/BatchResultTest.java | 24 ++-- .../java/com/google/cloud/ByteArrayTest.java | 34 ++--- .../java/com/google/cloud/ConditionTest.java | 8 +- .../test/java/com/google/cloud/DateTest.java | 25 ++-- .../google/cloud/ExceptionHandlerTest.java | 27 ++-- .../google/cloud/FieldSelectorHelperTest.java | 16 +-- .../java/com/google/cloud/IdentityTest.java | 81 ++++++------ .../MonitoredResourceDescriptorTest.java | 16 +-- .../google/cloud/MonitoredResourceTest.java | 14 +-- .../java/com/google/cloud/PageImplTest.java | 10 +- .../java/com/google/cloud/PolicyTest.java | 36 +++--- .../java/com/google/cloud/PolicyV3Test.java | 42 +++---- .../com/google/cloud/RetryOptionTest.java | 12 +- .../test/java/com/google/cloud/RoleTest.java | 19 +-- .../com/google/cloud/ServiceOptionsTest.java | 93 +++++++------- .../java/com/google/cloud/StringEnumTest.java | 38 +++--- .../java/com/google/cloud/StructsTest.java | 33 +++-- .../java/com/google/cloud/TimestampTest.java | 118 +++++++----------- .../cloud/testing/BaseEmulatorHelperTest.java | 10 +- .../cloud/testing/CommandWrapperTest.java | 22 ++-- .../google/cloud/testing/LogRecorderTest.java | 8 +- .../com/google/cloud/testing/VersionTest.java | 61 +++------ java-core/pom.xml | 6 - .../third-party-dependencies/pom.xml | 7 ++ 38 files changed, 521 insertions(+), 536 deletions(-) diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index f044a8a0c0..9d0d87dace 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -37,6 +37,7 @@ 2.27.1 3.0.0 1.6.9 + 5.10.2
diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index 463b022ef6..7781dac24d 100644 --- a/java-core/google-cloud-core-grpc/pom.xml +++ b/java-core/google-cloud-core-grpc/pom.xml @@ -56,8 +56,18 @@
- junit - junit + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine test diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java index 696de60c55..9eb2a7fd49 100644 --- a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java @@ -20,10 +20,10 @@ import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.gax.grpc.GrpcStatusCode; import com.google.api.gax.rpc.InternalException; @@ -33,16 +33,16 @@ import java.io.IOException; import java.net.SocketException; import java.net.SocketTimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BaseGrpcServiceExceptionTest { +class BaseGrpcServiceExceptionTest { private static final String MESSAGE = "some message"; private static final boolean NOT_RETRYABLE = false; private static final boolean IDEMPOTENT = true; @Test - public void testBaseServiceException() { + void testBaseServiceException() { BaseGrpcServiceException serviceException = null; IOException exception = new SocketTimeoutException(); @@ -86,7 +86,7 @@ public void testBaseServiceException() { } @Test - public void testTranslateAndThrow() throws Exception { + void testTranslateAndThrow() throws Exception { IOException exception = new SocketTimeoutException(); BaseGrpcServiceException cause = new BaseGrpcServiceException(exception, IDEMPOTENT); RetryHelper.RetryHelperException exceptionMock = diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java index b51eab96ce..a112dd5e07 100644 --- a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java @@ -16,18 +16,18 @@ package com.google.cloud.grpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.grpc.GrpcTransportOptions.DefaultExecutorFactory; import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory; import java.util.concurrent.ScheduledExecutorService; import org.easymock.EasyMock; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcTransportOptionsTest { +class GrpcTransportOptionsTest { private static final ExecutorFactory MOCK_EXECUTOR_FACTORY = EasyMock.createMock(ExecutorFactory.class); @@ -38,13 +38,13 @@ public class GrpcTransportOptionsTest { private static final GrpcTransportOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); @Test - public void testBuilder() { + void testBuilder() { assertSame(MOCK_EXECUTOR_FACTORY, OPTIONS.getExecutorFactory()); assertTrue(DEFAULT_OPTIONS.getExecutorFactory() instanceof DefaultExecutorFactory); } @Test - public void testBaseEquals() { + void testBaseEquals() { assertEquals(OPTIONS, OPTIONS_COPY); assertNotEquals(DEFAULT_OPTIONS, OPTIONS); GrpcTransportOptions options = @@ -53,7 +53,7 @@ public void testBaseEquals() { } @Test - public void testBaseHashCode() { + void testBaseHashCode() { assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); GrpcTransportOptions options = @@ -62,7 +62,7 @@ public void testBaseHashCode() { } @Test - public void testDefaultExecutorFactory() { + void testDefaultExecutorFactory() { ExecutorFactory executorFactory = new DefaultExecutorFactory(); ScheduledExecutorService executorService = executorFactory.get(); assertSame(executorService, executorFactory.get()); diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java index ba70a0de55..3e1ceee9ef 100644 --- a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java @@ -16,8 +16,19 @@ package com.google.cloud.grpc; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; +import static org.easymock.EasyMock.anyLong; +import static org.easymock.EasyMock.anyObject; +import static org.easymock.EasyMock.createNiceMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.LinkedList; import java.util.concurrent.Delayed; @@ -26,20 +37,17 @@ import java.util.concurrent.TimeUnit; import org.easymock.EasyMock; import org.easymock.IAnswer; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * This class was copied from grpc-core to prevent dependence on an unstable API that may be subject - * to changes - * (https://github.com/grpc/grpc-java/blob/d07ecbe037d2705a1c9f4b6345581f860e505b56/core/src/test/java/io/grpc/internal/SharedResourceHolderTest.java) + * to changes (SharedResourceHolderTest) * *

Unit tests for {@link SharedResourceHolder}. */ -@RunWith(JUnit4.class) -public class SharedResourceHolderTest { +class SharedResourceHolderTest { private final LinkedList> scheduledDestroyTasks = new LinkedList<>(); @@ -67,13 +75,13 @@ public void close(ResourceInstance instance) { private static final SharedResourceHolder.Resource SHARED_BAR = new ResourceFactory(); - @Before - public void setUp() { + @BeforeEach + void setUp() { holder = new SharedResourceHolder(new MockExecutorFactory()); } @Test - public void destroyResourceWhenRefCountReachesZero() { + void destroyResourceWhenRefCountReachesZero() { ResourceInstance foo1 = holder.getInternal(SHARED_FOO); ResourceInstance sharedFoo = foo1; ResourceInstance foo2 = holder.getInternal(SHARED_FOO); @@ -121,7 +129,7 @@ public void destroyResourceWhenRefCountReachesZero() { } @Test - public void cancelDestroyTask() { + void cancelDestroyTask() { ResourceInstance foo1 = holder.getInternal(SHARED_FOO); ResourceInstance sharedFoo = foo1; holder.releaseInternal(SHARED_FOO, foo1); @@ -148,7 +156,7 @@ public void cancelDestroyTask() { } @Test - public void releaseWrongInstance() { + void releaseWrongInstance() { ResourceInstance uncached = new ResourceInstance(); try { holder.releaseInternal(SHARED_FOO, uncached); @@ -167,7 +175,7 @@ public void releaseWrongInstance() { } @Test - public void overreleaseInstance() { + void overreleaseInstance() { ResourceInstance foo1 = holder.getInternal(SHARED_FOO); holder.releaseInternal(SHARED_FOO, foo1); try { @@ -179,7 +187,7 @@ public void overreleaseInstance() { } @Test - public void handleInstanceCloseError() { + void handleInstanceCloseError() { class ExceptionOnCloseResource implements SharedResourceHolder.Resource { @Override public ResourceInstance create() { diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml index 4aae033b7c..2dfb7936a7 100644 --- a/java-core/google-cloud-core-http/pom.xml +++ b/java-core/google-cloud-core-http/pom.xml @@ -77,8 +77,18 @@ - junit - junit + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine test diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java index e88a32a9af..885cb7511d 100644 --- a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java @@ -21,10 +21,10 @@ import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.client.googleapis.json.GoogleJsonError; import com.google.cloud.BaseServiceException; @@ -35,9 +35,9 @@ import java.net.SocketTimeoutException; import java.util.Collections; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BaseHttpServiceExceptionTest { +class BaseHttpServiceExceptionTest { private static final int CODE = 1; private static final int CODE_NO_REASON = 2; @@ -53,7 +53,7 @@ private static class CustomServiceException extends BaseHttpServiceException { private static final long serialVersionUID = -195251309124875103L; - public CustomServiceException(int code, String message, String reason, boolean idempotent) { + CustomServiceException(int code, String message, String reason, boolean idempotent) { super(code, message, reason, idempotent, RETRYABLE_ERRORS); } @@ -63,7 +63,7 @@ public CustomServiceException(int code, String message, String reason, boolean i } @Test - public void testBaseServiceException() { + void testBaseServiceException() { BaseServiceException serviceException = new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); assertEquals(CODE, serviceException.getCode()); @@ -145,7 +145,7 @@ public void testBaseServiceException() { } @Test - public void testTranslateAndThrow() throws Exception { + void testTranslateAndThrow() throws Exception { BaseServiceException cause = new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); RetryHelper.RetryHelperException exceptionMock = diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java index c04d0647fb..0ac860c820 100644 --- a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java @@ -21,6 +21,7 @@ import static org.easymock.EasyMock.createMockBuilder; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpExecuteInterceptor; @@ -41,25 +42,18 @@ import java.io.IOException; import java.util.EnumSet; import java.util.Random; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** Tests for {@link CensusHttpModule}. */ -@RunWith(JUnit4.class) -public class CensusHttpModuleTest { - - @Rule public final ExpectedException thrown = ExpectedException.none(); +class CensusHttpModuleTest { private final Tracer tracer = Tracing.getTracer(); private final CensusHttpModule censusHttpModule = new CensusHttpModule(tracer, false); private HttpRequest httpRequest; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { httpRequest = new NetHttpTransport() .createRequestFactory() @@ -67,23 +61,23 @@ public void setUp() throws IOException { } @Test - public void tracerShouldNotBeNull() { + void tracerShouldNotBeNull() { assertThat(censusHttpModule.getTracer()).isNotNull(); } @Test - public void isRecordEventsShouldBeSet() { + void isRecordEventsShouldBeSet() { assertThat(censusHttpModule.isRecordEvents()).isEqualTo(false); } @Test - public void getHttpRequestInitializerShouldReturnCorrectClass() { + void getHttpRequestInitializerShouldReturnCorrectClass() { HttpRequestInitializer initializer = censusHttpModule.getHttpRequestInitializer(null); assertThat(initializer).isInstanceOf(CensusHttpModule.CensusHttpRequestInitializer.class); } @Test - public void implementationOfDefaultTextFormatSetter() { + void implementationOfDefaultTextFormatSetter() { String testKey = "testKey"; String testValue = "testValue"; TextFormat.Setter setter = @@ -93,14 +87,13 @@ public void implementationOfDefaultTextFormatSetter() { } @Test - public void censusHttpExecuteInterceptorDisallowNullRequest() throws IOException { + void censusHttpExecuteInterceptorDisallowNullRequest() { HttpExecuteInterceptor interceptor = censusHttpModule.new CensusHttpExecuteInterceptor(null); - thrown.expect(NullPointerException.class); - interceptor.intercept(null); + assertThrows(NullPointerException.class, () -> interceptor.intercept(null)); } @Test - public void censusHttpExecuteInterceptorShouldExecuteOriginal() throws IOException { + void censusHttpExecuteInterceptorShouldExecuteOriginal() throws IOException { HttpExecuteInterceptor mockInterceptor = createMock(HttpExecuteInterceptor.class); HttpExecuteInterceptor censusInterceptor = censusHttpModule.new CensusHttpExecuteInterceptor(mockInterceptor); @@ -111,7 +104,7 @@ public void censusHttpExecuteInterceptorShouldExecuteOriginal() throws IOExcepti } @Test - public void censusHttpExecuteInterceptorShouldInjectHeader() throws IOException { + void censusHttpExecuteInterceptorShouldInjectHeader() throws IOException { Random random = new Random(); SpanContext spanContext = SpanContext.create( @@ -135,14 +128,13 @@ public void censusHttpExecuteInterceptorShouldInjectHeader() throws IOException } @Test - public void censusHttpRequestInitializerDisallowNullRequest() throws IOException { + void censusHttpRequestInitializerDisallowNullRequest() { HttpRequestInitializer initializer = censusHttpModule.getHttpRequestInitializer(null); - thrown.expect(NullPointerException.class); - initializer.initialize(null); + assertThrows(NullPointerException.class, () -> initializer.initialize(null)); } @Test - public void censusHttpRequestInitializerShouldExecuteOriginal() throws IOException { + void censusHttpRequestInitializerShouldExecuteOriginal() throws IOException { HttpRequestInitializer mockOriginalInitializer = createMock(HttpRequestInitializer.class); HttpRequestInitializer censusInitializer = censusHttpModule.getHttpRequestInitializer(mockOriginalInitializer); @@ -153,7 +145,7 @@ public void censusHttpRequestInitializerShouldExecuteOriginal() throws IOExcepti } @Test - public void censusHttpRequestInitializerShouldSetInterceptor() throws IOException { + void censusHttpRequestInitializerShouldSetInterceptor() throws IOException { censusHttpModule.getHttpRequestInitializer(null).initialize(httpRequest); assertThat(httpRequest.getInterceptor()) .isInstanceOf(CensusHttpModule.CensusHttpExecuteInterceptor.class); diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java index 75ffc2bf17..1697a0c43f 100644 --- a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java @@ -16,11 +16,11 @@ package com.google.cloud.http; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpRequestInitializer; @@ -50,10 +50,10 @@ import java.util.Set; import java.util.regex.Pattern; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpTransportOptionsTest { +class HttpTransportOptionsTest { private static final HttpTransport MOCK_HTTP_TRANSPORT = new MockHttpTransport() { @Override @@ -88,8 +88,8 @@ public LowLevelHttpResponse execute() { private Credentials customCredentials; private HttpRequest defaultHttpRequest; - @Before - public void setup() throws IOException { + @BeforeEach + void setup() throws IOException { defaultHeaderProvider = EasyMock.createMock(HeaderProvider.class); EasyMock.expect(defaultHeaderProvider.getHeaders()).andReturn(new HashMap<>()); @@ -109,7 +109,7 @@ public void setup() throws IOException { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(1234, OPTIONS.getConnectTimeout()); assertSame(MOCK_HTTP_TRANSPORT_FACTORY, OPTIONS.getHttpTransportFactory()); assertEquals(5678, OPTIONS.getReadTimeout()); @@ -119,19 +119,19 @@ public void testBuilder() { } @Test - public void testBaseEquals() { + void testBaseEquals() { assertEquals(OPTIONS, OPTIONS_COPY); assertNotEquals(DEFAULT_OPTIONS, OPTIONS); } @Test - public void testBaseHashCode() { + void testBaseHashCode() { assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); } @Test - public void testHeader() { + void testHeader() { String expectedHeaderPattern = "^gl-java/.+ gccl/.* gax/.+"; ServiceOptions serviceOptions = EasyMock.createMock(ServiceOptions.class); HeaderProvider headerProvider = @@ -145,7 +145,7 @@ public void testHeader() { } @Test - public void testHttpRequestInitializer_defaultUniverseDomainSettings_defaultCredentials() + void testHttpRequestInitializer_defaultUniverseDomainSettings_defaultCredentials() throws IOException { TestServiceOptions testServiceOptions = generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, defaultCredentials); @@ -156,7 +156,7 @@ public void testHttpRequestInitializer_defaultUniverseDomainSettings_defaultCred } @Test - public void testHttpRequestInitializer_defaultUniverseDomainSettings_customCredentials() { + void testHttpRequestInitializer_defaultUniverseDomainSettings_customCredentials() { TestServiceOptions testServiceOptions = generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, customCredentials); HttpRequestInitializer httpRequestInitializer = @@ -171,7 +171,7 @@ public void testHttpRequestInitializer_defaultUniverseDomainSettings_customCrede } @Test - public void testHttpRequestInitializer_customUniverseDomainSettings_defaultCredentials() { + void testHttpRequestInitializer_customUniverseDomainSettings_defaultCredentials() { TestServiceOptions testServiceOptions = generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, defaultCredentials); HttpRequestInitializer httpRequestInitializer = @@ -186,7 +186,7 @@ public void testHttpRequestInitializer_customUniverseDomainSettings_defaultCrede } @Test - public void testHttpRequestInitializer_customUniverseDomainSettings_customCredentials() + void testHttpRequestInitializer_customUniverseDomainSettings_customCredentials() throws IOException { TestServiceOptions testServiceOptions = generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, customCredentials); @@ -197,8 +197,7 @@ public void testHttpRequestInitializer_customUniverseDomainSettings_customCreden } @Test - public void testHttpRequestInitializer_defaultUniverseDomainSettings_noCredentials() - throws IOException { + void testHttpRequestInitializer_defaultUniverseDomainSettings_noCredentials() throws IOException { NoCredentials noCredentials = NoCredentials.getInstance(); TestServiceOptions testServiceOptions = generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, noCredentials); @@ -209,7 +208,7 @@ public void testHttpRequestInitializer_defaultUniverseDomainSettings_noCredentia } @Test - public void testHttpRequestInitializer_customUniverseDomainSettings_noCredentials() { + void testHttpRequestInitializer_customUniverseDomainSettings_noCredentials() { NoCredentials noCredentials = NoCredentials.getInstance(); TestServiceOptions testServiceOptions = generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, noCredentials); diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index 90659cc850..d3584d8c8a 100644 --- a/java-core/google-cloud-core/pom.xml +++ b/java-core/google-cloud-core/pom.xml @@ -76,8 +76,18 @@ - junit - junit + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine test diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java index 241793b3be..92327a0b1c 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java @@ -16,16 +16,16 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.gax.paging.AsyncPage; import com.google.common.collect.ImmutableList; import java.util.concurrent.ExecutionException; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AsyncPageImplTest { +class AsyncPageImplTest { private static final ImmutableList VALUES1 = ImmutableList.of("1", "2"); private static final ImmutableList VALUES2 = ImmutableList.of("3", "4"); @@ -51,7 +51,7 @@ public ApiFuture> getNextPage() { } @Test - public void testPage() { + void testPage() { final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); @@ -61,7 +61,7 @@ public void testPage() { } @Test - public void testPageAsync() throws ExecutionException, InterruptedException { + void testPageAsync() throws ExecutionException, InterruptedException { final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); @@ -71,7 +71,7 @@ public void testPageAsync() throws ExecutionException, InterruptedException { } @Test - public void testIterateAll() { + void testIterateAll() { final AsyncPageImpl nextResult2 = new AsyncPageImpl<>(null, "c3", VALUES3); AsyncPageImpl.NextPageFetcher fetcher2 = new TestPageFetcher(nextResult2); final AsyncPageImpl nextResult1 = new AsyncPageImpl<>(fetcher2, "c2", VALUES2); @@ -81,7 +81,7 @@ public void testIterateAll() { } @Test - public void testAsyncPageAndIterateAll() throws ExecutionException, InterruptedException { + void testAsyncPageAndIterateAll() throws ExecutionException, InterruptedException { final AsyncPageImpl nextResult2 = new AsyncPageImpl<>(null, "c3", VALUES3); AsyncPageImpl.NextPageFetcher fetcher2 = new TestPageFetcher(nextResult2); final AsyncPageImpl nextResult1 = new AsyncPageImpl<>(fetcher2, "c2", VALUES2); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java index 5dcd1726bb..bbc13770ae 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java @@ -34,6 +34,10 @@ * {@code restorableObjects()} method to return all restorable objects whose state must be tested * for proper serialization. Both methods can return {@code null} if no such object needs to be * tested. + * + *

This class has not migrated to Junit 5 because downstream libraries, e.g., java-logging, are + * extending this class and these libraries still use Junit 4. Migrating this class to Junit 5 will + * cause test failures in downstream libraries. */ public abstract class BaseSerializationTest { diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java index 4bc5993f7f..cfa06a6586 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java @@ -22,18 +22,18 @@ import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.BaseServiceException.ExceptionData; import com.google.common.collect.ImmutableSet; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** Tests for {@link BaseServiceException}. */ -public class BaseServiceExceptionTest { +class BaseServiceExceptionTest { private static final int CODE = 1; private static final int CODE_NO_REASON = 2; @@ -64,7 +64,7 @@ public CustomServiceException(int code, String message, String reason, boolean i } @Test - public void testBaseServiceException() { + void testBaseServiceException() { BaseServiceException serviceException = new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE)); assertEquals(CODE, serviceException.getCode()); @@ -121,7 +121,7 @@ public void testBaseServiceException() { } @Test - public void testTranslateAndThrow() throws Exception { + void testTranslateAndThrow() throws Exception { BaseServiceException cause = new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE)); RetryHelper.RetryHelperException exceptionMock = @@ -141,7 +141,7 @@ public void testTranslateAndThrow() throws Exception { @Test @SuppressWarnings("TruthSelfEquals") - public void testError_Equal() { + void testError_Equal() { BaseServiceException.Error error = new BaseServiceException.Error(0, "reason", true); assertThat(error).isEqualTo(error); assertThat(error.hashCode()).isEqualTo(error.hashCode()); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java index 65743a347a..847531f715 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java @@ -17,11 +17,12 @@ package com.google.cloud; import static com.google.common.truth.Truth.assertThat; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.spi.ServiceRpcFactory; import java.io.IOException; @@ -30,10 +31,10 @@ import java.nio.channels.ClosedChannelException; import java.util.Arrays; import java.util.Random; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class BaseWriteChannelTest { +class BaseWriteChannelTest { private abstract static class CustomService implements Service {} @@ -58,8 +59,8 @@ protected CustomServiceOptions( private static final Random RANDOM = new Random(); private static BaseWriteChannel channel; - @Before - public void setUp() { + @BeforeEach + void setUp() { channel = new BaseWriteChannel(null, ENTITY, UPLOAD_ID) { @Override @@ -78,8 +79,8 @@ protected BaseState.Builder stateBuilder() { } @Test - public void testConstructor() { - assertEquals(null, channel.getOptions()); + void testConstructor() { + assertNull(channel.getOptions()); assertEquals(ENTITY, channel.getEntity()); assertEquals(0, channel.getPosition()); assertEquals(UPLOAD_ID, channel.getUploadId()); @@ -90,20 +91,20 @@ public void testConstructor() { } @Test - public void testClose() throws IOException { + void testClose() throws IOException { channel.close(); assertFalse(channel.isOpen()); assertNull(channel.getBuffer()); } - @Test(expected = ClosedChannelException.class) + @Test public void testValidateOpen() throws IOException { channel.close(); - channel.write(ByteBuffer.allocate(42)); + assertThrows(ClosedChannelException.class, () -> channel.write(ByteBuffer.allocate(42))); } @Test - public void testChunkSize() { + void testChunkSize() { channel.setChunkSize(42); assertThat(channel.getChunkSize() >= MIN_CHUNK_SIZE).isTrue(); assertThat(channel.getChunkSize() % MIN_CHUNK_SIZE).isEqualTo(0); @@ -118,7 +119,7 @@ public void testChunkSize() { } @Test - public void testWrite() throws IOException { + void testWrite() throws IOException { channel.write(ByteBuffer.wrap(CONTENT)); assertEquals(CONTENT.length, channel.getLimit()); assertEquals(DEFAULT_CHUNK_SIZE, channel.getBuffer().length); @@ -126,7 +127,7 @@ public void testWrite() throws IOException { } @Test - public void testWriteAndFlush() throws IOException { + void testWriteAndFlush() throws IOException { ByteBuffer content = randomBuffer(DEFAULT_CHUNK_SIZE + 1); channel.write(content); assertEquals(DEFAULT_CHUNK_SIZE, channel.getPosition()); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java index 001bba9834..e8f6ae2da5 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java @@ -16,27 +16,27 @@ package com.google.cloud; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.cloud.BaseServiceException.ExceptionData; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class BatchResultTest { +class BatchResultTest { private BatchResult result; - @Before + @BeforeEach public void setUp() { result = new BatchResult() {}; } @Test - public void testSuccess() { + void testSuccess() { assertFalse(result.completed()); try { result.get(); @@ -51,7 +51,7 @@ public void testSuccess() { } @Test - public void testError() { + void testError() { assertFalse(result.completed()); try { result.get(); @@ -77,7 +77,7 @@ public void testError() { } @Test - public void testNotifyError() { + void testNotifyError() { final BaseServiceException ex = new BaseServiceException(ExceptionData.from(0, "message", "reason", false)); assertFalse(result.completed()); @@ -97,7 +97,7 @@ public void testNotifyError() { } @Test - public void testNotifySuccess() { + void testNotifySuccess() { assertFalse(result.completed()); BatchResult.Callback callback = EasyMock.createStrictMock(BatchResult.Callback.class); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java index 42873f8643..67237b5371 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java @@ -16,8 +16,8 @@ package com.google.cloud; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.io.ByteStreams; import com.google.protobuf.ByteString; @@ -26,10 +26,10 @@ import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -public class ByteArrayTest { +class ByteArrayTest { private static final String STRING_CONTENT = "Hello, ByteArray!"; private static final byte[] BYTES_CONTENT = STRING_CONTENT.getBytes(StandardCharsets.UTF_8); @@ -42,14 +42,14 @@ public class ByteArrayTest { private static ByteArray streamArray; - @BeforeClass - public static void beforeClass() throws IOException { + @BeforeAll + static void beforeClass() throws IOException { streamArray = ByteArray.copyFrom(STREAM_CONTENT); BYTE_BUFFER_CONTENT.flip(); } @Test - public void testCopyFromString() throws IOException { + void testCopyFromString() throws IOException { assertEquals(STRING_CONTENT, STRING_ARRAY.toStringUtf8()); assertArrayEquals(BYTES_CONTENT, STRING_ARRAY.toByteArray()); assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), STRING_ARRAY.asReadOnlyByteBuffer()); @@ -57,7 +57,7 @@ public void testCopyFromString() throws IOException { } @Test - public void testCopyFromByteArray() throws IOException { + void testCopyFromByteArray() throws IOException { assertEquals(STRING_CONTENT, BYTES_ARRAY.toStringUtf8()); assertArrayEquals(BYTES_CONTENT, BYTES_ARRAY.toByteArray()); assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), BYTES_ARRAY.asReadOnlyByteBuffer()); @@ -65,7 +65,7 @@ public void testCopyFromByteArray() throws IOException { } @Test - public void testCopyFromByteBuffer() throws IOException { + void testCopyFromByteBuffer() throws IOException { assertEquals(STRING_CONTENT, BYTE_BUFFER_ARRAY.toStringUtf8()); assertArrayEquals(BYTES_CONTENT, BYTE_BUFFER_ARRAY.toByteArray()); assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), BYTE_BUFFER_ARRAY.asReadOnlyByteBuffer()); @@ -73,7 +73,7 @@ public void testCopyFromByteBuffer() throws IOException { } @Test - public void testCopyFromStream() throws IOException { + void testCopyFromStream() throws IOException { assertEquals(STRING_CONTENT, streamArray.toStringUtf8()); assertArrayEquals(BYTES_CONTENT, streamArray.toByteArray()); assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), streamArray.asReadOnlyByteBuffer()); @@ -81,32 +81,32 @@ public void testCopyFromStream() throws IOException { } @Test - public void testLength() { + void testLength() { assertEquals(BYTES_CONTENT.length, ARRAY.length()); } @Test - public void testToStringUtf8() { + void testToStringUtf8() { assertEquals(STRING_CONTENT, ARRAY.toStringUtf8()); } @Test - public void testToByteArray() { + void testToByteArray() { assertArrayEquals(BYTES_CONTENT, ARRAY.toByteArray()); } @Test - public void testAsReadOnlyByteBuffer() { + void testAsReadOnlyByteBuffer() { assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), ARRAY.asReadOnlyByteBuffer()); } @Test - public void testAsInputStream() throws IOException { + void testAsInputStream() throws IOException { assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(ARRAY.asInputStream())); } @Test - public void testHashCode() { + void testHashCode() { assertEquals(STRING_ARRAY.hashCode(), BYTES_ARRAY.hashCode()); assertEquals(BYTES_ARRAY.hashCode(), BYTE_BUFFER_ARRAY.hashCode()); assertEquals(BYTE_BUFFER_ARRAY.hashCode(), streamArray.hashCode()); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java index 67e0e6c2b5..19abe3eba3 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java @@ -18,12 +18,12 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public final class ConditionTest { +final class ConditionTest { @Test - public void title_nullable() { + void title_nullable() { Condition condition = Condition.newBuilder().setTitle(null).setDescription("desc").setExpression("expr").build(); @@ -31,7 +31,7 @@ public void title_nullable() { } @Test - public void description_nullable() { + void description_nullable() { Condition condition = Condition.newBuilder().setTitle("title").setDescription(null).setExpression("expr").build(); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java index d95efaf094..6b2a6e4df5 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java @@ -18,23 +18,20 @@ import static com.google.common.testing.SerializableTester.reserializeAndAssert; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import com.google.common.testing.EqualsTester; import java.text.ParseException; import java.text.SimpleDateFormat; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; /** Unit tests for {@link Date}. */ -@RunWith(JUnit4.class) -public class DateTest { +class DateTest { private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); @Test - public void parseDate() { + void parseDate() { verifyDate("2016-09-18", 2016, 9, 18); verifyDate("2000-01-01", 2000, 1, 1); verifyDate("9999-12-31", 9999, 12, 31); @@ -53,7 +50,7 @@ private void verifyDate(String input, int year, int month, int day) { } @Test - public void parseInvalidDates() { + void parseInvalidDates() { parseInvalidDate("2016/09/18"); parseInvalidDate("2016 09 18"); parseInvalidDate("2016-9-18"); @@ -112,7 +109,7 @@ private void parseInvalidDay(String input) { } @Test - public void testToString() { + void testToString() { Date date = Date.fromYearMonthDay(10, 9, 5); assertThat(date.toString()).isEqualTo("0010-09-05"); date = Date.fromYearMonthDay(2016, 12, 31); @@ -122,7 +119,7 @@ public void testToString() { } @Test - public void equalAndHashCode() { + void equalAndHashCode() { Date d1 = Date.fromYearMonthDay(2016, 9, 18); Date d2 = Date.fromYearMonthDay(2016, 9, 18); Date d3 = Date.fromYearMonthDay(2016, 9, 19); @@ -130,7 +127,7 @@ public void equalAndHashCode() { } @Test - public void validOrdering() { + void validOrdering() { Date d1 = Date.fromYearMonthDay(2016, 9, 18); Date d2 = Date.fromYearMonthDay(2016, 9, 19); Date d3 = Date.fromYearMonthDay(2016, 9, 20); @@ -140,12 +137,12 @@ public void validOrdering() { } @Test - public void serialization() { + void serialization() { reserializeAndAssert(Date.fromYearMonthDay(2017, 4, 20)); } @Test - public void testToJavaUtilDate() throws ParseException { + void testToJavaUtilDate() throws ParseException { Date gcDate = Date.parseDate("2016-09-18"); java.util.Date juDate1 = SIMPLE_DATE_FORMAT.parse("2016-09-18"); java.util.Date juDate2 = Date.toJavaUtilDate(gcDate); @@ -153,7 +150,7 @@ public void testToJavaUtilDate() throws ParseException { } @Test - public void testFromJavaUtilDate() throws ParseException { + void testFromJavaUtilDate() throws ParseException { java.util.Date juDate = SIMPLE_DATE_FORMAT.parse("2016-09-18"); Date gcDate = Date.fromJavaUtilDate(juDate); assertThat(gcDate.getYear()).isEqualTo(2016); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java index 50e0583c89..f5efcdd3d1 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java @@ -16,9 +16,10 @@ package com.google.cloud; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.cloud.ExceptionHandler.Interceptor; import com.google.cloud.ExceptionHandler.Interceptor.RetryResult; @@ -27,13 +28,13 @@ import java.nio.channels.ClosedByInterruptException; import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** Tests for {@link ExceptionHandler}. */ -public class ExceptionHandlerTest { +class ExceptionHandlerTest { @Test - public void testVerifyCaller() { + void testVerifyCaller() { class A implements Callable { @Override public Object call() throws IOException, InterruptedException { @@ -106,7 +107,7 @@ private static void assertInvalidCallable(Callable callable, ExceptionHan } @Test - public void testShouldTry() { + void testShouldTry() { ExceptionHandler handler = ExceptionHandler.newBuilder().retryOn(IOException.class).build(); assertTrue(handler.shouldRetry(new IOException(), null)); assertTrue(handler.shouldRetry(new ClosedByInterruptException(), null)); @@ -166,8 +167,8 @@ public RetryResult beforeEval(Exception exception) { assertFalse(handler.shouldRetry(new NullPointerException(), null)); } - @Test(expected = NullPointerException.class) - public void testNullRetryResultFromBeforeEval() { + @Test + void testNullRetryResultFromBeforeEval() { @SuppressWarnings("serial") Interceptor interceptor = new Interceptor() { @@ -184,11 +185,11 @@ public RetryResult afterEval(Exception exception, RetryResult retryResult) { }; ExceptionHandler handler = ExceptionHandler.newBuilder().addInterceptors(interceptor).build(); - handler.shouldRetry(new Exception(), null); + assertThrows(NullPointerException.class, () -> handler.shouldRetry(new Exception(), null)); } - @Test(expected = NullPointerException.class) - public void testNullRetryResultFromAfterEval() { + @Test + void testNullRetryResultFromAfterEval() { @SuppressWarnings("serial") Interceptor interceptor = new Interceptor() { @@ -205,6 +206,6 @@ public RetryResult afterEval(Exception exception, RetryResult retryResult) { }; ExceptionHandler handler = ExceptionHandler.newBuilder().addInterceptors(interceptor).build(); - handler.shouldRetry(new Exception(), null); + assertThrows(NullPointerException.class, () -> handler.shouldRetry(new Exception(), null)); } } diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java index 7b94ff5294..1a617e9290 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java @@ -16,15 +16,15 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.FieldSelector.Helper; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class FieldSelectorHelperTest { +class FieldSelectorHelperTest { private static final FieldSelector FIELD1 = new FieldSelector() { @@ -52,7 +52,7 @@ public String getSelector() { private static final String CONTAINER = "container"; @Test - public void testSelector() { + void testSelector() { String selector = Helper.selector(REQUIRED_FIELDS, FIELD3); assertTrue(selector.contains("field1")); assertTrue(selector.contains("field2")); @@ -61,7 +61,7 @@ public void testSelector() { } @Test - public void testListSelector() { + void testListSelector() { String selector = Helper.listSelector(CONTAINER, REQUIRED_FIELDS, FIELD3); assertTrue(selector.startsWith("nextPageToken,container(")); assertTrue(selector.contains("field1")); @@ -72,7 +72,7 @@ public void testListSelector() { } @Test - public void testListSelectorWithExtraFields() { + void testListSelectorWithExtraFields() { String selector = Helper.listSelector(CONTAINER, REQUIRED_FIELDS, new FieldSelector[] {FIELD3}, "field4"); assertTrue(selector.startsWith("nextPageToken,container(")); @@ -85,7 +85,7 @@ public void testListSelectorWithExtraFields() { } @Test - public void testListSelectorWithFirstLevelFields() { + void testListSelectorWithFirstLevelFields() { String selector = Helper.listSelector( FIRST_LEVEL_FIELDS, CONTAINER, REQUIRED_FIELDS, new FieldSelector[] {FIELD3}, "field4"); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java index 8f8abb170c..5f4de7fef3 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java @@ -16,12 +16,13 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class IdentityTest { +class IdentityTest { private static final Identity ALL_USERS = Identity.allUsers(); private static final Identity ALL_AUTH_USERS = Identity.allAuthenticatedUsers(); @@ -35,96 +36,96 @@ public class IdentityTest { private static final Identity PROJECT_VIEWER = Identity.projectViewer("my-sample-project"); @Test - public void testAllUsers() { + void testAllUsers() { assertEquals(Identity.Type.ALL_USERS, ALL_USERS.getType()); assertNull(ALL_USERS.getValue()); } @Test - public void testAllAuthenticatedUsers() { + void testAllAuthenticatedUsers() { assertEquals(Identity.Type.ALL_AUTHENTICATED_USERS, ALL_AUTH_USERS.getType()); assertNull(ALL_AUTH_USERS.getValue()); } @Test - public void testUser() { + void testUser() { assertEquals(Identity.Type.USER, USER.getType()); assertEquals("abc@gmail.com", USER.getValue()); } - @Test(expected = NullPointerException.class) - public void testUserNullEmail() { - Identity.user(null); + @Test + void testUserNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.user(null)); } @Test - public void testServiceAccount() { + void testServiceAccount() { assertEquals(Identity.Type.SERVICE_ACCOUNT, SERVICE_ACCOUNT.getType()); assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.getValue()); } - @Test(expected = NullPointerException.class) - public void testServiceAccountNullEmail() { - Identity.serviceAccount(null); + @Test + void testServiceAccountNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.serviceAccount(null)); } @Test - public void testGroup() { + void testGroup() { assertEquals(Identity.Type.GROUP, GROUP.getType()); assertEquals("group@gmail.com", GROUP.getValue()); } - @Test(expected = NullPointerException.class) - public void testGroupNullEmail() { - Identity.group(null); + @Test + void testGroupNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.group(null)); } @Test - public void testDomain() { + void testDomain() { assertEquals(Identity.Type.DOMAIN, DOMAIN.getType()); assertEquals("google.com", DOMAIN.getValue()); } - @Test(expected = NullPointerException.class) - public void testDomainNullId() { - Identity.domain(null); + @Test + void testDomainNullId() { + assertThrows(NullPointerException.class, () -> Identity.domain(null)); } @Test - public void testProjectOwner() { + void testProjectOwner() { assertEquals(Identity.Type.PROJECT_OWNER, PROJECT_OWNER.getType()); assertEquals("my-sample-project", PROJECT_OWNER.getValue()); } - @Test(expected = NullPointerException.class) - public void testProjectOwnerNullId() { - Identity.projectOwner(null); + @Test + void testProjectOwnerNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectOwner(null)); } @Test - public void testProjectEditor() { + void testProjectEditor() { assertEquals(Identity.Type.PROJECT_EDITOR, PROJECT_EDITOR.getType()); assertEquals("my-sample-project", PROJECT_EDITOR.getValue()); } - @Test(expected = NullPointerException.class) - public void testProjectEditorNullId() { - Identity.projectEditor(null); + @Test + void testProjectEditorNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectEditor(null)); } @Test - public void testProjectViewer() { + void testProjectViewer() { assertEquals(Identity.Type.PROJECT_VIEWER, PROJECT_VIEWER.getType()); assertEquals("my-sample-project", PROJECT_VIEWER.getValue()); } - @Test(expected = NullPointerException.class) - public void testProjectViewerNullId() { - Identity.projectViewer(null); + @Test + void testProjectViewerNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectViewer(null)); } @Test - public void testIdentityToAndFromPb() { + void testIdentityToAndFromPb() { compareIdentities(ALL_USERS, Identity.valueOf(ALL_USERS.strValue())); compareIdentities(ALL_AUTH_USERS, Identity.valueOf(ALL_AUTH_USERS.strValue())); compareIdentities(USER, Identity.valueOf(USER.strValue())); @@ -136,18 +137,18 @@ public void testIdentityToAndFromPb() { compareIdentities(PROJECT_VIEWER, Identity.valueOf(PROJECT_VIEWER.strValue())); } - @Test(expected = IllegalArgumentException.class) - public void testValueOfEmpty() { - Identity.valueOf(""); + @Test + void testValueOfEmpty() { + assertThrows(IllegalArgumentException.class, () -> Identity.valueOf("")); } @Test - public void testUnrecognizedToString() { + void testUnrecognizedToString() { assertEquals("a:b", Identity.valueOf("a:b").strValue()); } @Test - public void testValueOfThreePart() { + void testValueOfThreePart() { Identity identity = Identity.valueOf("a:b:c"); assertEquals("A", identity.getType().name()); assertEquals("b:c", identity.getValue()); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java index b29896af48..042ba30feb 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java @@ -16,16 +16,16 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor; import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor.ValueType; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MonitoredResourceDescriptorTest { +class MonitoredResourceDescriptorTest { private static final LabelDescriptor BOOLEAN_LABEL = new LabelDescriptor("booleanKey", ValueType.BOOL, "Boolean label"); @@ -50,7 +50,7 @@ public class MonitoredResourceDescriptorTest { .build(); @Test - public void testLabelDescriptor() { + void testLabelDescriptor() { assertEquals("booleanKey", BOOLEAN_LABEL.getKey()); assertEquals(ValueType.BOOL, BOOLEAN_LABEL.getValueType()); assertEquals("Boolean label", BOOLEAN_LABEL.getDescription()); @@ -66,7 +66,7 @@ public void testLabelDescriptor() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(TYPE, RESOURCE_DESCRIPTOR.getType()); assertEquals(NAME, RESOURCE_DESCRIPTOR.getName()); assertEquals(DISPLAY_NAME, RESOURCE_DESCRIPTOR.getDisplayName()); @@ -82,7 +82,7 @@ public void testBuilder() { } @Test - public void testToAndFromPbLabelDescriptor() { + void testToAndFromPbLabelDescriptor() { compareLabelDescriptor(BOOLEAN_LABEL, LabelDescriptor.fromPb(BOOLEAN_LABEL.toPb())); compareLabelDescriptor(STRING_LABEL, LabelDescriptor.fromPb(STRING_LABEL.toPb())); compareLabelDescriptor(INT_LABEL, LabelDescriptor.fromPb(INT_LABEL.toPb())); @@ -91,7 +91,7 @@ public void testToAndFromPbLabelDescriptor() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareResourceDescriptor( RESOURCE_DESCRIPTOR, MonitoredResourceDescriptor.fromPb(RESOURCE_DESCRIPTOR.toPb())); MonitoredResourceDescriptor resourceDescriptor = diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java index 6054a7aa34..32fce0154d 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java @@ -16,13 +16,13 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MonitoredResourceTest { +class MonitoredResourceTest { private static final String TYPE = "cloudsql_database"; private static final Map LABELS = @@ -31,7 +31,7 @@ public class MonitoredResourceTest { MonitoredResource.newBuilder(TYPE).setLabels(LABELS).build(); @Test - public void testBuilder() { + void testBuilder() { assertEquals(TYPE, MONITORED_RESOURCE.getType()); assertEquals(LABELS, MONITORED_RESOURCE.getLabels()); MonitoredResource monitoredResource = @@ -54,7 +54,7 @@ public void testBuilder() { } @Test - public void testToBuilder() { + void testToBuilder() { compareMonitoredResource(MONITORED_RESOURCE, MONITORED_RESOURCE.toBuilder().build()); MonitoredResource monitoredResource = MONITORED_RESOURCE.toBuilder().setType("global").clearLabels().build(); @@ -71,7 +71,7 @@ public void testToBuilder() { } @Test - public void testOf() { + void testOf() { MonitoredResource monitoredResource = MonitoredResource.of(TYPE, LABELS); assertEquals(TYPE, monitoredResource.getType()); assertEquals(LABELS, monitoredResource.getLabels()); @@ -79,7 +79,7 @@ public void testOf() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareMonitoredResource( MONITORED_RESOURCE, MonitoredResource.fromPb(MONITORED_RESOURCE.toPb())); MonitoredResource monitoredResource = diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java index 5e6a6782d6..db11d66951 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java @@ -16,13 +16,13 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.gax.paging.Page; import com.google.common.collect.ImmutableList; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PageImplTest { +class PageImplTest { private static final ImmutableList VALUES = ImmutableList.of("1", "2"); private static final ImmutableList NEXT_VALUES = ImmutableList.of("3", "4"); @@ -45,7 +45,7 @@ public Page getNextPage() { } @Test - public void testPage() { + void testPage() { final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES); PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); PageImpl result = new PageImpl<>(fetcher, "c", VALUES); @@ -55,7 +55,7 @@ public void testPage() { } @Test - public void testIterateAll() { + void testIterateAll() { final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES); PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); PageImpl result = new PageImpl<>(fetcher, "c", VALUES); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java index 98695c2a4c..e7d70ce385 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java @@ -16,12 +16,12 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.cloud.Policy.DefaultMarshaller; import com.google.common.collect.ImmutableMap; @@ -30,9 +30,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PolicyTest { +class PolicyTest { private static final Identity ALL_USERS = Identity.allUsers(); private static final Identity ALL_AUTH_USERS = Identity.allAuthenticatedUsers(); @@ -63,9 +63,9 @@ public class PolicyTest { .build(); @Test - public void testBuilder() { + void testBuilder() { assertEquals(BINDINGS, SIMPLE_POLICY.getBindings()); - assertEquals(null, SIMPLE_POLICY.getEtag()); + assertNull(SIMPLE_POLICY.getEtag()); assertEquals(0, SIMPLE_POLICY.getVersion()); assertEquals(BINDINGS, FULL_POLICY.getBindings()); assertEquals("etag", FULL_POLICY.getEtag()); @@ -105,7 +105,7 @@ public void testBuilder() { } @Test - public void testPolicyOrderShouldNotMatter() { + void testPolicyOrderShouldNotMatter() { Role role1 = Role.of("role1"); Identity identity1 = Identity.user("user1@example.com"); Role role2 = Role.of("role2"); @@ -118,7 +118,7 @@ public void testPolicyOrderShouldNotMatter() { } @Test - public void testPolicyMultipleAddIdentitiesShouldNotMatter() { + void testPolicyMultipleAddIdentitiesShouldNotMatter() { Role role1 = Role.of("role1"); Identity identity1 = Identity.user("user1@example.com"); Role role2 = Role.of("role2"); @@ -135,7 +135,7 @@ public void testPolicyMultipleAddIdentitiesShouldNotMatter() { } @Test - public void testIllegalPolicies() { + void testIllegalPolicies() { try { Policy.newBuilder().addIdentity(null, USER); fail("Null role should cause exception."); @@ -181,7 +181,7 @@ public void testIllegalPolicies() { } @Test - public void testEqualsHashCode() { + void testEqualsHashCode() { assertNotNull(FULL_POLICY); Policy emptyPolicy = Policy.newBuilder().build(); Policy anotherPolicy = Policy.newBuilder().build(); @@ -195,25 +195,25 @@ public void testEqualsHashCode() { } @Test - public void testBindings() { + void testBindings() { assertTrue(Policy.newBuilder().build().getBindings().isEmpty()); assertEquals(BINDINGS, SIMPLE_POLICY.getBindings()); } @Test - public void testEtag() { + void testEtag() { assertNull(SIMPLE_POLICY.getEtag()); assertEquals("etag", FULL_POLICY.getEtag()); } @Test - public void testVersion() { + void testVersion() { assertEquals(0, SIMPLE_POLICY.getVersion()); assertEquals(1, FULL_POLICY.getVersion()); } @Test - public void testDefaultMarshaller() { + void testDefaultMarshaller() { DefaultMarshaller marshaller = new DefaultMarshaller(); Policy emptyPolicy = Policy.newBuilder().build(); assertEquals(emptyPolicy, marshaller.fromPb(marshaller.toPb(emptyPolicy))); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java index bdddf656f4..164ac6aeeb 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java @@ -16,12 +16,12 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.cloud.Policy.DefaultMarshaller; import com.google.common.collect.ImmutableList; @@ -29,9 +29,9 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PolicyV3Test { +class PolicyV3Test { private static final String ALL_USERS = "allUsers"; private static final String ALL_AUTH_USERS = "allAuthenticatedUsers"; @@ -79,7 +79,7 @@ public class PolicyV3Test { .build(); @Test - public void testBuilderV1() { + void testBuilderV1() { assertEquals(BINDINGS_NO_CONDITIONS, FULL_POLICY_V1.getBindingsList()); assertEquals(1, FULL_POLICY_V1.getVersion()); assertEquals("etag", FULL_POLICY_V1.getEtag()); @@ -90,7 +90,7 @@ public void testBuilderV1() { } @Test - public void testBuilderV3WithConditions() { + void testBuilderV3WithConditions() { assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3.getBindingsList()); assertEquals(3, FULL_POLICY_V3.getVersion()); assertEquals("etag", FULL_POLICY_V3.getEtag()); @@ -101,7 +101,7 @@ public void testBuilderV3WithConditions() { } @Test - public void testBuilderV1ToV3Compatability() { + void testBuilderV1ToV3Compatability() { assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3_WITH_VERSION_1.getBindingsList()); assertEquals(1, FULL_POLICY_V3_WITH_VERSION_1.getVersion()); assertEquals("etag", FULL_POLICY_V3_WITH_VERSION_1.getEtag()); @@ -117,7 +117,7 @@ public void testBuilderV1ToV3Compatability() { } @Test - public void removeMemberFromPolicy() { + void removeMemberFromPolicy() { assertEquals(3, FULL_POLICY_V3.getBindingsList().get(0).getMembers().size()); List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); @@ -134,7 +134,7 @@ public void removeMemberFromPolicy() { } @Test - public void addMemberFromPolicy() { + void addMemberFromPolicy() { assertEquals(3, FULL_POLICY_V3.getBindingsList().get(0).getMembers().size()); List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); @@ -150,7 +150,7 @@ public void addMemberFromPolicy() { } @Test - public void removeBindingFromPolicy() { + void removeBindingFromPolicy() { assertEquals(2, FULL_POLICY_V3.getBindingsList().size()); List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); @@ -168,7 +168,7 @@ public void removeBindingFromPolicy() { } @Test - public void addBindingToPolicy() { + void addBindingToPolicy() { assertEquals(2, FULL_POLICY_V3.getBindingsList().size()); List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); bindings.add(Binding.newBuilder().setRole(OWNER).setMembers(ImmutableList.of(USER)).build()); @@ -177,7 +177,7 @@ public void addBindingToPolicy() { } @Test - public void testIllegalPolicies() { + void testIllegalPolicies() { try { Binding.newBuilder().setRole(null).build(); fail("Null role should cause exception."); @@ -233,7 +233,7 @@ public void testIllegalPolicies() { } @Test - public void testEqualsHashCode() { + void testEqualsHashCode() { assertNotNull(FULL_POLICY_V3); Policy emptyPolicy = Policy.newBuilder().build(); Policy anotherPolicy = Policy.newBuilder().build(); @@ -247,26 +247,26 @@ public void testEqualsHashCode() { } @Test - public void testBindings() { + void testBindings() { assertTrue(Policy.newBuilder().build().getBindingsList().isEmpty()); assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3.getBindingsList()); } @Test - public void testEtag() { + void testEtag() { assertNotNull(FULL_POLICY_V3.getEtag()); assertEquals("etag", FULL_POLICY_V3.getEtag()); } @Test - public void testVersion() { + void testVersion() { assertEquals(1, FULL_POLICY_V1.getVersion()); assertEquals(3, FULL_POLICY_V3.getVersion()); assertEquals(1, FULL_POLICY_V3_WITH_VERSION_1.getVersion()); } @Test - public void testDefaultMarshaller() { + void testDefaultMarshaller() { DefaultMarshaller marshaller = new DefaultMarshaller(); Policy emptyPolicy = Policy.newBuilder().build(); assertEquals(emptyPolicy, marshaller.fromPb(marshaller.toPb(emptyPolicy))); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java index ebea89f2fc..a458d31f67 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java @@ -16,14 +16,14 @@ package com.google.cloud; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import com.google.api.gax.retrying.RetrySettings; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.bp.Duration; -public class RetryOptionTest { +class RetryOptionTest { private static final RetryOption TOTAL_TIMEOUT = RetryOption.totalTimeout(Duration.ofMillis(420L)); @@ -46,7 +46,7 @@ public class RetryOptionTest { .build(); @Test - public void testEqualsAndHashCode() { + void testEqualsAndHashCode() { assertEquals(TOTAL_TIMEOUT, TOTAL_TIMEOUT); assertEquals(INITIAL_RETRY_DELAY, INITIAL_RETRY_DELAY); assertEquals(RETRY_DELAY_MULTIPLIER, RETRY_DELAY_MULTIPLIER); @@ -84,7 +84,7 @@ public void testEqualsAndHashCode() { } @Test - public void testMergeToSettings() { + void testMergeToSettings() { RetrySettings defRetrySettings = RetrySettings.newBuilder().build(); assertEquals(defRetrySettings, RetryOption.mergeToSettings(defRetrySettings)); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java index d6fcdf8441..694d507911 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java @@ -17,17 +17,18 @@ package com.google.cloud; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoleTest { +class RoleTest { private static final Role VIEWER = Role.of("viewer"); private static final Role EDITOR = Role.of("editor"); private static final Role OWNER = Role.of("owner"); @Test - public void testOf() { + void testOf() { assertThat(VIEWER.getValue()).isEqualTo("roles/viewer"); assertThat(EDITOR.getValue()).isEqualTo("roles/editor"); assertThat(OWNER.getValue()).isEqualTo("roles/owner"); @@ -40,23 +41,23 @@ public void testOf() { } @Test - public void testViewer() { + void testViewer() { assertThat(Role.viewer().getValue()).isEqualTo("roles/viewer"); } @Test - public void testEditor() { + void testEditor() { assertThat(Role.editor().getValue()).isEqualTo("roles/editor"); } @Test - public void testOwner() { + void testOwner() { assertThat(Role.owner().getValue()).isEqualTo("roles/owner"); } - @Test(expected = NullPointerException.class) - public void testOfNullValue() { - Role.of(null); + @Test + void testOfNullValue() { + assertThrows(NullPointerException.class, () -> Role.of(null)); } private void compareRoles(Role expected, Role actual) { diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java index 1b79e48ddc..e4d22d9b5f 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java @@ -17,14 +17,14 @@ package com.google.cloud; import static com.google.common.truth.Truth.assertThat; -import static junit.framework.TestCase.assertFalse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; @@ -50,9 +50,9 @@ import java.util.Map; import java.util.Set; import java.util.regex.Pattern; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceOptionsTest { +class ServiceOptionsTest { private static GoogleCredentials credentials; private static GoogleCredentials credentialsWithProjectId; private static GoogleCredentials credentialsWithQuotaProject; @@ -378,15 +378,15 @@ public void testBuilder_quotaProjectServiceOptionTakesPrecedence() { assertEquals("quota-project-id", quotaProjectCredsWithQuotaProject.getQuotaProjectId()); assertEquals("quota-project-id", quotaProjectCredsWithQuotaProject2.getQuotaProjectId()); assertEquals("some-quota-project-id", quotaProjectCreds.getQuotaProjectId()); - assertEquals(null, none.getQuotaProjectId()); + assertNull(none.getQuotaProjectId()); } @Test - public void testBuilderNoCredentials() { + void testBuilderNoCredentials() { assertEquals(NoCredentials.getInstance(), OPTIONS_NO_CREDENTIALS.getCredentials()); - assertTrue(NoCredentials.getInstance().equals(OPTIONS_NO_CREDENTIALS.getCredentials())); - assertFalse(NoCredentials.getInstance().equals(OPTIONS.getCredentials())); - assertFalse(NoCredentials.getInstance().equals(null)); + assertEquals(NoCredentials.getInstance(), OPTIONS_NO_CREDENTIALS.getCredentials()); + assertNotEquals(NoCredentials.getInstance(), OPTIONS.getCredentials()); + assertNotNull(NoCredentials.getInstance()); assertSame(TEST_CLOCK, OPTIONS_NO_CREDENTIALS.getClock()); assertEquals("host", OPTIONS_NO_CREDENTIALS.getHost()); assertEquals("project-id", OPTIONS_NO_CREDENTIALS.getProjectId()); @@ -394,20 +394,22 @@ public void testBuilderNoCredentials() { assertEquals("quota-project-id", OPTIONS.getQuotaProjectId()); } - @Test(expected = NullPointerException.class) - public void testBuilderNullCredentials() { - TestServiceOptions.newBuilder().setCredentials(null).build(); + @Test + void testBuilderNullCredentials() { + assertThrows( + NullPointerException.class, + () -> TestServiceOptions.newBuilder().setCredentials(null).build()); } @Test - public void testBuilderServiceAccount_setsProjectId() { + void testBuilderServiceAccount_setsProjectId() { TestServiceOptions options = TestServiceOptions.newBuilder().setCredentials(credentialsWithProjectId).build(); assertEquals("someprojectid", options.getProjectId()); } @Test - public void testBuilderServiceAccount_explicitSetProjectIdBefore() { + void testBuilderServiceAccount_explicitSetProjectIdBefore() { TestServiceOptions options = TestServiceOptions.newBuilder() .setProjectId("override-project-id") @@ -417,7 +419,7 @@ public void testBuilderServiceAccount_explicitSetProjectIdBefore() { } @Test - public void testBuilderServiceAccount_explicitSetProjectIdAfter() { + void testBuilderServiceAccount_explicitSetProjectIdAfter() { TestServiceOptions options = TestServiceOptions.newBuilder() .setCredentials(credentialsWithProjectId) @@ -427,44 +429,44 @@ public void testBuilderServiceAccount_explicitSetProjectIdAfter() { } @Test - public void testGetProjectIdRequired() { + void testGetProjectIdRequired() { assertTrue(OPTIONS.projectIdRequired()); } @Test - public void testService() { + void testService() { assertTrue(OPTIONS.getService() instanceof TestServiceImpl); } @Test - public void testRpc() { + void testRpc() { assertTrue(OPTIONS.getRpc() instanceof DefaultTestServiceRpc); } @Test - public void testBaseEquals() { + void testBaseEquals() { assertEquals(OPTIONS, OPTIONS_COPY); assertNotEquals(DEFAULT_OPTIONS, OPTIONS); } @Test - public void testLibraryName() { + void testLibraryName() { assertEquals(LIBRARY_NAME, ServiceOptions.getLibraryName()); } @Test - public void testApplicationName() { + void testApplicationName() { assertTrue(APPLICATION_NAME_PATTERN.matcher(OPTIONS.getApplicationName()).matches()); } @Test - public void testBaseHashCode() { + void testBaseHashCode() { assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); } @Test - public void testGetServiceAccountProjectId() throws Exception { + void testGetServiceAccountProjectId() throws Exception { File credentialsFile = File.createTempFile("credentials", ".json"); credentialsFile.deleteOnExit(); Files.write("{\"project_id\":\"my-project-id\"}".getBytes(), credentialsFile); @@ -475,7 +477,7 @@ public void testGetServiceAccountProjectId() throws Exception { } @Test - public void testGetServiceAccountProjectId_badJson() throws Exception { + void testGetServiceAccountProjectId_badJson() throws Exception { File credentialsFile = File.createTempFile("credentials", ".json"); credentialsFile.deleteOnExit(); Files.write("asdfghj".getBytes(StandardCharsets.UTF_8), credentialsFile); @@ -486,14 +488,14 @@ public void testGetServiceAccountProjectId_badJson() throws Exception { } @Test - public void testGetServiceAccountProjectId_nonExistentFile() throws Exception { + void testGetServiceAccountProjectId_nonExistentFile() throws Exception { File credentialsFile = new File("/doesnotexist"); assertNull(ServiceOptions.getValueFromCredentialsFile(credentialsFile.getPath(), "project_id")); } @Test - public void testResponseHeaderContainsMetaDataFlavor() throws Exception { + void testResponseHeaderContainsMetaDataFlavor() throws Exception { Multimap headers = ArrayListMultimap.create(); headers.put("Metadata-Flavor", "Google"); HttpResponse httpResponse = createHttpResponseWithHeader(headers); @@ -501,20 +503,20 @@ public void testResponseHeaderContainsMetaDataFlavor() throws Exception { } @Test - public void testResponseHeaderDoesNotContainMetaDataFlavor() throws Exception { + void testResponseHeaderDoesNotContainMetaDataFlavor() throws Exception { Multimap headers = ArrayListMultimap.create(); HttpResponse httpResponse = createHttpResponseWithHeader(headers); assertThat(ServiceOptions.headerContainsMetadataFlavor(httpResponse)).isFalse(); } @Test - public void testGetResolvedEndpoint_noUniverseDomain() { + void testGetResolvedEndpoint_noUniverseDomain() { TestServiceOptions options = TestServiceOptions.newBuilder().setProjectId("project-id").build(); assertThat(options.getResolvedHost("service")).isEqualTo("https://service.googleapis.com"); } @Test - public void testGetResolvedEndpoint_emptyUniverseDomain() { + void testGetResolvedEndpoint_emptyUniverseDomain() { TestServiceOptions options = TestServiceOptions.newBuilder().setUniverseDomain("").setProjectId("project-id").build(); IllegalArgumentException exception = @@ -523,7 +525,7 @@ public void testGetResolvedEndpoint_emptyUniverseDomain() { } @Test - public void testGetResolvedEndpoint_customUniverseDomain() { + void testGetResolvedEndpoint_customUniverseDomain() { TestServiceOptions options = TestServiceOptions.newBuilder() .setUniverseDomain("test.com") @@ -533,7 +535,7 @@ public void testGetResolvedEndpoint_customUniverseDomain() { } @Test - public void testGetResolvedEndpoint_customUniverseDomain_customHost() { + void testGetResolvedEndpoint_customUniverseDomain_customHost() { TestServiceOptions options = TestServiceOptions.newBuilder() .setUniverseDomain("test.com") @@ -544,14 +546,14 @@ public void testGetResolvedEndpoint_customUniverseDomain_customHost() { } @Test - public void testGetResolvedApiaryHost_noUniverseDomain() { + void testGetResolvedApiaryHost_noUniverseDomain() { TestServiceOptions options = TestServiceOptions.newBuilder().setProjectId("project-id").build(); assertThat(options.getResolvedApiaryHost("service")) .isEqualTo("https://service.googleapis.com/"); } @Test - public void testGetResolvedApiaryHost_customUniverseDomain_noHost() { + void testGetResolvedApiaryHost_customUniverseDomain_noHost() { TestServiceOptions options = TestServiceOptions.newBuilder() .setUniverseDomain("test.com") @@ -562,7 +564,7 @@ public void testGetResolvedApiaryHost_customUniverseDomain_noHost() { } @Test - public void testGetResolvedApiaryHost_customUniverseDomain_customHost() { + void testGetResolvedApiaryHost_customUniverseDomain_customHost() { TestServiceOptions options = TestServiceOptions.newBuilder() .setUniverseDomain("test.com") @@ -574,7 +576,7 @@ public void testGetResolvedApiaryHost_customUniverseDomain_customHost() { // No User Configuration = GDU, Default Credentials = GDU @Test - public void testIsValidUniverseDomain_noUserUniverseDomainConfig_defaultCredentials() + void testIsValidUniverseDomain_noUserUniverseDomainConfig_defaultCredentials() throws IOException { TestServiceOptions options = TestServiceOptions.newBuilder() @@ -588,8 +590,7 @@ public void testIsValidUniverseDomain_noUserUniverseDomainConfig_defaultCredenti // No User Configuration = GDU, non Default Credentials = random.com // non-GDU Credentials could be any domain, the tests use random.com @Test - public void testIsValidUniverseDomain_noUserUniverseDomainConfig_nonGDUCredentials() - throws IOException { + void testIsValidUniverseDomain_noUserUniverseDomainConfig_nonGDUCredentials() throws IOException { TestServiceOptions options = TestServiceOptions.newBuilder() .setProjectId("project-id") @@ -602,8 +603,7 @@ public void testIsValidUniverseDomain_noUserUniverseDomainConfig_nonGDUCredentia // User Configuration = random.com, Default Credentials = GDU // User Credentials could be set to any domain, the tests use random.com @Test - public void testIsValidUniverseDomain_userUniverseDomainConfig_defaultCredentials() - throws IOException { + void testIsValidUniverseDomain_userUniverseDomainConfig_defaultCredentials() throws IOException { TestServiceOptions options = TestServiceOptions.newBuilder() .setProjectId("project-id") @@ -618,8 +618,7 @@ public void testIsValidUniverseDomain_userUniverseDomainConfig_defaultCredential // User Credentials and non GDU Credentials could be set to any domain, // the tests use random.com @Test - public void testIsValidUniverseDomain_userUniverseDomainConfig_nonGDUCredentials() - throws IOException { + void testIsValidUniverseDomain_userUniverseDomainConfig_nonGDUCredentials() throws IOException { TestServiceOptions options = TestServiceOptions.newBuilder() .setProjectId("project-id") diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java index 781fbb8925..3a74f6c5d2 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java @@ -16,18 +16,19 @@ package com.google.cloud; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiFunction; import com.google.common.testing.EqualsTester; import java.util.Arrays; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class StringEnumTest { +class StringEnumTest { - public static class Letter extends StringEnumValue { + static class Letter extends StringEnumValue { private static final long serialVersionUID = -1717976087182628526L; private Letter(String constant) { @@ -64,28 +65,29 @@ public static Letter[] values() { } } - @Test(expected = NullPointerException.class) - public void testNullClass() { - new StringEnumType(null, Letter.CONSTRUCTOR); + @Test + void testNullClass() { + assertThrows( + NullPointerException.class, () -> new StringEnumType(null, Letter.CONSTRUCTOR)); } @Test - public void testNullConstructor() { + void testNullConstructor() { try { new StringEnumType(Letter.class, null); - Assert.fail(); + Assertions.fail(); } catch (NullPointerException ex) { assertNull(ex.getMessage()); } } @Test - public void testEnumInstances() { + void testEnumInstances() { assertThat(Letter.A.toString()).isEqualTo("A"); } @Test - public void testValueOf() { + void testValueOf() { assertThat(Letter.valueOf("A")).isSameInstanceAs(Letter.A); assertThat(Letter.valueOf("B")).isSameInstanceAs(Letter.B); assertThat(Letter.valueOf("C")).isSameInstanceAs(Letter.C); @@ -93,14 +95,14 @@ public void testValueOf() { } @Test - public void testValueOfStrict() { + void testValueOfStrict() { assertThat(Letter.valueOfStrict("A")).isSameInstanceAs(Letter.A); assertThat(Letter.valueOfStrict("B")).isSameInstanceAs(Letter.B); assertThat(Letter.valueOfStrict("C")).isSameInstanceAs(Letter.C); } @Test - public void testEquals() { + void testEquals() { new EqualsTester() .addEqualityGroup(Letter.A, Letter.valueOf("A"), Letter.valueOfStrict("A")) .addEqualityGroup(Letter.B, Letter.valueOf("B"), Letter.valueOfStrict("B")) @@ -110,17 +112,17 @@ public void testEquals() { } @Test - public void testValueOfStrict_invalid() { + void testValueOfStrict_invalid() { try { Letter.valueOfStrict("NonExistentLetter"); - Assert.fail(); + Assertions.fail(); } catch (IllegalArgumentException ex) { assertNotNull(ex.getMessage()); } } @Test - public void testValues() { + void testValues() { assertThat( Arrays.asList(Letter.values()).containsAll(Arrays.asList(Letter.A, Letter.B, Letter.C))) .isTrue(); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java index 8c1610bbac..abc86633cb 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java @@ -16,8 +16,8 @@ package com.google.cloud; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -27,12 +27,9 @@ import com.google.protobuf.Value; import java.util.HashMap; import java.util.Map; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) public class StructsTest { private static final Double NUMBER = 42.0; @@ -75,8 +72,8 @@ public class StructsTest { private static final Struct STRUCT = Struct.newBuilder().putAllFields(VALUE_MAP).build(); private static final ImmutableMap EMPTY_MAP = ImmutableMap.of(); - @BeforeClass - public static void beforeClass() { + @BeforeAll + static void beforeClass() { INNER_MAP.put("null", null); INNER_MAP.put("number", NUMBER); INNER_MAP.put("string", STRING); @@ -101,7 +98,7 @@ private void checkStructField(Struct struct, String key, Value expected) { } @Test - public void testAsMap() { + void testAsMap() { Map map = Structs.asMap(STRUCT); checkMapField(map, "null", null); checkMapField(map, "number", NUMBER); @@ -113,7 +110,7 @@ public void testAsMap() { } @Test - public void testAsMapPut() { + void testAsMapPut() { Map map = Structs.asMap(STRUCT); try { map.put("key", "value"); @@ -124,7 +121,7 @@ public void testAsMapPut() { } @Test - public void testAsMapRemove() { + void testAsMapRemove() { Map map = Structs.asMap(STRUCT); try { map.remove("null"); @@ -135,14 +132,14 @@ public void testAsMapRemove() { } @Test - public void testAsMapEmpty() { + void testAsMapEmpty() { Map map = Structs.asMap(Struct.getDefaultInstance()); assertThat(map).isEmpty(); assertEquals(EMPTY_MAP, map); } @Test - public void testAsMapNull() { + void testAsMapNull() { try { Structs.asMap(null); fail(); @@ -151,7 +148,7 @@ public void testAsMapNull() { } @Test - public void testNewStruct() { + void testNewStruct() { Struct struct = Structs.newStruct(MAP); checkStructField(struct, "null", NULL_VALUE); checkStructField(struct, "number", NUMBER_VALUE); @@ -163,13 +160,13 @@ public void testNewStruct() { } @Test - public void testNewStructEmpty() { + void testNewStructEmpty() { Struct struct = Structs.newStruct(EMPTY_MAP); assertThat(struct.getFieldsMap()).isEmpty(); } @Test - public void testNewStructNull() { + void testNewStructNull() { try { Structs.newStruct(null); fail(); @@ -178,7 +175,7 @@ public void testNewStructNull() { } @Test - public void testNumbers() { + void testNumbers() { int intNumber = Integer.MIN_VALUE; long longNumber = Long.MAX_VALUE; float floatNumber = Float.MIN_VALUE; diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java index 5eaeb0a894..ba2ad5b701 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java @@ -18,8 +18,8 @@ import static com.google.common.testing.SerializableTester.reserializeAndAssert; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.testing.EqualsTester; import java.util.Calendar; @@ -27,14 +27,10 @@ import java.util.GregorianCalendar; import java.util.TimeZone; import java.util.concurrent.TimeUnit; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; /** Unit tests for {@link com.google.cloud.Timestamp}. */ -@RunWith(JUnit4.class) -public class TimestampTest { +class TimestampTest { private static final String TEST_TIME_ISO = "2015-10-12T15:14:54Z"; private static final long TEST_TIME_SECONDS = 1444662894L; private static final long TEST_TIME_MICROSECONDS = 10000100L; @@ -45,14 +41,14 @@ public class TimestampTest { private static final Date TEST_DATE_PRE_EPOCH = new Date(TEST_TIME_MILLISECONDS_NEGATIVE); @Test - public void minValue() { + void minValue() { // MIN_VALUE is before the start of the Gregorian calendar... use magic value. assertThat(Timestamp.MIN_VALUE.getSeconds()).isEqualTo(-62135596800L); assertThat(Timestamp.MIN_VALUE.getNanos()).isEqualTo(0); } @Test - public void maxValue() { + void maxValue() { TimeZone tz = TimeZone.getTimeZone("UTC"); GregorianCalendar calendar = new GregorianCalendar(tz); calendar.set(9999, Calendar.DECEMBER, 31, 23, 59, 59); @@ -64,14 +60,14 @@ public void maxValue() { } @Test - public void ofMicroseconds() { + void ofMicroseconds() { Timestamp timestamp = Timestamp.ofTimeMicroseconds(TEST_TIME_MICROSECONDS); assertThat(timestamp.getSeconds()).isEqualTo(TEST_TIME_MICROSECONDS / 1000000L); assertThat(timestamp.getNanos()).isEqualTo(TEST_TIME_MICROSECONDS % 1000000L * 1000); } @Test - public void ofDate() { + void ofDate() { Timestamp timestamp = Timestamp.of(TEST_DATE); Long expectedSeconds = TimeUnit.MILLISECONDS.toSeconds(TEST_TIME_MILLISECONDS); Long expectedNanos = @@ -82,7 +78,7 @@ public void ofDate() { } @Test - public void testOf() { + void testOf() { String expectedTimestampString = "1970-01-01T00:00:12.345000000Z"; java.sql.Timestamp input = new java.sql.Timestamp(12345); Timestamp timestamp = Timestamp.of(input); @@ -90,7 +86,7 @@ public void testOf() { } @Test - public void testOf_exactSecond() { + void testOf_exactSecond() { String expectedTimestampString = "1970-01-01T00:00:12Z"; java.sql.Timestamp input = new java.sql.Timestamp(12000); Timestamp timestamp = Timestamp.of(input); @@ -98,7 +94,7 @@ public void testOf_exactSecond() { } @Test - public void testOf_preEpoch() { + void testOf_preEpoch() { String expectedTimestampString = "1969-12-31T23:59:47.655000000Z"; java.sql.Timestamp input = new java.sql.Timestamp(-12345); Timestamp timestamp = Timestamp.of(input); @@ -106,7 +102,7 @@ public void testOf_preEpoch() { } @Test - public void testOf_onEpoch() { + void testOf_onEpoch() { String expectedTimestampString = "1970-01-01T00:00:00Z"; java.sql.Timestamp input = new java.sql.Timestamp(0); Timestamp timestamp = Timestamp.of(input); @@ -114,7 +110,7 @@ public void testOf_onEpoch() { } @Test - public void testOf_preEpochExactSecond() { + void testOf_preEpochExactSecond() { String expectedTimestampString = "1969-12-31T23:59:59Z"; java.sql.Timestamp input = new java.sql.Timestamp(-1000); Timestamp timestamp = Timestamp.of(input); @@ -122,7 +118,7 @@ public void testOf_preEpochExactSecond() { } @Test - public void ofDatePreEpoch() { + void ofDatePreEpoch() { Timestamp timestamp = Timestamp.of(TEST_DATE_PRE_EPOCH); long expectedSeconds = TEST_TIME_MILLISECONDS_NEGATIVE / 1_000; int expectedNanos = (int) (TEST_TIME_MILLISECONDS_NEGATIVE % 1_000 * 1000_000); @@ -135,14 +131,14 @@ public void ofDatePreEpoch() { } @Test - public void toDate() { + void toDate() { Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1234 * 1000); Date date = timestamp.toDate(); assertThat(TEST_TIME_MILLISECONDS).isEqualTo(date.getTime()); } @Test - public void toFromSqlTimestamp() { + void toFromSqlTimestamp() { long seconds = TEST_TIME_SECONDS; int nanos = 500000000; @@ -157,67 +153,49 @@ public void toFromSqlTimestamp() { } @Test - public void boundsSecondsMin() { - try { - Timestamp.ofTimeSecondsAndNanos(Timestamp.MIN_VALUE.getSeconds() - 1, 999999999); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsSecondsMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(Timestamp.MIN_VALUE.getSeconds() - 1, 999999999)); } @Test - public void boundsSecondsMax() { - try { - Timestamp.ofTimeSecondsAndNanos(Timestamp.MAX_VALUE.getSeconds() + 1, 0); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsSecondsMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(Timestamp.MAX_VALUE.getSeconds() + 1, 0)); } @Test - public void boundsNanosMin() { - try { - Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, -1); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsNanosMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, -1)); } @Test - public void boundsNanosMax() { - try { - Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1000000000); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsNanosMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1000000000)); } @Test - public void boundsSqlTimestampMin() { - try { - Timestamp.of(new java.sql.Timestamp((Timestamp.MIN_VALUE.getSeconds() - 1) * 1000)); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsSqlTimestampMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.of(new java.sql.Timestamp((Timestamp.MIN_VALUE.getSeconds() - 1) * 1000))); } @Test - public void boundsSqlTimestampMax() { - try { - Timestamp.of(new java.sql.Timestamp((Timestamp.MAX_VALUE.getSeconds() + 1) * 1000)); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void boundsSqlTimestampMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.of(new java.sql.Timestamp((Timestamp.MAX_VALUE.getSeconds() + 1) * 1000))); } @Test - public void equalsAndHashCode() { + void equalsAndHashCode() { EqualsTester tester = new EqualsTester(); tester.addEqualityGroup( Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0), @@ -229,7 +207,7 @@ public void equalsAndHashCode() { } @Test - public void testToString() { + void testToString() { assertThat(Timestamp.MIN_VALUE.toString()).isEqualTo("0001-01-01T00:00:00Z"); assertThat(Timestamp.MAX_VALUE.toString()).isEqualTo("9999-12-31T23:59:59.999999999Z"); assertThat(Timestamp.ofTimeSecondsAndNanos(0, 0).toString()).isEqualTo("1970-01-01T00:00:00Z"); @@ -240,7 +218,7 @@ public void testToString() { } @Test - public void parseTimestamp() { + void parseTimestamp() { assertThat(Timestamp.parseTimestamp("0001-01-01T00:00:00Z")).isEqualTo(Timestamp.MIN_VALUE); assertThat(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999Z")) .isEqualTo(Timestamp.MAX_VALUE); @@ -249,7 +227,7 @@ public void parseTimestamp() { } @Test - public void parseTimestampWithoutTimeZoneOffset() { + void parseTimestampWithoutTimeZoneOffset() { assertThat(Timestamp.parseTimestamp("0001-01-01T00:00:00")).isEqualTo(Timestamp.MIN_VALUE); assertThat(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999")) .isEqualTo(Timestamp.MAX_VALUE); @@ -258,7 +236,7 @@ public void parseTimestampWithoutTimeZoneOffset() { } @Test - public void parseTimestampWithTimeZoneOffset() { + void parseTimestampWithTimeZoneOffset() { assertThat(Timestamp.parseTimestamp("0001-01-01T00:00:00-00:00")) .isEqualTo(Timestamp.MIN_VALUE); assertThat(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999-00:00")) @@ -270,7 +248,7 @@ public void parseTimestampWithTimeZoneOffset() { } @Test - public void fromProto() { + void fromProto() { com.google.protobuf.Timestamp proto = com.google.protobuf.Timestamp.newBuilder().setSeconds(1234).setNanos(567).build(); Timestamp timestamp = Timestamp.fromProto(proto); @@ -279,7 +257,7 @@ public void fromProto() { } @Test - public void comparable() { + void comparable() { assertThat(Timestamp.MIN_VALUE).isLessThan(Timestamp.MAX_VALUE); assertThat(Timestamp.MAX_VALUE).isGreaterThan(Timestamp.MIN_VALUE); @@ -300,7 +278,7 @@ public void comparable() { } @Test - public void serialization() throws Exception { + void serialization() { reserializeAndAssert(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999Z")); } } diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java index 2c6d7495be..79b58a83c9 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java @@ -32,10 +32,10 @@ import java.util.concurrent.TimeoutException; import java.util.logging.Logger; import org.easymock.EasyMock; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.bp.Duration; -public class BaseEmulatorHelperTest { +class BaseEmulatorHelperTest { private static final String BLOCK_UNTIL = "Block until"; @@ -82,7 +82,7 @@ public void reset() throws IOException { } @Test - public void testEmulatorHelper() throws IOException, InterruptedException, TimeoutException { + void testEmulatorHelper() throws IOException, InterruptedException, TimeoutException { Process process = EasyMock.createStrictMock(Process.class); InputStream stream = new ByteArrayInputStream(BLOCK_UNTIL.getBytes(Charsets.UTF_8)); EmulatorRunner emulatorRunner = EasyMock.createStrictMock(EmulatorRunner.class); @@ -102,7 +102,7 @@ public void testEmulatorHelper() throws IOException, InterruptedException, Timeo } @Test - public void testEmulatorHelperDownloadWithRetries() + void testEmulatorHelperDownloadWithRetries() throws IOException, InterruptedException, TimeoutException { String mockExternalForm = "mockExternalForm"; String mockInputStream = "mockInputStream"; @@ -145,7 +145,7 @@ public void testEmulatorHelperDownloadWithRetries() } @Test - public void testEmulatorHelperMultipleRunners() + void testEmulatorHelperMultipleRunners() throws IOException, InterruptedException, TimeoutException { Process process = EasyMock.createStrictMock(Process.class); InputStream stream = new ByteArrayInputStream(BLOCK_UNTIL.getBytes(Charsets.UTF_8)); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java index 88b246c754..bc9cdc4a8c 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java @@ -16,19 +16,19 @@ package com.google.cloud.testing; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableList; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CommandWrapperTest { +class CommandWrapperTest { private static final List COMMAND = ImmutableList.of("my", "command"); private static final List WIN_COMMAND = ImmutableList.of("cmd", "/C", "my", "command"); @@ -38,7 +38,7 @@ public class CommandWrapperTest { private static final File UNIX_NULL_FILE = new File("/dev/null"); @Test - public void testCommandWrapperCommand() { + void testCommandWrapperCommand() { CommandWrapper commandWrapper = CommandWrapper.create(); commandWrapper.setCommand(COMMAND); ProcessBuilder processBuilder = commandWrapper.getBuilder(); @@ -53,7 +53,7 @@ public void testCommandWrapperCommand() { } @Test - public void testCommandWrapperRedirectErrorStream() { + void testCommandWrapperRedirectErrorStream() { CommandWrapper commandWrapper = CommandWrapper.create(); commandWrapper.setCommand(COMMAND); commandWrapper.setRedirectErrorStream(); @@ -69,7 +69,7 @@ public void testCommandWrapperRedirectErrorStream() { } @Test - public void testCommandWrapperRedirectErrorInherit() { + void testCommandWrapperRedirectErrorInherit() { CommandWrapper commandWrapper = CommandWrapper.create(); commandWrapper.setCommand(COMMAND); commandWrapper.setRedirectErrorInherit(); @@ -85,7 +85,7 @@ public void testCommandWrapperRedirectErrorInherit() { } @Test - public void testCommandWrapperDirectory() { + void testCommandWrapperDirectory() { CommandWrapper commandWrapper = CommandWrapper.create(); commandWrapper.setCommand(COMMAND); commandWrapper.setDirectory(DIRECTORY); @@ -101,7 +101,7 @@ public void testCommandWrapperDirectory() { } @Test - public void testCommandWrapperRedirectOutputToNull() { + void testCommandWrapperRedirectOutputToNull() { CommandWrapper commandWrapper = CommandWrapper.create(); commandWrapper.setCommand(COMMAND); commandWrapper.setRedirectOutputToNull(); diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java index d6df12e278..5a3616f170 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java @@ -23,9 +23,9 @@ import com.google.common.truth.Truth; import java.util.logging.Level; import java.util.logging.Logger; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LogRecorderTest { +class LogRecorderTest { private static final String LOG_LINES = "INFO: log line 1\n" + "log line 2\n" + "FINE: log line 3\n"; @@ -33,7 +33,7 @@ public class LogRecorderTest { private final LogRecorder logRecorder = new LogRecorder(testLogger); @Test - public void shouldAggregateLogs() { + void shouldAggregateLogs() { for (String logLine : LOG_LINES.split("\n")) { logRecorder.record(logLine); } @@ -50,7 +50,7 @@ public void shouldAggregateLogs() { } @Test - public void shouldBeEmptyAfterFlushCall() { + void shouldBeEmptyAfterFlushCall() { for (String logLine : LOG_LINES.split("\n")) { logRecorder.record(logLine); } diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java index fe65026b60..2b5405c9bf 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java @@ -16,18 +16,16 @@ package com.google.cloud.testing; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VersionTest { +class VersionTest { @Test - public void testFromString() { + void testFromString() { Version version = Version.fromString("2016.01.13"); assertEquals(2016, version.getMajor()); assertEquals(1, version.getMinor()); @@ -39,57 +37,32 @@ public void testFromString() { } @Test - public void testFromStringWithAlphas() { - try { - Version.fromString("2016.01.hello"); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void testFromStringWithAlphas() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016.01.hello")); } @Test - public void testFromStringMissingPatch() { - try { - Version.fromString("2016.01"); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void testFromStringMissingPatch() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016.01")); } @Test - public void testFromStringMissingMinor() { - try { - Version.fromString("2016"); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void testFromStringMissingMinor() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016")); } @Test - public void testFromStringEmpty() { - try { - Version.fromString(""); - Assert.fail(); - } catch (IllegalArgumentException ex) { - assertNotNull(ex.getMessage()); - } + void testFromStringEmpty() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("")); } @Test - public void testFromStringNull() { - try { - Version.fromString(null); - Assert.fail(); - } catch (NullPointerException ex) { - assertNull(ex.getMessage()); - } + void testFromStringNull() { + assertThrows(NullPointerException.class, () -> Version.fromString(null)); } @Test - public void testCompare() { + void testCompare() { Version version = Version.fromString("2016.01.13"); Version sameVersion = Version.fromString("2016.01.13"); Version olderVersion = Version.fromString("2015.12.01"); diff --git a/java-core/pom.xml b/java-core/pom.xml index 588a56afff..6380b73679 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -38,12 +38,6 @@ import - - junit - junit - 4.13.2 - test - com.google.truth truth diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 6d798069f8..f46adf6328 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -198,6 +198,13 @@ detector-resources-support ${google.cloud.opentelemetry.version} + + org.junit + junit-bom + ${junit.version} + pom + import + From 66435369822a32cb36cdb67cf4a897071f6ab844 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 16 May 2024 21:00:26 +0200 Subject: [PATCH 21/29] deps: update google api dependencies (#2672) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:grpc-google-common-protos](https://togithub.com/googleapis/sdk-platform-java) | `2.37.1` -> `2.39.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:grpc-google-common-protos/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:grpc-google-common-protos/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:grpc-google-common-protos/2.37.1/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:grpc-google-common-protos/2.37.1/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:grpc-google-iam-v1](https://togithub.com/googleapis/sdk-platform-java) | `1.32.1` -> `1.34.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:grpc-google-iam-v1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:grpc-google-iam-v1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:grpc-google-iam-v1/1.32.1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:grpc-google-iam-v1/1.32.1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:proto-google-common-protos](https://togithub.com/googleapis/sdk-platform-java) | `2.37.1` -> `2.39.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-common-protos/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-common-protos/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-common-protos/2.37.1/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-common-protos/2.37.1/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api.grpc:proto-google-iam-v1](https://togithub.com/googleapis/sdk-platform-java) | `1.32.1` -> `1.34.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-iam-v1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-iam-v1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-iam-v1/1.32.1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-iam-v1/1.32.1/1.34.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.api:api-common](https://togithub.com/googleapis/sdk-platform-java) | `2.29.1` -> `2.31.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api:api-common/2.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api:api-common/2.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api:api-common/2.29.1/2.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api:api-common/2.29.1/2.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/sdk-platform-java (com.google.api.grpc:grpc-google-common-protos) ### [`v2.39.0`](https://togithub.com/googleapis/sdk-platform-java/blob/HEAD/CHANGELOG.md#2390-2024-04-18) [Compare Source](https://togithub.com/googleapis/sdk-platform-java/compare/v2.38.0...v2.39.0) ##### Features - add `libraries_bom_version` to generation configuration ([#​2639](https://togithub.com/googleapis/sdk-platform-java/issues/2639)) ([56c7ca5](https://togithub.com/googleapis/sdk-platform-java/commit/56c7ca51d4ca99629251e0aa9cac316eb349c974)) - Add ChannelPoolSettings Getter for gRPC's ChannelProvider ([#​2612](https://togithub.com/googleapis/sdk-platform-java/issues/2612)) ([d0c5191](https://togithub.com/googleapis/sdk-platform-java/commit/d0c5191525d5d157812cae9551fc15bb70caab7e)) - add config change ([#​2604](https://togithub.com/googleapis/sdk-platform-java/issues/2604)) ([8312706](https://togithub.com/googleapis/sdk-platform-java/commit/8312706db6352fca05a5858b513e88f162e5de0b)) - add entry point ([#​2616](https://togithub.com/googleapis/sdk-platform-java/issues/2616)) ([b19fa33](https://togithub.com/googleapis/sdk-platform-java/commit/b19fa3373d3fa17531d627d4581d154374a231ff)) - add generation config comparator ([#​2587](https://togithub.com/googleapis/sdk-platform-java/issues/2587)) ([a94c2f0](https://togithub.com/googleapis/sdk-platform-java/commit/a94c2f0e8a99f0ddf17106cbc8117cefe6b0e127)) - Add JavadocJar Task to build.gradle for self service libraries ([#​2593](https://togithub.com/googleapis/sdk-platform-java/issues/2593)) ([993f5ac](https://togithub.com/googleapis/sdk-platform-java/commit/993f5acf91de3a9d2c7f9fdb10ea47387b240554)) - Client/StubSettings' getEndpoint() returns the resolved endpoint ([#​2440](https://togithub.com/googleapis/sdk-platform-java/issues/2440)) ([4942bc1](https://togithub.com/googleapis/sdk-platform-java/commit/4942bc17e9c7261242ba3d03d85cd8b131ca2e5e)) - generate selected libraries ([#​2598](https://togithub.com/googleapis/sdk-platform-java/issues/2598)) ([739ddbb](https://togithub.com/googleapis/sdk-platform-java/commit/739ddbbbc662f43e46b9f420bbae685de9b3dbc6)) - Validate the Universe Domain inside Java-Core ([#​2592](https://togithub.com/googleapis/sdk-platform-java/issues/2592)) ([35d789f](https://togithub.com/googleapis/sdk-platform-java/commit/35d789fdf488feff41d4bdaa5992013450954870)) ##### Bug Fixes - add main to `generate_repo.py` ([#​2607](https://togithub.com/googleapis/sdk-platform-java/issues/2607)) ([fedeb32](https://togithub.com/googleapis/sdk-platform-java/commit/fedeb3237b6d25245f4d770ec105bd538dfee405)) - correct deep-remove and deep-preserve regexes ([#​2572](https://togithub.com/googleapis/sdk-platform-java/issues/2572)) ([4c7fd88](https://togithub.com/googleapis/sdk-platform-java/commit/4c7fd880a90d08448db366bde40d0d385b45f75e)) - first attempt should use the min of RPC timeout and total timeout ([#​2641](https://togithub.com/googleapis/sdk-platform-java/issues/2641)) ([0349232](https://togithub.com/googleapis/sdk-platform-java/commit/034923277750171418d74060e225ffd68ef38bf2)) - remove duplicated calls to AutoValue builders ([#​2636](https://togithub.com/googleapis/sdk-platform-java/issues/2636)) ([53a3727](https://togithub.com/googleapis/sdk-platform-java/commit/53a3727e4a9548bf0417d4ee6ed3e9ab571642ed)) - remove unnecessary slf4j and AbstractGoogleClientRequest native image configs ([0cb7d0e](https://togithub.com/googleapis/sdk-platform-java/commit/0cb7d0e0c03f2dd2853a86d67c9529a50ed8238f)) - remove unnecessary slf4j and AbstractGoogleClientRequest native image configs ([#​2628](https://togithub.com/googleapis/sdk-platform-java/issues/2628)) ([0cb7d0e](https://togithub.com/googleapis/sdk-platform-java/commit/0cb7d0e0c03f2dd2853a86d67c9529a50ed8238f)) ##### Dependencies - update arrow.version to v15.0.2 ([#​2589](https://togithub.com/googleapis/sdk-platform-java/issues/2589)) ([777acf3](https://togithub.com/googleapis/sdk-platform-java/commit/777acf3df4b5379cd8a8cf52b844203dd514ee24)) - update dependency com.google.cloud.opentelemetry:detector-resources-support to v0.28.0 ([#​2649](https://togithub.com/googleapis/sdk-platform-java/issues/2649)) ([e4ed176](https://togithub.com/googleapis/sdk-platform-java/commit/e4ed1765f3dbb950d498df307d79577abf71a66a)) - update dependency gitpython to v3.1.41 \[security] ([#​2625](https://togithub.com/googleapis/sdk-platform-java/issues/2625)) ([e41bd8f](https://togithub.com/googleapis/sdk-platform-java/commit/e41bd8f00ffcb271b2a008364f334693d9dfdc9d)) - update dependency net.bytebuddy:byte-buddy to v1.14.13 ([#​2646](https://togithub.com/googleapis/sdk-platform-java/issues/2646)) ([73ac5a4](https://togithub.com/googleapis/sdk-platform-java/commit/73ac5a4bfe05ac11a121664f52a4013cb4bb33a9)) - update dependency org.threeten:threeten-extra to v1.8.0 ([#​2650](https://togithub.com/googleapis/sdk-platform-java/issues/2650)) ([226325a](https://togithub.com/googleapis/sdk-platform-java/commit/226325a5b7c93c1ad1b4af5da4283e369887fa42)) - update dependency org.threeten:threetenbp to v1.6.9 ([#​2602](https://togithub.com/googleapis/sdk-platform-java/issues/2602)) ([371753e](https://togithub.com/googleapis/sdk-platform-java/commit/371753ebbd83d703f314dd5f4e34e16c255836c6)) - update dependency org.threeten:threetenbp to v1.6.9 ([#​2665](https://togithub.com/googleapis/sdk-platform-java/issues/2665)) ([8935bc8](https://togithub.com/googleapis/sdk-platform-java/commit/8935bc87307e73101df72a85f98a8ec1bdde0c14)) - update google api dependencies ([#​2584](https://togithub.com/googleapis/sdk-platform-java/issues/2584)) ([cd20604](https://togithub.com/googleapis/sdk-platform-java/commit/cd20604f3128d2efc1802065c63b6663186ce3af)) - update googleapis/java-cloud-bom digest to [`7071341`](https://togithub.com/googleapis/sdk-platform-java/commit/7071341) ([#​2608](https://togithub.com/googleapis/sdk-platform-java/issues/2608)) ([8d74140](https://togithub.com/googleapis/sdk-platform-java/commit/8d7414029984c073e9bae2952971d2337dbf81ab)) - update netty dependencies to v4.1.109.final ([#​2597](https://togithub.com/googleapis/sdk-platform-java/issues/2597)) ([8990693](https://togithub.com/googleapis/sdk-platform-java/commit/8990693abf157a1adf2723c6db1bce71a5efa810)) - update opentelemetry-java monorepo to v1.37.0 ([#​2652](https://togithub.com/googleapis/sdk-platform-java/issues/2652)) ([f8fa2e9](https://togithub.com/googleapis/sdk-platform-java/commit/f8fa2e9f7316f17f1e753a74a6839d9e331c010a)) - update protobuf dependencies to v3.25.3 ([#​2491](https://togithub.com/googleapis/sdk-platform-java/issues/2491)) ([b0e5041](https://togithub.com/googleapis/sdk-platform-java/commit/b0e5041ff0fafaf900a7cf1929f0d85fc582a0d7)) - update slf4j monorepo to v2.0.13 ([#​2647](https://togithub.com/googleapis/sdk-platform-java/issues/2647)) ([f030e29](https://togithub.com/googleapis/sdk-platform-java/commit/f030e29b1538ad28ad9628ec03d8e3eb2f21d6c2)) ### [`v2.38.0`](https://togithub.com/googleapis/sdk-platform-java/blob/HEAD/CHANGELOG.md#2380-2024-03-15) ##### Features - \[common-protos] add `api_version` extension to `ServiceOptions`, for collaborative versioning ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - \[common-protos] add `api_version` extension to `ServiceOptions`, for collaborative versioning ([#​2551](https://togithub.com/googleapis/sdk-platform-java/issues/2551)) ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - add `ErrorReason.LOCATION_POLICY_VIOLATED` enum value ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - add `ErrorReason.LOCATION_POLICY_VIOLATED` enum value ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - add `Publishing.rest_reference_documentation_uri` to aid client library publication ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - add `Publishing.rest_reference_documentation_uri` to aid client library publication ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - Add shopping and chat common protos. ([#​2553](https://togithub.com/googleapis/sdk-platform-java/issues/2553)) ([5f2d4e7](https://togithub.com/googleapis/sdk-platform-java/commit/5f2d4e73ec5511613a97f463e28567487f47cd44)), closes [#​2018](https://togithub.com/googleapis/sdk-platform-java/issues/2018) - get PR description from googleapis commits ([#​2531](https://togithub.com/googleapis/sdk-platform-java/issues/2531)) ([c2ea697](https://togithub.com/googleapis/sdk-platform-java/commit/c2ea697fdfd9127a203524424e93e1d32ae2b8fa)) - Introduce OpenTelemetry Metrics Recording ([#​2500](https://togithub.com/googleapis/sdk-platform-java/issues/2500)) ([b936580](https://togithub.com/googleapis/sdk-platform-java/commit/b936580e905716a7fdf78d9219eb55889ee9274e)) - skip build only commit ([#​2555](https://togithub.com/googleapis/sdk-platform-java/issues/2555)) ([180c8a9](https://togithub.com/googleapis/sdk-platform-java/commit/180c8a964893b3dc8e40c51adc4d76e570a87e04)) - Universe Domain Environment Variable Support ([#​2485](https://togithub.com/googleapis/sdk-platform-java/issues/2485)) ([1463d64](https://togithub.com/googleapis/sdk-platform-java/commit/1463d645edf96087335618542f7bbca722a97b71)) ##### Dependencies - normalize dependencies ([#​2574](https://togithub.com/googleapis/sdk-platform-java/issues/2574)) ([6622238](https://togithub.com/googleapis/sdk-platform-java/commit/66222380977e7cba3a7951fba6102481af130d2e)) - update arrow.version to v15.0.1 ([#​2565](https://togithub.com/googleapis/sdk-platform-java/issues/2565)) ([b2c3f6a](https://togithub.com/googleapis/sdk-platform-java/commit/b2c3f6a0bb6bd33063516060851ebbae628c8fed)) - update dependency com.fasterxml.jackson:jackson-bom to v2.17.0 ([#​2564](https://togithub.com/googleapis/sdk-platform-java/issues/2564)) ([40ae7f9](https://togithub.com/googleapis/sdk-platform-java/commit/40ae7f9a628ec7b34b5b001ffc54d49e4059dd81)) - update dependency com.google.api-client:google-api-client-bom to v2.4.0 ([#​2570](https://togithub.com/googleapis/sdk-platform-java/issues/2570)) ([f60441f](https://togithub.com/googleapis/sdk-platform-java/commit/f60441ff4c1fb530ac27a8c492cd1b45196ea13c)) - update dependency com.google.errorprone:error_prone_annotations to v2.26.1 ([#​2530](https://togithub.com/googleapis/sdk-platform-java/issues/2530)) ([7c1aaab](https://togithub.com/googleapis/sdk-platform-java/commit/7c1aaabb0ef5f3664b6065b89ca74a1075ab74c7)) - update dependency com.google.errorprone:error_prone_annotations to v2.26.1 ([#​2532](https://togithub.com/googleapis/sdk-platform-java/issues/2532)) ([447b4e1](https://togithub.com/googleapis/sdk-platform-java/commit/447b4e1d8a9079506bde78ab7ec0831a90e19b82)) - update dependency io.netty:netty-tcnative-boringssl-static to v2.0.65.final ([#​2547](https://togithub.com/googleapis/sdk-platform-java/issues/2547)) ([46e0e0f](https://togithub.com/googleapis/sdk-platform-java/commit/46e0e0f1d5b0f9d70a9d5cff67a692e802f8992a)) - update dependency net.bytebuddy:byte-buddy to v1.14.12 ([#​2522](https://togithub.com/googleapis/sdk-platform-java/issues/2522)) ([edfec32](https://togithub.com/googleapis/sdk-platform-java/commit/edfec3232c99591093a8d9f9a9ff43edeb9878e9)) - update google api dependencies ([#​2484](https://togithub.com/googleapis/sdk-platform-java/issues/2484)) ([92e91bc](https://togithub.com/googleapis/sdk-platform-java/commit/92e91bc0d91a2619a87abf9b072229a3ab3f4d91)) - update google api dependencies ([#​2538](https://togithub.com/googleapis/sdk-platform-java/issues/2538)) ([d9355cf](https://togithub.com/googleapis/sdk-platform-java/commit/d9355cf5e6751de8bb8a7ff7e101b7f52425e19a)) - update googleapis/java-cloud-bom digest to [`3f93d58`](https://togithub.com/googleapis/sdk-platform-java/commit/3f93d58) ([#​2499](https://togithub.com/googleapis/sdk-platform-java/issues/2499)) ([5fd4d5e](https://togithub.com/googleapis/sdk-platform-java/commit/5fd4d5e3a9f864064587eec4d11b14b3c037efcf)) - update googleapis/java-cloud-bom digest to [`659764f`](https://togithub.com/googleapis/sdk-platform-java/commit/659764f) ([#​2545](https://togithub.com/googleapis/sdk-platform-java/issues/2545)) ([d6c8be6](https://togithub.com/googleapis/sdk-platform-java/commit/d6c8be6e7da262ecc1ac61fbc052af24c59d94ef)) - update netty dependencies ([#​2480](https://togithub.com/googleapis/sdk-platform-java/issues/2480)) ([40753c3](https://togithub.com/googleapis/sdk-platform-java/commit/40753c3ca3d0d3d6e83bfd38764071a57c9e7c8b)) - update opentelemetry-java monorepo to v1.35.0 ([#​2477](https://togithub.com/googleapis/sdk-platform-java/issues/2477)) ([3ecefff](https://togithub.com/googleapis/sdk-platform-java/commit/3ecefff9f1e458119db24da729094b5a1ca22279)) - update opentelemetry-java monorepo to v1.36.0 ([#​2550](https://togithub.com/googleapis/sdk-platform-java/issues/2550)) ([9669c21](https://togithub.com/googleapis/sdk-platform-java/commit/9669c21d4e01017b4aa65abc0fb1e80de31ff0c6)) - update opentelemetry-java monorepo to v1.36.0 ([#​2573](https://togithub.com/googleapis/sdk-platform-java/issues/2573)) ([f5f201e](https://togithub.com/googleapis/sdk-platform-java/commit/f5f201e9846c46f6e7241a15674d28711fe984f4)) - update slf4j monorepo to v2.0.12 ([#​2481](https://togithub.com/googleapis/sdk-platform-java/issues/2481)) ([363a354](https://togithub.com/googleapis/sdk-platform-java/commit/363a3549b2bda040e55ec59ef21010b6c99a021e)) ##### Documentation - minor tweaks to various comments ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) - minor tweaks to various comments ([d343be9](https://togithub.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java). --- gax-java/dependencies.properties | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 3dc2183988..a41774c6a9 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -35,8 +35,8 @@ version.io_grpc=1.62.2 # It should be constructed the following way: # 1) Take full artifact id (including the group and classifier (if any) portions) and remove version portion. # 2) Replace all characters which are neither alphabetic nor digits with the underscore ('_') character -maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.37.1 -maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.37.1 +maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.39.1 +maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.39.1 maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.23.0 maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.23.0 maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.38.0 @@ -67,10 +67,10 @@ maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_ maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:2.8 maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.10.4 maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.10.4 -maven.com_google_api_api_common=com.google.api:api-common:2.29.1 +maven.com_google_api_api_common=com.google.api:api-common:2.31.1 maven.org_threeten_threetenbp=org.threeten:threetenbp:1.6.9 -maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.32.1 -maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.32.1 +maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.34.1 +maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.34.1 maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.44.1 maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.44.1 maven.org_codehaus_mojo_animal_sniffer_annotations=org.codehaus.mojo:animal-sniffer-annotations:1.23 From f7a5161b637cbefe922b655582f5604e080f51e5 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 16 May 2024 17:52:15 -0400 Subject: [PATCH 22/29] feat: generate proto-only repository (#2720) In this PR: - Enable hermetic build script to generate `java-common-protos` and `java-iam` in this repo. - Change `libraries_bom_version` to optional. - Refactor unit tests. - Remove `java-common-protos/codecov.yaml` and `java-iam/codecov.yaml` as they are no longer needed. --- java-common-protos/codecov.yaml | 4 - java-common-protos/owlbot.py | 1 + java-iam/codecov.yaml | 4 - library_generation/generate_repo.py | 4 +- library_generation/model/gapic_inputs.py | 2 +- library_generation/model/generation_config.py | 23 ++- .../test/cli/entry_point_unit_tests.py | 1 + .../test/model/gapic_inputs_unit_tests.py | 132 +++++++++++++ ...est.py => generation_config_unit_tests.py} | 53 +++--- .../.repo-metadata-proto-only-golden.json | 17 ++ .../resources/misc/BUILD_proto_only.bazel | 16 ++ .../test/utilities_unit_tests.py | 174 +++--------------- library_generation/utils/utilities.py | 18 +- 13 files changed, 254 insertions(+), 195 deletions(-) delete mode 100644 java-common-protos/codecov.yaml delete mode 100644 java-iam/codecov.yaml create mode 100644 library_generation/test/model/gapic_inputs_unit_tests.py rename library_generation/test/model/{generation_config_unit_test.py => generation_config_unit_tests.py} (90%) create mode 100644 library_generation/test/resources/goldens/.repo-metadata-proto-only-golden.json create mode 100644 library_generation/test/resources/misc/BUILD_proto_only.bazel diff --git a/java-common-protos/codecov.yaml b/java-common-protos/codecov.yaml deleted file mode 100644 index 5724ea9478..0000000000 --- a/java-common-protos/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/java-common-protos/owlbot.py b/java-common-protos/owlbot.py index dd6b0d767f..ffada9aa43 100644 --- a/java-common-protos/owlbot.py +++ b/java-common-protos/owlbot.py @@ -44,6 +44,7 @@ "SECURITY.md", "java.header", "license-checks.xml", + "README.md", "renovate.json", ".gitignore" ]) diff --git a/java-iam/codecov.yaml b/java-iam/codecov.yaml deleted file mode 100644 index 5724ea9478..0000000000 --- a/java-iam/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/library_generation/generate_repo.py b/library_generation/generate_repo.py index af70bcc1f2..214cd78648 100755 --- a/library_generation/generate_repo.py +++ b/library_generation/generate_repo.py @@ -48,7 +48,6 @@ def generate_from_yaml( for library_path, library in repo_config.libraries.items(): print(f"generating library {library.get_library_name()}") - generate_composed_library( config_path=config_path, config=config, @@ -58,8 +57,7 @@ def generate_from_yaml( versions_file=repo_config.versions_file, ) - # we skip monorepo_postprocessing if not in a monorepo - if not config.is_monorepo(): + if not config.is_monorepo() or config.contains_common_protos(): return monorepo_postprocessing( diff --git a/library_generation/model/gapic_inputs.py b/library_generation/model/gapic_inputs.py index 4bb9ce64f4..992e4c2e3c 100644 --- a/library_generation/model/gapic_inputs.py +++ b/library_generation/model/gapic_inputs.py @@ -56,7 +56,7 @@ def __init__( self, proto_only="true", additional_protos="google/cloud/common_resources.proto", - transport="", + transport="grpc", rest_numeric_enum="", gapic_yaml="", service_config="", diff --git a/library_generation/model/generation_config.py b/library_generation/model/generation_config.py index bc9c5e3f20..3557cf63d2 100644 --- a/library_generation/model/generation_config.py +++ b/library_generation/model/generation_config.py @@ -20,6 +20,7 @@ REPO_LEVEL_PARAMETER = "Repo level parameter" LIBRARY_LEVEL_PARAMETER = "Library level parameter" GAPIC_LEVEL_PARAMETER = "GAPIC level parameter" +COMMON_PROTOS_LIBRARY_NAME = "common-protos" class GenerationConfig: @@ -31,9 +32,9 @@ def __init__( self, gapic_generator_version: str, googleapis_commitish: str, - libraries_bom_version: str, template_excludes: list[str], libraries: list[LibraryConfig], + libraries_bom_version: Optional[str] = None, grpc_version: Optional[str] = None, protoc_version: Optional[str] = None, ): @@ -44,6 +45,9 @@ def __init__( self.libraries = libraries self.grpc_version = grpc_version self.protoc_version = protoc_version + # explicit set to None so that we can compute the + # value in getter. + self.__contains_common_protos = None self.__validate() def get_proto_path_to_library_name(self) -> dict[str, str]: @@ -61,6 +65,15 @@ def get_proto_path_to_library_name(self) -> dict[str, str]: def is_monorepo(self) -> bool: return len(self.libraries) > 1 + def contains_common_protos(self) -> bool: + if self.__contains_common_protos is None: + self.__contains_common_protos = False + for library in self.libraries: + if library.get_library_name() == COMMON_PROTOS_LIBRARY_NAME: + self.__contains_common_protos = True + break + return self.__contains_common_protos + def __validate(self) -> None: seen_library_names = dict() for library in self.libraries: @@ -133,15 +146,13 @@ def from_yaml(path_to_yaml: str) -> GenerationConfig: gapic_generator_version=__required( config, "gapic_generator_version", REPO_LEVEL_PARAMETER ), - grpc_version=__optional(config, "grpc_version", None), - protoc_version=__optional(config, "protoc_version", None), googleapis_commitish=__required( config, "googleapis_commitish", REPO_LEVEL_PARAMETER ), - libraries_bom_version=__required( - config, "libraries_bom_version", REPO_LEVEL_PARAMETER - ), template_excludes=__required(config, "template_excludes", REPO_LEVEL_PARAMETER), + grpc_version=__optional(config, "grpc_version", None), + protoc_version=__optional(config, "protoc_version", None), + libraries_bom_version=__optional(config, "libraries_bom_version", None), libraries=parsed_libraries, ) diff --git a/library_generation/test/cli/entry_point_unit_tests.py b/library_generation/test/cli/entry_point_unit_tests.py index ace2794684..55fb583651 100644 --- a/library_generation/test/cli/entry_point_unit_tests.py +++ b/library_generation/test/cli/entry_point_unit_tests.py @@ -22,6 +22,7 @@ class EntryPointTest(unittest.TestCase): def test_entry_point_without_config_raise_file_exception(self): + os.chdir(script_dir) runner = CliRunner() # noinspection PyTypeChecker result = runner.invoke(generate, ["--repository-path=."]) diff --git a/library_generation/test/model/gapic_inputs_unit_tests.py b/library_generation/test/model/gapic_inputs_unit_tests.py new file mode 100644 index 0000000000..210d321591 --- /dev/null +++ b/library_generation/test/model/gapic_inputs_unit_tests.py @@ -0,0 +1,132 @@ +import os +import unittest +from pathlib import Path + +from parameterized import parameterized +from library_generation.model.gapic_inputs import parse + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +build_file = Path(os.path.join(resources_dir, "misc")).resolve() + + +class UtilitiesTest(unittest.TestCase): + @parameterized.expand( + [ + ("BUILD_no_additional_protos.bazel", " "), + ("BUILD_common_resources.bazel", " google/cloud/common_resources.proto"), + ("BUILD_comment_common_resources.bazel", " "), + ("BUILD_locations.bazel", " google/cloud/location/locations.proto"), + ("BUILD_comment_locations.bazel", " "), + ("BUILD_iam_policy.bazel", " google/iam/v1/iam_policy.proto"), + ("BUILD_comment_iam_policy.bazel", " "), + ( + "BUILD_iam_locations.bazel", + " google/cloud/location/locations.proto google/iam/v1/iam_policy.proto", + ), + ] + ) + def test_gapic_inputs_parse_additional_protos(self, build_name, expected): + parsed = parse(build_file, "", build_name) + self.assertEqual( + expected, + parsed.additional_protos, + ) + + def test_gapic_inputs_parse_grpc_only_succeeds(self): + parsed = parse(build_file, "", "BUILD_grpc.bazel") + self.assertEqual("grpc", parsed.transport) + + def test_gapic_inputs_parse_grpc_rest_succeeds(self): + parsed = parse(build_file, "", "BUILD_grpc_rest.bazel") + self.assertEqual("grpc+rest", parsed.transport) + + def test_gapic_inputs_parse_rest_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest.bazel") + self.assertEqual("rest", parsed.transport) + + def test_gapic_inputs_parse_empty_include_samples_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_empty.bazel") + self.assertEqual("false", parsed.include_samples) + + def test_gapic_inputs_parse_include_samples_false_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_false.bazel") + self.assertEqual("false", parsed.include_samples) + + def test_gapic_inputs_parse_include_samples_true_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_true.bazel") + self.assertEqual("true", parsed.include_samples) + + def test_gapic_inputs_parse_empty_rest_numeric_enums_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_empty.bazel") + self.assertEqual("false", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_rest_numeric_enums_false_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_false.bazel") + self.assertEqual("false", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_rest_numeric_enums_true_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_true.bazel") + self.assertEqual("true", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_no_gapic_library_returns_proto_only_true(self): + # include_samples_empty only has a gradle assembly rule + parsed = parse(build_file, "", "BUILD_include_samples_empty.bazel") + self.assertEqual("true", parsed.proto_only) + + def test_gapic_inputs_parse_with_gapic_library_returns_proto_only_false(self): + # rest.bazel has a java_gapic_library rule + parsed = parse(build_file, "", "BUILD_rest.bazel") + self.assertEqual("false", parsed.proto_only) + + def test_gapic_inputs_parse_gapic_yaml_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_gapic_yaml.bazel") + self.assertEqual("test/versioned/path/test_gapic_yaml.yaml", parsed.gapic_yaml) + + def test_gapic_inputs_parse_no_gapic_yaml_returns_empty_string(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_no_gapic_yaml.bazel") + self.assertEqual("", parsed.gapic_yaml) + + def test_gapic_inputs_parse_service_config_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_service_config.bazel") + self.assertEqual( + "test/versioned/path/test_service_config.json", parsed.service_config + ) + + def test_gapic_inputs_parse_service_yaml_relative_target(self): + parsed = parse( + build_file, + "google/cloud/compute/v1", + "BUILD_service_config_relative_target.bazel", + ) + self.assertEqual( + "google/cloud/compute/v1/compute_grpc_service_config.json", + parsed.service_config, + ) + + def test_gapic_inputs_parse_no_service_config_returns_empty_string(self): + parsed = parse( + build_file, "test/versioned/path", "BUILD_no_service_config.bazel" + ) + self.assertEqual("", parsed.service_config) + + def test_gapic_inputs_parse_service_yaml_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_service_yaml.bazel") + self.assertEqual( + "test/versioned/path/test_service_yaml.yaml", parsed.service_yaml + ) + + def test_gapic_inputs_parse_service_yaml_absolute_target(self): + parsed = parse(build_file, "", "BUILD_service_yaml_absolute_target.bazel") + self.assertEqual( + "google/cloud/videointelligence/videointelligence_v1p3beta1.yaml", + parsed.service_yaml, + ) + + def test_gapic_inputs_parse_no_service_yaml_returns_empty_string(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_no_service_yaml.bazel") + self.assertEqual("", parsed.service_yaml) + + def test_gapic_inputs_parse_proto_only_returns_grpc(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_proto_only.bazel") + self.assertEqual("grpc", parsed.transport) diff --git a/library_generation/test/model/generation_config_unit_test.py b/library_generation/test/model/generation_config_unit_tests.py similarity index 90% rename from library_generation/test/model/generation_config_unit_test.py rename to library_generation/test/model/generation_config_unit_tests.py index d9efb494c0..8f94ecae1e 100644 --- a/library_generation/test/model/generation_config_unit_test.py +++ b/library_generation/test/model/generation_config_unit_tests.py @@ -35,6 +35,13 @@ product_documentation="", gapic_configs=[], ) +common_protos_library = LibraryConfig( + api_shortname="common-protos", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], +) class GenerationConfigTest(unittest.TestCase): @@ -123,6 +130,26 @@ def test_is_monorepo_with_two_libraries_returns_true(self): ) self.assertTrue(config.is_monorepo()) + def test_contains_common_protos_with_common_protos_returns_true(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries_bom_version="", + template_excludes=[], + libraries=[library_1, library_2, common_protos_library], + ) + self.assertTrue(config.contains_common_protos()) + + def test_contains_common_protos_without_common_protos_returns_false(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries_bom_version="", + template_excludes=[], + libraries=[library_1, library_2], + ) + self.assertFalse(config.contains_common_protos()) + def test_validate_with_duplicate_library_name_raise_exception(self): self.assertRaisesRegex( ValueError, @@ -131,8 +158,6 @@ def test_validate_with_duplicate_library_name_raise_exception(self): gapic_generator_version="", googleapis_commitish="", libraries_bom_version="", - owlbot_cli_image="", - synthtool_commitish="", template_excludes=[], libraries=[ LibraryConfig( @@ -169,30 +194,6 @@ def test_from_yaml_without_googleapis_commitish_raise_exception(self): f"{test_config_dir}/config_without_googleapis.yaml", ) - def test_from_yaml_without_libraries_bom_version_raise_exception(self): - self.assertRaisesRegex( - ValueError, - "Repo level parameter, libraries_bom_version", - from_yaml, - f"{test_config_dir}/config_without_libraries_bom_version.yaml", - ) - - def test_from_yaml_without_owlbot_cli_image_raise_exception(self): - self.assertRaisesRegex( - ValueError, - "Repo level parameter, owlbot_cli_image", - from_yaml, - f"{test_config_dir}/config_without_owlbot.yaml", - ) - - def test_from_yaml_without_synthtool_commitish_raise_exception(self): - self.assertRaisesRegex( - ValueError, - "Repo level parameter, synthtool_commitish", - from_yaml, - f"{test_config_dir}/config_without_synthtool.yaml", - ) - def test_from_yaml_without_template_excludes_raise_exception(self): self.assertRaisesRegex( ValueError, diff --git a/library_generation/test/resources/goldens/.repo-metadata-proto-only-golden.json b/library_generation/test/resources/goldens/.repo-metadata-proto-only-golden.json new file mode 100644 index 0000000000..995607bae4 --- /dev/null +++ b/library_generation/test/resources/goldens/.repo-metadata-proto-only-golden.json @@ -0,0 +1,17 @@ +{ + "api_shortname": "baremetalsolution", + "name_pretty": "Bare Metal Solution", + "product_documentation": "https://cloud.google.com/bare-metal/docs", + "api_description": "Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bare-metal-solution/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/sdk-platform-java", + "repo_short": "java-bare-metal-solution", + "distribution_name": "com.google.cloud:google-cloud-bare-metal-solution", + "library_type": "OTHER", + "requires_billing": true, + "rest_documentation": "https://cloud.google.com/bare-metal/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/bare-metal/docs/reference/rpc" +} \ No newline at end of file diff --git a/library_generation/test/resources/misc/BUILD_proto_only.bazel b/library_generation/test/resources/misc/BUILD_proto_only.bazel new file mode 100644 index 0000000000..26bcea6126 --- /dev/null +++ b/library_generation/test/resources/misc/BUILD_proto_only.bazel @@ -0,0 +1,16 @@ +java_gapic_assembly_gradle_pkg( + name = "google-api-java", + transport = "grpc+rest", + deps = [ + "annotations_proto", + "auth_proto", + "backend_proto", + "billing_proto", + "client_proto", + "config_change_proto", + "consumer_proto", + "context_proto", + "control_proto", + "distribution_proto", + ], +) \ No newline at end of file diff --git a/library_generation/test/utilities_unit_tests.py b/library_generation/test/utilities_unit_tests.py index 96c03087fa..565d0063da 100644 --- a/library_generation/test/utilities_unit_tests.py +++ b/library_generation/test/utilities_unit_tests.py @@ -21,19 +21,15 @@ import io import contextlib from pathlib import Path -from parameterized import parameterized from library_generation.utils import utilities as util from library_generation.model.gapic_config import GapicConfig from library_generation.model.generation_config import GenerationConfig -from library_generation.model.gapic_inputs import parse as parse_build_file from library_generation.model.library_config import LibraryConfig from library_generation.test.test_utils import FileComparator from library_generation.test.test_utils import cleanup script_dir = os.path.dirname(os.path.realpath(__file__)) resources_dir = os.path.join(script_dir, "resources") -build_file = Path(os.path.join(resources_dir, "misc")).resolve() -test_config_dir = Path(os.path.join(resources_dir, "test-config")).resolve() file_comparator = FileComparator() library_1 = LibraryConfig( api_shortname="baremetalsolution", @@ -52,12 +48,11 @@ api_description="allows you to encrypt, store, manage, and audit infrastructure and application-level secrets.", gapic_configs=list(), ) -library_3 = LibraryConfig( - api_shortname="secret", - name_pretty="Secret Management Example", - product_documentation="https://cloud.google.com/solutions/", - api_description="allows you to encrypt, store, and audit infrastructure and application-level secrets.", - library_name="secretmanager", +common_protos = LibraryConfig( + api_shortname="common-protos", + name_pretty="Common Protos", + product_documentation="", + api_description="example description", gapic_configs=list(), ) @@ -172,138 +167,6 @@ def test_eprint_valid_input_succeeds(self): # print() appends a `\n` each time it's called self.assertEqual(test_input + "\n", result) - @parameterized.expand( - [ - ("BUILD_no_additional_protos.bazel", " "), - ("BUILD_common_resources.bazel", " google/cloud/common_resources.proto"), - ("BUILD_comment_common_resources.bazel", " "), - ("BUILD_locations.bazel", " google/cloud/location/locations.proto"), - ("BUILD_comment_locations.bazel", " "), - ("BUILD_iam_policy.bazel", " google/iam/v1/iam_policy.proto"), - ("BUILD_comment_iam_policy.bazel", " "), - ( - "BUILD_iam_locations.bazel", - " google/cloud/location/locations.proto google/iam/v1/iam_policy.proto", - ), - ] - ) - def test_gapic_inputs_parse_additional_protos(self, build_name, expected): - parsed = parse_build_file(build_file, "", build_name) - self.assertEqual( - expected, - parsed.additional_protos, - ) - - def test_gapic_inputs_parse_grpc_only_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_grpc.bazel") - self.assertEqual("grpc", parsed.transport) - - def test_gapic_inputs_parse_grpc_rest_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_grpc_rest.bazel") - self.assertEqual("grpc+rest", parsed.transport) - - def test_gapic_inputs_parse_rest_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_rest.bazel") - self.assertEqual("rest", parsed.transport) - - def test_gapic_inputs_parse_empty_include_samples_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_include_samples_empty.bazel") - self.assertEqual("false", parsed.include_samples) - - def test_gapic_inputs_parse_include_samples_false_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_include_samples_false.bazel") - self.assertEqual("false", parsed.include_samples) - - def test_gapic_inputs_parse_include_samples_true_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_include_samples_true.bazel") - self.assertEqual("true", parsed.include_samples) - - def test_gapic_inputs_parse_empty_rest_numeric_enums_succeeds(self): - parsed = parse_build_file( - build_file, "", "BUILD_rest_numeric_enums_empty.bazel" - ) - self.assertEqual("false", parsed.rest_numeric_enum) - - def test_gapic_inputs_parse_rest_numeric_enums_false_succeeds(self): - parsed = parse_build_file( - build_file, "", "BUILD_rest_numeric_enums_false.bazel" - ) - self.assertEqual("false", parsed.rest_numeric_enum) - - def test_gapic_inputs_parse_rest_numeric_enums_true_succeeds(self): - parsed = parse_build_file(build_file, "", "BUILD_rest_numeric_enums_true.bazel") - self.assertEqual("true", parsed.rest_numeric_enum) - - def test_gapic_inputs_parse_no_gapic_library_returns_proto_only_true(self): - # include_samples_empty only has a gradle assembly rule - parsed = parse_build_file(build_file, "", "BUILD_include_samples_empty.bazel") - self.assertEqual("true", parsed.proto_only) - - def test_gapic_inputs_parse_with_gapic_library_returns_proto_only_false(self): - # rest.bazel has a java_gapic_library rule - parsed = parse_build_file(build_file, "", "BUILD_rest.bazel") - self.assertEqual("false", parsed.proto_only) - - def test_gapic_inputs_parse_gapic_yaml_succeeds(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_gapic_yaml.bazel" - ) - self.assertEqual("test/versioned/path/test_gapic_yaml.yaml", parsed.gapic_yaml) - - def test_gapic_inputs_parse_no_gapic_yaml_returns_empty_string(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_no_gapic_yaml.bazel" - ) - self.assertEqual("", parsed.gapic_yaml) - - def test_gapic_inputs_parse_service_config_succeeds(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_service_config.bazel" - ) - self.assertEqual( - "test/versioned/path/test_service_config.json", parsed.service_config - ) - - def test_gapic_inputs_parse_service_yaml_relative_target(self): - parsed = parse_build_file( - build_file, - "google/cloud/compute/v1", - "BUILD_service_config_relative_target.bazel", - ) - self.assertEqual( - "google/cloud/compute/v1/compute_grpc_service_config.json", - parsed.service_config, - ) - - def test_gapic_inputs_parse_no_service_config_returns_empty_string(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_no_service_config.bazel" - ) - self.assertEqual("", parsed.service_config) - - def test_gapic_inputs_parse_service_yaml_succeeds(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_service_yaml.bazel" - ) - self.assertEqual( - "test/versioned/path/test_service_yaml.yaml", parsed.service_yaml - ) - - def test_gapic_inputs_parse_service_yaml_absolute_target(self): - parsed = parse_build_file( - build_file, "", "BUILD_service_yaml_absolute_target.bazel" - ) - self.assertEqual( - "google/cloud/videointelligence/videointelligence_v1p3beta1.yaml", - parsed.service_yaml, - ) - - def test_gapic_inputs_parse_no_service_yaml_returns_empty_string(self): - parsed = parse_build_file( - build_file, "test/versioned/path", "BUILD_no_service_yaml.bazel" - ) - self.assertEqual("", parsed.service_yaml) - def test_generate_prerequisite_files_non_monorepo_success(self): library_path = self.__setup_prerequisite_files( combination=1, library_type="GAPIC_COMBO" @@ -340,6 +203,24 @@ def test_generate_prerequisite_files_monorepo_success(self): ) self.__remove_prerequisite_files(path=library_path) + def test_generate_prerequisite_files_proto_only_repo_success(self): + library_path = self.__setup_prerequisite_files( + combination=3, library_type="OTHER" + ) + + file_comparator.compare_files( + f"{library_path}/.repo-metadata.json", + f"{library_path}/.repo-metadata-proto-only-golden.json", + ) + file_comparator.compare_files( + f"{library_path}/.OwlBot-hermetic.yaml", + f"{library_path}/.OwlBot-hermetic-golden.yaml", + ) + file_comparator.compare_files( + f"{library_path}/owlbot.py", f"{library_path}/owlbot-golden.py" + ) + self.__remove_prerequisite_files(path=library_path) + def test_prepare_repo_monorepo_success(self): gen_config = self.__get_a_gen_config(2) repo_config = util.prepare_repo( @@ -388,6 +269,7 @@ def __setup_prerequisite_files( f"{library_path}/owlbot.py", ] cleanup(files) + library.library_type = library_type config = self.__get_a_gen_config(combination, library_type=library_type) proto_path = "google/cloud/baremetalsolution/v2" transport = "grpc" @@ -412,12 +294,12 @@ def __get_a_gen_config( the GenerationConfig. Only support 1, 2 or 3. :return: an object of GenerationConfig """ - if combination == 2: + if combination == 1: + libraries = [library_1] + elif combination == 2: libraries = [library_1, library_2] - elif combination == 3: - libraries = [library_with_empty_api_id, library_2] else: - libraries = [library_1] + libraries = [library_1, common_protos] # update libraries with custom configuration (for now, only # library_type) diff --git a/library_generation/utils/utilities.py b/library_generation/utils/utilities.py index 71c58f0455..99673fb1bc 100755 --- a/library_generation/utils/utilities.py +++ b/library_generation/utils/utilities.py @@ -26,6 +26,7 @@ from library_generation.utils.proto_path_utils import remove_version_from script_dir = os.path.dirname(os.path.realpath(__file__)) +SDK_PLATFORM_JAVA = "googleapis/sdk-platform-java" def create_argument(arg_key: str, arg_container: object) -> List[str]: @@ -194,6 +195,7 @@ def generate_prerequisite_files( Generate prerequisite files for a library. Note that the version, if any, in the proto_path will be removed. + :param config: a GenerationConfig object representing a parsed configuration yaml :param library: the library configuration @@ -211,11 +213,12 @@ def generate_prerequisite_files( else f"{library.group_id}:google-{cloud_prefix}{library_name}" ) distribution_name_short = re.split(r"[:/]", distribution_name)[-1] - repo = ( - "googleapis/google-cloud-java" - if config.is_monorepo() - else f"googleapis/{language}-{library_name}" - ) + if config.contains_common_protos(): + repo = SDK_PLATFORM_JAVA + elif config.is_monorepo(): + repo = "googleapis/google-cloud-java" + else: + repo = f"googleapis/{language}-{library_name}" api_id = ( library.api_id if library.api_id else f"{library.api_shortname}.googleapis.com" ) @@ -251,6 +254,11 @@ def generate_prerequisite_files( "requires_billing": library.requires_billing, } + # this removal is for java-common-protos and java-iam in + # sdk-platform-java + if repo == SDK_PLATFORM_JAVA: + repo_metadata.pop("api_id") + if library.api_reference: repo_metadata["api_reference"] = library.api_reference if library.codeowner_team: From 1ade78672798fc9cc5c76e93c8029692b32c5959 Mon Sep 17 00:00:00 2001 From: Alice <65933803+alicejli@users.noreply.github.com> Date: Fri, 17 May 2024 09:30:28 -0400 Subject: [PATCH 23/29] test: use Junit5 in api-common (#2779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2727 ☕️ --- api-common-java/pom.xml | 18 +- .../com/google/api/core/ApiFuturesTest.java | 45 +- .../com/google/api/core/ApiServiceTest.java | 18 +- .../core/ListenableFutureToApiFutureTest.java | 6 +- .../api/core/SettableApiFutureTest.java | 25 +- .../api/pathtemplate/PathTemplateTest.java | 427 ++++++++++-------- .../TemplatedResourceNameTest.java | 9 +- .../UntypedResourceNameTest.java | 25 +- 8 files changed, 315 insertions(+), 258 deletions(-) diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index fe6403145a..5551e0ebed 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -69,9 +69,21 @@ - junit - junit - 4.13.2 + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit.version} test diff --git a/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java b/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java index 34dc41dda2..7019ab17e7 100644 --- a/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java @@ -38,12 +38,12 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ApiFuturesTest { +class ApiFuturesTest { @Test - public void testAddCallback() throws Exception { + void testAddCallback() { final AtomicInteger flag = new AtomicInteger(); SettableApiFuture future = SettableApiFuture.create(); ApiFutures.addCallback( @@ -65,7 +65,7 @@ public void onFailure(Throwable t) { } @Test - public void testCatch() throws Exception { + void testCatch() throws Exception { SettableApiFuture future = SettableApiFuture.create(); ApiFuture fallback = ApiFutures.catching( @@ -83,7 +83,7 @@ public Integer apply(Exception ex) { } @Test - public void testCatchAsync() throws Exception { + void testCatchAsync() throws Exception { SettableApiFuture future = SettableApiFuture.create(); ApiFuture fallback = ApiFutures.catchingAsync( @@ -101,7 +101,7 @@ public ApiFuture apply(Exception ex) { } @Test - public void testTransform() throws Exception { + void testTransform() throws Exception { SettableApiFuture inputFuture = SettableApiFuture.create(); ApiFuture transformedFuture = ApiFutures.transform( @@ -118,7 +118,7 @@ public String apply(Integer input) { } @Test - public void testTransformWithExecutor() throws Exception { + void testTransformWithExecutor() throws Exception { SettableApiFuture inputFuture = SettableApiFuture.create(); final AtomicInteger counter = new AtomicInteger(0); ApiFuture transformedFuture = @@ -143,7 +143,7 @@ public void execute(Runnable command) { } @Test - public void testAllAsList() throws Exception { + void testAllAsList() throws Exception { SettableApiFuture inputFuture1 = SettableApiFuture.create(); SettableApiFuture inputFuture2 = SettableApiFuture.create(); ApiFuture> listFuture = @@ -154,7 +154,7 @@ public void testAllAsList() throws Exception { } @Test - public void successfulAllAsList() throws Exception { + void successfulAllAsList() throws Exception { SettableApiFuture inputFuture1 = SettableApiFuture.create(); SettableApiFuture inputFuture2 = SettableApiFuture.create(); ApiFuture> listFuture = @@ -165,7 +165,7 @@ public void successfulAllAsList() throws Exception { } @Test - public void testTransformAsync() throws Exception { + void testTransformAsync() throws Exception { ApiFuture inputFuture = ApiFutures.immediateFuture(0); ApiFuture outputFuture = ApiFutures.transformAsync( @@ -181,31 +181,24 @@ public ApiFuture apply(Integer input) { } @Test - public void testTransformAsyncWithExecutor() throws Exception { + void testTransformAsyncWithExecutor() throws Exception { ApiFuture inputFuture = ApiFutures.immediateFuture(0); final AtomicInteger counter = new AtomicInteger(0); ApiFuture outputFuture = ApiFutures.transformAsync( inputFuture, - new ApiAsyncFunction() { - @Override - public ApiFuture apply(Integer input) { - return ApiFutures.immediateFuture(input + 1); - } - }, - new Executor() { - @Override - public void execute(Runnable command) { - counter.incrementAndGet(); - command.run(); - } - }); + (ApiAsyncFunction) input -> ApiFutures.immediateFuture(input + 1), + (Executor) + command -> { + counter.incrementAndGet(); + command.run(); + }); assertThat(outputFuture.get()).isEqualTo(1); assertThat(counter.get()).isEqualTo(1); } @Test - public void testImmediateFailedFuture() throws InterruptedException { + void testImmediateFailedFuture() throws InterruptedException { ApiFuture future = ApiFutures.immediateFailedFuture(new IllegalArgumentException("The message")); IllegalArgumentException exception = null; @@ -219,7 +212,7 @@ public void testImmediateFailedFuture() throws InterruptedException { } @Test - public void testImmediateCancelledFuture() throws InterruptedException, ExecutionException { + void testImmediateCancelledFuture() throws InterruptedException, ExecutionException { ApiFuture future = ApiFutures.immediateCancelledFuture(); CancellationException exception = null; try { diff --git a/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java b/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java index 19b10af472..8bbfe489a2 100644 --- a/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java @@ -31,12 +31,12 @@ import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class ApiServiceTest { +class ApiServiceTest { @Test - public void testNoopService() { + void testNoopService() { ApiService service = new AbstractApiService() { @Override @@ -50,12 +50,12 @@ protected void doStart() { } }; service.startAsync().awaitRunning(); - Assert.assertTrue(service.isRunning()); + Assertions.assertTrue(service.isRunning()); service.stopAsync().awaitTerminated(); } @Test - public void testFailingService() { + void testFailingService() { final AtomicReference savedFailure = new AtomicReference<>(); ApiService service = new AbstractApiService() { @@ -86,8 +86,8 @@ public void failed(ApiService.State from, Throwable failure) { // Expected } - Assert.assertEquals(service.state(), ApiService.State.FAILED); - Assert.assertEquals(savedFailure.get().getMessage(), "this service always fails"); - Assert.assertEquals(service.failureCause().getMessage(), "this service always fails"); + Assertions.assertEquals(service.state(), ApiService.State.FAILED); + Assertions.assertEquals(savedFailure.get().getMessage(), "this service always fails"); + Assertions.assertEquals(service.failureCause().getMessage(), "this service always fails"); } } diff --git a/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java b/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java index 9bc06dae07..707f7aae0f 100644 --- a/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java @@ -31,12 +31,12 @@ import com.google.common.truth.Truth; import com.google.common.util.concurrent.SettableFuture; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ListenableFutureToApiFutureTest { +class ListenableFutureToApiFutureTest { @Test - public void testGet() throws Exception { + void testGet() throws Exception { SettableFuture future = SettableFuture.create(); ListenableFutureToApiFuture apiFuture = new ListenableFutureToApiFuture<>(future); future.set(3); diff --git a/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java b/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java index a4cff9b086..0278b0b933 100644 --- a/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java +++ b/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java @@ -34,11 +34,12 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class SettableApiFutureTest { +class SettableApiFutureTest { @Test - public void testSet() throws Exception { + void testSet() throws Exception { SettableApiFuture future = SettableApiFuture.create(); Truth.assertThat(future.isDone()).isFalse(); future.set(42); @@ -48,7 +49,7 @@ public void testSet() throws Exception { } @Test - public void testCancel() throws Exception { + void testCancel() { SettableApiFuture future = SettableApiFuture.create(); Truth.assertThat(future.isDone()).isFalse(); Truth.assertThat(future.isCancelled()).isFalse(); @@ -57,15 +58,19 @@ public void testCancel() throws Exception { Truth.assertThat(future.isCancelled()).isTrue(); } - @Test(expected = ExecutionException.class) - public void testException() throws Exception { - SettableApiFuture future = SettableApiFuture.create(); - future.setException(new Exception()); - future.get(); + @Test + void testException() { + Assertions.assertThrows( + ExecutionException.class, + () -> { + SettableApiFuture future = SettableApiFuture.create(); + future.setException(new Exception()); + future.get(); + }); } @Test - public void testListener() throws Exception { + void testListener() { final AtomicInteger flag = new AtomicInteger(); SettableApiFuture future = SettableApiFuture.create(); future.addListener( diff --git a/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java b/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java index 47747a1159..a51bdff91b 100644 --- a/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java +++ b/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java @@ -32,40 +32,35 @@ import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.stream.Stream; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** Tests for {@link PathTemplate}. */ -@RunWith(JUnit4.class) -public class PathTemplateTest { - - @Rule public ExpectedException thrown = ExpectedException.none(); +class PathTemplateTest { // Match // ===== @Test - public void matchAtomicResourceName() { + void matchAtomicResourceName() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); assertPositionalMatch(template.match("buckets/f/o/objects/bar"), "f", "o", "bar"); } @Test - public void matchTemplateWithUnboundedWildcard() { + void matchTemplateWithUnboundedWildcard() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); assertPositionalMatch(template.match("buckets/foo/objects/bar/baz"), "foo", "bar/baz"); } @Test - public void matchWithForcedHostName() { + void matchWithForcedHostName() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Map match = template.matchFromFullName("somewhere.io/buckets/b/objects/o"); Truth.assertThat(match).isNotNull(); @@ -75,7 +70,7 @@ public void matchWithForcedHostName() { } @Test - public void matchWithHostName() { + void matchWithHostName() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Map match = template.match("//somewhere.io/buckets/b/objects/o"); Truth.assertThat(match).isNotNull(); @@ -85,7 +80,7 @@ public void matchWithHostName() { } @Test - public void matchWithHostNameAndProtocol() { + void matchWithHostNameAndProtocol() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone}"); Map match = template.match( @@ -97,7 +92,7 @@ public void matchWithHostNameAndProtocol() { } @Test - public void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { + void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { PathTemplate template = PathTemplate.create("{project}/zones/{zone}"); Map match = template.match( @@ -109,7 +104,7 @@ public void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { } @Test - public void pathWildcards_matchZeroOrMoreSegments() { + void pathWildcards_matchZeroOrMoreSegments() { PathTemplate start = PathTemplate.create("{glob=**}/b"); PathTemplate middle = PathTemplate.create("a/{glob=**}/b"); PathTemplate end = PathTemplate.create("a/{glob=**}"); @@ -136,7 +131,7 @@ public void pathWildcards_matchZeroOrMoreSegments() { } @Test - public void pathWildcard_canMatchTheEmptyString() { + void pathWildcard_canMatchTheEmptyString() { PathTemplate template = PathTemplate.create("{glob=**}"); Truth.assertThat(template.match("").get("glob")).isEmpty(); @@ -145,7 +140,7 @@ public void pathWildcard_canMatchTheEmptyString() { } @Test - public void matchWithCustomMethod() { + void matchWithCustomMethod() { PathTemplate template = PathTemplate.create("buckets/*/objects/*:custom"); Map match = template.match("buckets/b/objects/o:custom"); Truth.assertThat(match).isNotNull(); @@ -154,31 +149,31 @@ public void matchWithCustomMethod() { } @Test - public void matchFailWhenPathMismatch() { + void matchFailWhenPathMismatch() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/o/objects/bar")).isNull(); } @Test - public void matchFailWhenPathTooShort() { + void matchFailWhenPathTooShort() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/objects")).isNull(); } @Test - public void matchFailWhenPathTooLong() { + void matchFailWhenPathTooLong() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/objects/too/long")).isNull(); } @Test - public void matchWithUnboundInMiddle() { + void matchWithUnboundInMiddle() { PathTemplate template = PathTemplate.create("bar/**/foo/*"); assertPositionalMatch(template.match("bar/foo/foo/foo/bar"), "foo/foo", "bar"); } @Test - public void matchWithNamedBindings() { + void matchWithNamedBindings() { PathTemplate template = PathTemplate.create("projects/*/{instance_id=instances/*}/**"); Map actual = template.match("projects/proj_foo/instances/instance_bar/table/table_baz"); @@ -186,7 +181,7 @@ public void matchWithNamedBindings() { } @Test - public void matchFailWithNamedBindingsWhenPathMismatches() { + void matchFailWithNamedBindingsWhenPathMismatches() { PathTemplate template = PathTemplate.create("projects/*/{instance_id=instances/*}/**"); Map actual = template.match("projects/proj_foo/instances_fail/instance_bar/table/table_baz"); @@ -194,21 +189,21 @@ public void matchFailWithNamedBindingsWhenPathMismatches() { } @Test - public void matchWithNamedBindingsThatHasOnlyWildcard() { + void matchWithNamedBindingsThatHasOnlyWildcard() { PathTemplate template = PathTemplate.create("profiles/{routing_id=*}"); Map actual = template.match("profiles/prof_qux"); Truth.assertThat(actual).containsEntry("routing_id", "prof_qux"); } @Test - public void matchFailWithNamedBindingsThatHasOnlyWildcardWhenPathMismatches() { + void matchFailWithNamedBindingsThatHasOnlyWildcardWhenPathMismatches() { PathTemplate template = PathTemplate.create("profiles/{routing_id=*}"); Map actual = template.match("profiles/prof_qux/fail"); Truth.assertThat(actual).isNull(); } @Test - public void matchWithCustomVerbs() { + void matchWithCustomVerbs() { PathTemplate template = PathTemplate.create("**:foo"); assertPositionalMatch(template.match("a/b/c:foo"), "a/b/c"); } @@ -217,7 +212,7 @@ public void matchWithCustomVerbs() { // ======== @Test - public void complexResourceIdBasicCases() { + void complexResourceIdBasicCases() { // Separate by "~". PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); Map match = @@ -256,7 +251,7 @@ public void complexResourceIdBasicCases() { } @Test - public void complexResourceIdCustomVerb() { + void complexResourceIdCustomVerb() { // Separate by "~". PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}:hello"); Map match = @@ -295,7 +290,7 @@ public void complexResourceIdCustomVerb() { } @Test - public void complexResourceIdEqualsWildcard() { + void complexResourceIdEqualsWildcard() { PathTemplate template = PathTemplate.create("projects/{project=*}/zones/{zone_a=*}~{zone_b=*}"); Map match = template.match("projects/project-123/zones/europe-west3-c~us-east3-a"); @@ -307,21 +302,29 @@ public void complexResourceIdEqualsWildcard() { } @Test - public void complexResourceIdEqualsPathWildcard() { - thrown.expect(ValidationException.class); - PathTemplate template = PathTemplate.create("projects/{project=*}/zones/{zone_a=**}~{zone_b}"); - thrown.expectMessage( + @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2778") + void complexResourceIdEqualsPathWildcard() { + Exception exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project=*}/zones/{zone_a=**}~{zone_b}")); + Assertions.assertEquals( String.format( - "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_a")); - - template = PathTemplate.create("projects/{project=*}/zones/{zone_a}.{zone_b=**}"); - thrown.expectMessage( + "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_a"), + exception.getMessage()); + + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project=*}/zones/{zone_a}.{zone_b=**}")); + Assertions.assertEquals( String.format( - "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_b")); + "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_b"), + exception.getMessage()); } @Test - public void complexResourceIdMissingMatches() { + void complexResourceIdMissingMatches() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); Truth.assertThat(template.match("projects/project-123/zones/europe-west3-c")).isNull(); @@ -337,39 +340,52 @@ public void complexResourceIdMissingMatches() { } @Test - public void complexResourceIdNoSeparator() { - thrown.expect(ValidationException.class); - PathTemplate.create("projects/{project}/zones/{zone_a}{zone_b}"); - thrown.expectMessage( + void complexResourceIdNoSeparator() { + Exception exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project}/zones/{zone_a}{zone_b}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}{zone_b}")); - - PathTemplate.create("projects/{project}/zones/{zone_a}_{zone_b}{zone_c}"); - thrown.expectMessage( + "{zone_a}{zone_b}"), + exception.getMessage()); + + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project}/zones/{zone_a}_{zone_b}{zone_c}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}_{zone_b}{zone_c}")); - } - - @Test - public void complexResourceIdInvalidDelimiter() { - thrown.expect(ValidationException.class); - // Not a comprehensive set of invalid delimiters, please check the class's defined pattern. - List someInvalidDelimiters = - new ArrayList<>(Arrays.asList("|", "!", "@", "a", "1", ",", "{", ")")); - for (String invalidDelimiter : someInvalidDelimiters) { - PathTemplate.create( - String.format("projects/{project=*}/zones/{zone_a}%s{zone_b}", invalidDelimiter)); - thrown.expectMessage( - String.format( - "parse error: invalid complex resource ID delimiter character in '%s'", - String.format("{zone_a}%s{zone_b}", invalidDelimiter))); - } + "{zone_a}_{zone_b}{zone_c}"), + exception.getMessage()); + } + + @Disabled("https://github.com/googleapis/sdk-platform-java/issues/2776") + @ParameterizedTest + @MethodSource("invalidDelimiters") + void complexResourceIdInvalidDelimiter(String invalidDelimiter) { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + String.format( + "projects/{project=*}/zones/{zone_a}%s{zone_b}", invalidDelimiter))); + Assertions.assertEquals( + String.format( + "parse error: invalid complex resource ID delimiter character in '%s'", + String.format("zone_a}%s{zone_b}", invalidDelimiter)), + exception.getMessage()); + } + + static Stream invalidDelimiters() { + return Stream.of("|", "!", "@", "a", "1", ",", "{", ")"); } @Test - public void complexResourceIdMixedSeparators() { + void complexResourceIdMixedSeparators() { // Separate by a mix of delimiters. PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}.{zone_c}-{zone_d}"); @@ -398,7 +414,7 @@ public void complexResourceIdMixedSeparators() { } @Test - public void collectionWildcardMatchingInParent() { + void collectionWildcardMatchingInParent() { PathTemplate template = PathTemplate.create("v1/publishers/-/books/{book}"); Map match = template.match( @@ -411,19 +427,21 @@ public void collectionWildcardMatchingInParent() { } @Test - public void collectionWildcardMatchingInvalid() { - thrown.expect(ValidationException.class); - PathTemplate.create("v1/publishers/{publisher}/books/-"); - } + void collectionWildcardMatchingInvalid() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("v1/publishers/{publisher}/books/-")); + }; @Test - public void complexResourceIdPubSubDeletedTopic() { + void complexResourceIdPubSubDeletedTopic() { PathTemplate template = PathTemplate.create("_deleted-topic_"); Truth.assertThat(template).isNotNull(); } @Test - public void complexResourceIdInParent() { + void complexResourceIdInParent() { // One parent has a complex resource ID. PathTemplate template = PathTemplate.create( @@ -458,7 +476,7 @@ public void complexResourceIdInParent() { } @Test - public void complexResourcePathTemplateVariables() { + void complexResourcePathTemplateVariables() { String pattern = "projects/{foo}_{bar}/zones/{zone_a}-{zone_b}_{zone_c}/machines/{cell1}.{cell2}"; PathTemplate template = PathTemplate.create(pattern); @@ -478,57 +496,77 @@ public void complexResourcePathTemplateVariables() { } @Test - public void complexResourceBasicInvalidIds() { - thrown.expect(ValidationException.class); - PathTemplate.create("projects/*/zones/~{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "~{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}~"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}~")); - - PathTemplate.create("projects/*/zones/.{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", ".{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}."); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}.")); - - PathTemplate.create("projects/*/zones/-{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "-{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}-"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}-")); - - PathTemplate.create("projects/*/zones/_{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_")); - - PathTemplate.create("projects/*/zones/{zone_a}_"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_")); - } - - @Test - public void complexResourceMultipleDelimiters() { - thrown.expect(ValidationException.class); - - PathTemplate.create("projects/*/zones/{zone_a}~.{zone_b}"); - thrown.expectMessage( + void complexResourceBasicInvalidIds() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/~{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "~{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}~")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}~"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/.{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", ".{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}.")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}."), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/-{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "-{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}-")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}-"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/_{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "_{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}_")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_"), + exception.getMessage()); + } + + @Test + void complexResourceMultipleDelimiters() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/*/zones/{zone_a}~.{zone_b}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}~.{zone_b}")); - - PathTemplate.create("projects/*/zones/{zone_a}~{zone_b}..{zone_c}"); - thrown.expectMessage( + "{zone_a}~.{zone_b}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/*/zones/{zone_a}~{zone_b}..{zone_c}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}~{zone_b}..{zone_c}")); - + "{zone_a}~{zone_b}..{zone_c}"), + exception.getMessage()); String pathString = "projects/project_123/zones/lorum~ipsum"; PathTemplate template = PathTemplate.create("projects/*/zones/{zone_.~-a}~{zone_b}"); template.validate(pathString, ""); @@ -543,7 +581,7 @@ public void complexResourceMultipleDelimiters() { // ======== @Test - public void validateSuccess() { + void validateSuccess() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/objects/object"; PathTemplate template = PathTemplate.create(templateString); @@ -552,18 +590,19 @@ public void validateSuccess() { } @Test - public void validateFailure() { - thrown.expect(ValidationException.class); + void validateFailure() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/invalid/object"; - thrown.expectMessage( - String.format("Parameter \"%s\" must be in the form \"%s\"", pathString, templateString)); PathTemplate template = PathTemplate.create(templateString); - template.validate(pathString, ""); + ValidationException exception = + Assertions.assertThrows(ValidationException.class, () -> template.validate(pathString, "")); + Assertions.assertEquals( + String.format(": Parameter \"%s\" must be in the form \"%s\"", pathString, templateString), + exception.getMessage()); } @Test - public void validateMatchSuccess() { + void validateMatchSuccess() { String templateString = "buckets/*/objects/{object_id}"; String pathString = "buckets/bucket/objects/object"; PathTemplate template = PathTemplate.create(templateString); @@ -573,62 +612,65 @@ public void validateMatchSuccess() { } @Test - public void validateMatchFailure() { - thrown.expect(ValidationException.class); + void validateMatchFailure() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/invalid/object"; - thrown.expectMessage( - String.format("Parameter \"%s\" must be in the form \"%s\"", pathString, templateString)); PathTemplate template = PathTemplate.create(templateString); - template.validatedMatch(pathString, ""); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.validatedMatch(pathString, "")); + Assertions.assertEquals( + String.format(": Parameter \"%s\" must be in the form \"%s\"", pathString, templateString), + exception.getMessage()); } // Instantiate // =========== @Test - public void instantiateAtomicResource() { + void instantiateAtomicResource() { PathTemplate template = PathTemplate.create("buckets/*/*/*/objects/*"); String url = template.instantiate("$0", "f", "$1", "o", "$2", "o", "$3", "bar"); Truth.assertThat(url).isEqualTo("buckets/f/o/o/objects/bar"); } @Test - public void instantiateEscapeUnsafeChar() { + void instantiateEscapeUnsafeChar() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Truth.assertThat(template.instantiate("$0", "f/o/o", "$1", "b/a/r")) .isEqualTo("buckets/f%2Fo%2Fo/objects/b%2Fa%2Fr"); } @Test - public void instantiateNotEscapeForUnboundedWildcard() { + void instantiateNotEscapeForUnboundedWildcard() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); Truth.assertThat(template.instantiate("$0", "f/o/o", "$1", "b/a/r")) .isEqualTo("buckets/f%2Fo%2Fo/objects/b/a/r"); } @Test - public void instantiateFailWhenTooFewVariables() { - thrown.expect(ValidationException.class); + void instantiateFailWhenTooFewVariables() { PathTemplate template = PathTemplate.create("buckets/*/*/*/objects/*"); - template.instantiate("$0", "f", "1", "o"); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.instantiate("$0", "f", "1", "o")); } @Test - public void instantiateWithUnboundInMiddle() { + void instantiateWithUnboundInMiddle() { PathTemplate template = PathTemplate.create("bar/**/foo/*"); Truth.assertThat(template.instantiate("$0", "1/2", "$1", "3")).isEqualTo("bar/1/2/foo/3"); } @Test - public void instantiatePartial() { + void instantiatePartial() { PathTemplate template = PathTemplate.create("bar/*/foo/*"); String instance = template.instantiatePartial(ImmutableMap.of("$0", "_1")); Truth.assertThat(instance).isEqualTo("bar/_1/foo/*"); } @Test - public void instantiateWithHostName() { + void instantiateWithHostName() { PathTemplate template = PathTemplate.create("bar/*"); String instance = template.instantiate( @@ -637,43 +679,46 @@ public void instantiateWithHostName() { } @Test - public void instantiateEscapeUnsafeCharNoEncoding() { - thrown.expect(ValidationException.class); - thrown.expectMessage("Invalid character \"/\" in path section \"f/o/o\"."); + void instantiateEscapeUnsafeCharNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("buckets/*/objects/*"); - template.instantiate("$0", "f/o/o", "$1", "b/a/r"); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.instantiate("$0", "f/o/o", "$1", "b/a/r")); + Assertions.assertEquals( + String.format("Invalid character \"/\" in path section \"f/o/o\"."), + exception.getMessage()); } @Test - public void instantiateNotEscapeForUnboundedWildcardNoEncoding() { + void instantiateNotEscapeForUnboundedWildcardNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("buckets/*/objects/**"); Truth.assertThat(template.instantiate("$0", "foo", "$1", "b/a/r")) .isEqualTo("buckets/foo/objects/b/a/r"); } @Test - public void instantiateWithGoogProject() { + void instantiateWithGoogProject() { PathTemplate template = PathTemplate.create("projects/{project}"); String instance = template.instantiate(ImmutableMap.of("project", "google.com:test-proj")); Truth.assertThat(instance).isEqualTo("projects/google.com%3Atest-proj"); } @Test - public void instantiateWithGoogProjectNoEncoding() { + void instantiateWithGoogProjectNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("projects/{project}"); String instance = template.instantiate(ImmutableMap.of("project", "google.com:test-proj")); Truth.assertThat(instance).isEqualTo("projects/google.com:test-proj"); } @Test - public void instantiateWithUnusualCharactersNoEncoding() { + void instantiateWithUnusualCharactersNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("bar/*"); String instance = template.instantiate(ImmutableMap.of("$0", "asdf:;`~,.<>[]!@#$%^&*()")); Truth.assertThat(instance).isEqualTo("bar/asdf:;`~,.<>[]!@#$%^&*()"); } @Test - public void instantiateWithComplexResourceId_basic() { + void instantiateWithComplexResourceId_basic() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); String instance = template.instantiate("project", "a/b/c", "zone_a", "apple", "zone_b", "baseball"); @@ -681,7 +726,7 @@ public void instantiateWithComplexResourceId_basic() { } @Test - public void instantiateWithComplexResourceId_customVerb() { + void instantiateWithComplexResourceId_customVerb() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}:hello"); String instance = template.instantiate("project", "a/b/c", "zone_a", "apple", "zone_b", "baseball"); @@ -693,7 +738,7 @@ public void instantiateWithComplexResourceId_customVerb() { } @Test - public void instantiateWithComplexResourceId_mixedSeparators() { + void instantiateWithComplexResourceId_mixedSeparators() { PathTemplate template = PathTemplate.create( "projects/{project}/zones/{zone_a}~{zone_b}.{zone_c}-{zone_d}~{zone_e}"); @@ -717,7 +762,7 @@ public void instantiateWithComplexResourceId_mixedSeparators() { } @Test - public void instantiateWithComplexResourceId_mixedSeparatorsInParent() { + void instantiateWithComplexResourceId_mixedSeparatorsInParent() { PathTemplate template = PathTemplate.create("projects/{project_a}~{project_b}.{project_c}/zones/{zone_a}~{zone_b}"); String instance = @@ -736,7 +781,7 @@ public void instantiateWithComplexResourceId_mixedSeparatorsInParent() { } @Test - public void instantiateWithCustomVerbs() { + void instantiateWithCustomVerbs() { PathTemplate template = PathTemplate.create("/v1/{name=operations/**}:cancel"); String templateInstance = template.instantiate("name", "operations/3373707"); Truth.assertThat(templateInstance).isEqualTo("v1/operations/3373707:cancel"); @@ -744,7 +789,7 @@ public void instantiateWithCustomVerbs() { } @Test - public void instantiateWithASegmentStartsWithADelimiter() { + void instantiateWithASegmentStartsWithADelimiter() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/.well-known/openid-configuration"); @@ -754,17 +799,20 @@ public void instantiateWithASegmentStartsWithADelimiter() { } @Test - public void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithADelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create( - "v1beta1/{parent=projects/*/locations/*/clusters/*}/.{well}-{known}/openid-configuration"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", ".{well}-{known}")); + void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithADelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + "v1beta1/{parent=projects/*/locations/*/clusters/*}/.{well}-{known}/openid-configuration")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", ".{well}-{known}"), + exception.getMessage()); } @Test - public void - instantiateWithASegmentContainingNoComplexResourceNamesAndStartsWithMultipleDelimiters() { + void instantiateWithASegmentContainingNoComplexResourceNamesAndStartsWithMultipleDelimiters() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/.-~well-known/openid-configuration"); @@ -774,21 +822,25 @@ public void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithAD } @Test - public void instantiateWithASegmentOnlyContainingOneDelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create("v1/publishers/{publisher}/books/."); - thrown.expectMessage(String.format("parse error: invalid begin or end character in '%s'", ".")); + void instantiateWithASegmentOnlyContainingOneDelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("v1/publishers/{publisher}/books/.")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "."), + exception.getMessage()); } @Test - public void instantiateWithASegmentOnlyContainingOneCharacter() { + void instantiateWithASegmentOnlyContainingOneCharacter() { PathTemplate pathTemplate = PathTemplate.create("v1/publishers/{publisher}/books/a"); String pattern = "v1/publishers/o'reilly/books/a"; Truth.assertThat(pathTemplate.matches(pattern)).isTrue(); } @Test - public void instantiateWithASegmentEndsWithADelimiter() { + void instantiateWithASegmentEndsWithADelimiter() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/well-known./openid-configuration"); @@ -798,17 +850,20 @@ public void instantiateWithASegmentEndsWithADelimiter() { } @Test - public void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create( - "v1beta1/{parent=projects/*/locations/*/clusters/*}/{well}-{known}./openid-configuration"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{well}-{known}.")); + void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + "v1beta1/{parent=projects/*/locations/*/clusters/*}/{well}-{known}./openid-configuration")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{well}-{known}."), + exception.getMessage()); } @Test - public void - instantiateWithASegmentContainingNoComplexResourceNamesAndEndsWithMultipleDelimiters() { + void instantiateWithASegmentContainingNoComplexResourceNamesAndEndsWithMultipleDelimiters() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/well-known.-~/openid-configuration"); @@ -821,20 +876,20 @@ public void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADel // ===== @Test - public void testMultiplePathWildcardFailure() { - thrown.expect(IllegalArgumentException.class); - PathTemplate.create("bar/**/{name=foo/**}:verb"); + void testMultiplePathWildcardFailure() { + Assertions.assertThrows( + IllegalArgumentException.class, () -> PathTemplate.create("bar/**/{name=foo/**}:verb")); } @Test - public void testTemplateWithSimpleBinding() { + void testTemplateWithSimpleBinding() { PathTemplate template = PathTemplate.create("/v1/messages/{message_id}"); String url = template.instantiate("message_id", "mymessage"); Truth.assertThat(url).isEqualTo("v1/messages/mymessage"); } @Test - public void testTemplateWithMultipleSimpleBindings() { + void testTemplateWithMultipleSimpleBindings() { PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}"); String url = template.instantiate("shelf", "s1", "book", "b1"); Truth.assertThat(url).isEqualTo("v1/shelves/s1/books/b1"); diff --git a/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java b/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java index bb143932ff..2a7fd6ede4 100644 --- a/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java +++ b/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java @@ -31,19 +31,16 @@ package com.google.api.pathtemplate; import com.google.common.truth.Truth; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; /** * Tests for {@link TemplatedResourceName}. As resource names are mostly a wrapper around path * templates, not much needs to be done here. */ -@RunWith(JUnit4.class) -public class TemplatedResourceNameTest { +class TemplatedResourceNameTest { @Test - public void resourceNameMethods() { + void resourceNameMethods() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); TemplatedResourceName name = TemplatedResourceName.create(template, "buckets/b/objects/1/2"); Truth.assertThat(name.toString()).isEqualTo("buckets/b/objects/1/2"); diff --git a/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java b/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java index c0615da416..6fa28c49eb 100644 --- a/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java +++ b/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java @@ -30,23 +30,21 @@ package com.google.api.resourcenames; import static junit.framework.TestCase.fail; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** Tests for {@link UntypedResourceNameTest}. */ -@RunWith(JUnit4.class) -public class UntypedResourceNameTest { +class UntypedResourceNameTest { private static final String NAME_STRING = "sunshine"; private static final String EMPTY_STRING = ""; @Test - public void testGetFieldValues() { + void testGetFieldValues() { assertTrue(UntypedResourceName.isParsableFrom(NAME_STRING)); UntypedResourceName fooName = UntypedResourceName.parse(NAME_STRING); @@ -58,7 +56,7 @@ public void testGetFieldValues() { } @Test - public void testInsertIntoFieldValuesMap() { + void testInsertIntoFieldValuesMap() { UntypedResourceName fooName = UntypedResourceName.parse(NAME_STRING); Map fieldValuesMap = fooName.getFieldValuesMap(); @@ -82,11 +80,8 @@ public void testInsertIntoFieldValuesMap() { } @Test - public void testNullName() { + void testNullName() { assertFalse(UntypedResourceName.isParsableFrom(null)); - try { - UntypedResourceName fooName = UntypedResourceName.parse(null); - } catch (NullPointerException e) { - } + Assertions.assertThrows(NullPointerException.class, () -> UntypedResourceName.parse(null)); } } From 94ef4f42cfda9300f60acb9e6c14e0ca02109716 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 17 May 2024 17:13:25 +0000 Subject: [PATCH 24/29] chore: Migrate Gapic-Generator-Java to JUnit5 (#2771) Fixes: https://github.com/googleapis/sdk-platform-java/issues/2725 # Scope This *only* modifies the unit tests inside the gapic-generator-java module. It does not modify the generated unit tests output from the generator. JUnit4 is still needed with default scope as it's used to generate the unit tests from the TestComposer: https://github.com/googleapis/sdk-platform-java/blob/96e6626eb2dda867b5d8d81f3ec706b5a995a3c2/gapic-generator-java/pom.xml#L446-L450 # Changes - Change the scope for Unit Tests from public to package-private - Parameterized tests updated to use `@ParameterizedTests` - Import updated to `org.junit.jupiter.api.*` --- gapic-generator-java/pom.xml | 12 + .../engine/JavaCodeGeneratorTest.java | 6 +- .../engine/ast/AnonymousClassExprTest.java | 16 +- .../ast/ArithmeticOperationExprTest.java | 14 +- .../generator/engine/ast/ArrayExprTest.java | 10 +- .../engine/ast/AssignmentExprTest.java | 26 +- .../ast/AssignmentOperationExprTest.java | 250 ++++++++-------- .../generator/engine/ast/CastExprTest.java | 36 +-- .../engine/ast/ClassDefinitionTest.java | 40 +-- .../engine/ast/ConcreteReferenceTest.java | 28 +- .../generator/engine/ast/EnumRefExprTest.java | 10 +- .../engine/ast/ExprStatementTest.java | 24 +- .../engine/ast/ForStatementTest.java | 8 +- .../engine/ast/GeneralForStatementTest.java | 24 +- .../engine/ast/IdentifierNodeTest.java | 12 +- .../generator/engine/ast/IfStatementTest.java | 12 +- .../engine/ast/InstanceofExprTest.java | 10 +- .../engine/ast/JavaDocCommentTest.java | 24 +- .../generator/engine/ast/LambdaExprTest.java | 22 +- .../engine/ast/LogicalOperationExprTest.java | 18 +- .../engine/ast/MethodDefinitionTest.java | 88 +++--- .../engine/ast/MethodInvocationExprTest.java | 16 +- .../engine/ast/NewObjectExprTest.java | 22 +- .../engine/ast/NullObjectValueTest.java | 6 +- .../engine/ast/PrimitiveValueTest.java | 10 +- .../ast/ReferenceConstructorExprTest.java | 16 +- .../generator/engine/ast/ReferenceTest.java | 10 +- .../ast/RelationalOperationExprTest.java | 166 +++++------ .../generator/engine/ast/ReturnExprTest.java | 8 +- .../engine/ast/StringObjectValueTest.java | 16 +- .../engine/ast/SuperObjectValueTest.java | 10 +- .../engine/ast/SynchronizedStatementTest.java | 12 +- .../generator/engine/ast/TernaryExprTest.java | 28 +- .../engine/ast/ThisObjectValueTest.java | 10 +- .../generator/engine/ast/ThrowExprTest.java | 32 +-- .../engine/ast/TryCatchStatementTest.java | 18 +- .../generator/engine/ast/TypeNodeTest.java | 24 +- .../engine/ast/UnaryOperationExprTest.java | 24 +- .../engine/ast/VaporReferenceTest.java | 16 +- .../engine/ast/VariableExprTest.java | 46 +-- .../generator/engine/ast/VariableTest.java | 10 +- .../engine/ast/WhileStatementTest.java | 12 +- .../engine/lexicon/InvalidSymbolTest.java | 6 +- .../generator/engine/lexicon/KeywordTest.java | 18 +- .../generator/engine/lexicon/LiteralTest.java | 18 +- .../engine/lexicon/OperatorTest.java | 6 +- .../engine/lexicon/SeparatorTest.java | 6 +- .../writer/ImportWriterVisitorTest.java | 90 +++--- .../engine/writer/JavaWriterVisitorTest.java | 270 +++++++++--------- .../ClientLibraryPackageInfoComposerTest.java | 6 +- ...lientLibraryReflectConfigComposerTest.java | 20 +- .../gapic/composer/ComposerTest.java | 12 +- ...TransportServiceStubClassComposerTest.java | 26 +- .../BatchingDescriptorComposerTest.java | 14 +- .../common/RetrySettingsComposerTest.java | 26 +- .../DefaultValueComposerTest.java | 66 +++-- ...rviceCallableFactoryClassComposerTest.java | 8 +- .../GrpcServiceStubClassComposerTest.java | 18 +- .../grpc/MockServiceClassComposerTest.java | 35 +-- .../MockServiceImplClassComposerTest.java | 34 +-- .../grpc/ServiceClientClassComposerTest.java | 63 ++-- .../ServiceClientTestClassComposerTest.java | 47 ++- .../ServiceSettingsClassComposerTest.java | 50 ++-- .../grpc/ServiceStubClassComposerTest.java | 46 ++- .../ServiceStubSettingsClassComposerTest.java | 64 ++--- ...rviceCallableFactoryClassComposerTest.java | 8 +- .../GrpcServiceStubClassComposerTest.java | 8 +- ...rviceCallableFactoryClassComposerTest.java | 8 +- ...sonServiceClientTestClassComposerTest.java | 9 +- .../HttpJsonServiceStubClassComposerTest.java | 8 +- .../ServiceClientClassComposerTest.java | 10 +- .../ServiceClientTestClassComposerTest.java | 8 +- .../ServiceSettingsClassComposerTest.java | 8 +- .../ServiceStubSettingsClassComposerTest.java | 35 +-- .../ResourceNameHelperClassComposerTest.java | 28 +- .../ResourceNameTokenizerTest.java | 22 +- ...rviceCallableFactoryClassComposerTest.java | 6 +- .../HttpJsonServiceStubClassComposerTest.java | 34 ++- .../ServiceClientTestClassComposerTest.java | 6 +- .../ServiceSettingsClassComposerTest.java | 6 +- .../ServiceStubSettingsClassComposerTest.java | 41 ++- .../SampleBodyJavaFormatterTest.java | 12 +- .../samplecode/SampleCodeWriterTest.java | 16 +- .../samplecode/SampleComposerTest.java | 14 +- .../samplecode/SampleComposerUtilTest.java | 18 +- ...lientCallableMethodSampleComposerTest.java | 42 +-- ...ServiceClientHeaderSampleComposerTest.java | 30 +- ...ServiceClientMethodSampleComposerTest.java | 16 +- .../SettingsSampleComposerTest.java | 10 +- .../composer/utils/CommentFormatterTest.java | 12 +- .../composer/utils/PackageCheckerTest.java | 8 +- .../api/generator/gapic/model/FieldTest.java | 12 +- .../gapic/model/GapicServiceConfigTest.java | 12 +- .../gapic/model/HttpBindingsTest.java | 32 +-- .../generator/gapic/model/MessageTest.java | 18 +- .../gapic/model/MethodArgumentTest.java | 6 +- .../api/generator/gapic/model/MethodTest.java | 38 ++- .../generator/gapic/model/RegionTagTest.java | 20 +- .../gapic/model/ResourceNameTest.java | 10 +- .../gapic/model/RoutingHeaderParamTest.java | 6 +- .../api/generator/gapic/model/SampleTest.java | 16 +- .../generator/gapic/model/ServiceTest.java | 51 ++-- .../generator/gapic/model/TransportTest.java | 57 ++-- .../BatchingSettingsConfigParserTest.java | 12 +- .../GapicLanguageSettingsParserTest.java | 8 +- .../GapicLroRetrySettingsParserTest.java | 10 +- .../gapic/protoparser/HttpRuleParserTest.java | 19 +- .../MethodSignatureParserTest.java | 12 +- .../gapic/protoparser/ParserTest.java | 64 ++--- .../gapic/protoparser/PatternParserTest.java | 10 +- .../protoparser/PluginArgumentParserTest.java | 44 +-- .../protoparser/ResourceNameParserTest.java | 44 +-- .../ResourceReferenceParserTest.java | 22 +- .../protoparser/RoutingRuleParserTest.java | 20 +- .../protoparser/ServiceConfigParserTest.java | 16 +- .../protoparser/ServiceYamlParserTest.java | 8 +- .../protoparser/SourceCodeInfoParserTest.java | 24 +- .../gapic/protoparser/TypeParserTest.java | 14 +- .../gapic/protowriter/WriterTest.java | 33 ++- .../generator/gapic/utils/JavaStyleTest.java | 26 +- .../utils/ResourceReferenceUtilsTest.java | 16 +- .../api/generator/test/framework/Differ.java | 10 +- .../test/framework/SingleJUnitTestRunner.java | 12 +- .../google/api/generator/util/TrieTest.java | 18 +- 124 files changed, 1598 insertions(+), 1696 deletions(-) diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 750887cb89..a8eff0a3bf 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -476,5 +476,17 @@ 4.12 test + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java index 558952ddf1..f759fec870 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java @@ -60,9 +60,9 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaCodeGeneratorTest { +class JavaCodeGeneratorTest { private static final String GOLDENFILES_DIRECTORY = "src/test/java/com/google/api/generator/engine/goldens/"; @@ -101,7 +101,7 @@ public class JavaCodeGeneratorTest { private static final Variable bookKindVar = createVarFromVaporRef(bookKindRef, "bookKind"); @Test - public void validJavaClass() { + void validJavaClass() { // Create outer class variableDecls. // [code] private static final String serviceName = "LibraryServiceStub"; VariableExpr serviceName = createServiceNameVarExpr(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java index 9fab46d98d..cfdbbfe6f2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java @@ -20,11 +20,11 @@ import com.google.common.base.Function; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AnonymousClassExprTest { +class AnonymousClassExprTest { @Test - public void validAnonymousClass_basic() { + void validAnonymousClass_basic() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); AssignmentExpr assignmentExpr = createAssignmentExpr("foobar", "false", TypeNode.BOOLEAN); @@ -45,7 +45,7 @@ public void validAnonymousClass_basic() { } @Test - public void validAnonymousClass_genericAndVariableExpr() { + void validAnonymousClass_genericAndVariableExpr() { // [Constructing] new Function() ConcreteReference ref = ConcreteReference.builder() @@ -100,14 +100,14 @@ public void validAnonymousClass_genericAndVariableExpr() { } @Test - public void invalidAnonymousClass_primitiveType() { + void invalidAnonymousClass_primitiveType() { assertThrows( IllegalStateException.class, () -> AnonymousClassExpr.builder().setType(TypeNode.INT).build()); } @Test - public void invalidAnonymousClass_staticMethod() { + void invalidAnonymousClass_staticMethod() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); MethodDefinition method = @@ -127,7 +127,7 @@ public void invalidAnonymousClass_staticMethod() { } @Test - public void invalidAnonymousClass_explicitConstructor() { + void invalidAnonymousClass_explicitConstructor() { TypeNode type = TypeNode.withReference(ConcreteReference.withClazz(Runnable.class)); TypeNode returnType = TypeNode.withReference( @@ -143,7 +143,7 @@ public void invalidAnonymousClass_explicitConstructor() { } @Test - public void invalidAnonymousClass_staticVariableExpr() { + void invalidAnonymousClass_staticVariableExpr() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); Variable variable = createVariable("s", TypeNode.STRING); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java index 4505064472..d19a117974 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ArithmeticOperationExprTest { +class ArithmeticOperationExprTest { @Test - public void concatOperator_validBasic() { + void concatOperator_validBasic() { // valid type-checking for x + getSomeString() VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); @@ -34,7 +34,7 @@ public void concatOperator_validBasic() { } @Test - public void concatOperator_validWithNull() { + void concatOperator_validWithNull() { // Type-checking for String variable x and null object value. VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -44,7 +44,7 @@ public void concatOperator_validWithNull() { } @Test - public void concatOperator_validWithReferenceType() { + void concatOperator_validWithReferenceType() { // Type-checking for String variable x, Expr variable y. VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -59,7 +59,7 @@ public void concatOperator_validWithReferenceType() { } @Test - public void concatOperator_invalidVoidType() { + void concatOperator_invalidVoidType() { // throw exception if one of expr is void-type VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -74,7 +74,7 @@ public void concatOperator_invalidVoidType() { } @Test - public void concatString_invalidNonStringType() { + void concatString_invalidNonStringType() { // throw exception for concat usage if none of exprs is String-type VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java index a5f47e27d7..98ab1d876a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java @@ -18,12 +18,12 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.test.utils.TestExprBuilder; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ArrayExprTest { +class ArrayExprTest { @Test - public void validAnonymousArray_sametype() { + void validAnonymousArray_sametype() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) @@ -41,7 +41,7 @@ public void validAnonymousArray_sametype() { } @Test - public void validAnonymousArray_unsetTypeThrows() { + void validAnonymousArray_unsetTypeThrows() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder(); IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> exprBuilder.build()); @@ -49,7 +49,7 @@ public void validAnonymousArray_unsetTypeThrows() { } @Test - public void validAnonymousArray_onlyVariableAndValueExprs() { + void validAnonymousArray_onlyVariableAndValueExprs() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder().setType(TypeNode.createArrayTypeOf(TypeNode.INT)); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java index b40590f231..7e1cc421f7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java @@ -19,11 +19,11 @@ import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AssignmentExprTest { +class AssignmentExprTest { @Test - public void assignMatchingValue() { + void assignMatchingValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -35,7 +35,7 @@ public void assignMatchingValue() { } @Test - public void assignMismatchedValue() { + void assignMismatchedValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -47,7 +47,7 @@ public void assignMismatchedValue() { } @Test - public void assignSubtypeValue() { + void assignSubtypeValue() { Variable variable = Variable.builder() .setName("x") @@ -66,7 +66,7 @@ public void assignSubtypeValue() { } @Test - public void assignMatchingVariable() { + void assignMatchingVariable() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -78,7 +78,7 @@ public void assignMatchingVariable() { } @Test - public void assignNullObjectValue() { + void assignNullObjectValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -90,7 +90,7 @@ public void assignNullObjectValue() { } @Test - public void writeAssignmentExpr_nullObjectValuePrimitiveType() { + void writeAssignmentExpr_nullObjectValuePrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -102,7 +102,7 @@ public void writeAssignmentExpr_nullObjectValuePrimitiveType() { } @Test - public void writeAssignmentExpr_primitiveToBoxedType() { + void writeAssignmentExpr_primitiveToBoxedType() { // [Constructing] `Boolean x = (boolean) true` Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build(); VariableExpr variableExpr = @@ -114,7 +114,7 @@ public void writeAssignmentExpr_primitiveToBoxedType() { } @Test - public void writeAssignmentExpr_boxedToPrimitiveType() { + void writeAssignmentExpr_boxedToPrimitiveType() { // [Constructing] `double x = (Double) y` Variable lVariable = Variable.builder().setName("x").setType(TypeNode.DOUBLE).build(); VariableExpr lVariableExpr = @@ -126,7 +126,7 @@ public void writeAssignmentExpr_boxedToPrimitiveType() { } @Test - public void writeAssignmentExpr_invalidBoxedPrimitiveType() { + void writeAssignmentExpr_invalidBoxedPrimitiveType() { // [Constructing] `double x = (Integer) y` Variable lVariable = Variable.builder().setName("x").setType(TypeNode.DOUBLE).build(); VariableExpr lVariableExpr = @@ -138,7 +138,7 @@ public void writeAssignmentExpr_invalidBoxedPrimitiveType() { } @Test - public void writeAssignmentExpr_validIsDeclFinalVariableExpr() { + void writeAssignmentExpr_validIsDeclFinalVariableExpr() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lVariableExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).setIsFinal(true).build(); @@ -149,7 +149,7 @@ public void writeAssignmentExpr_validIsDeclFinalVariableExpr() { } @Test - public void writeAssignmentExpr_invalidIsNotDeclFinalVariableExpr() { + void writeAssignmentExpr_invalidIsNotDeclFinalVariableExpr() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lVariableExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(false).setIsFinal(true).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java index 64a6077706..36216e40a6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AssignmentOperationExprTest { +class AssignmentOperationExprTest { /** ========= Multiply And Assignment Operators: VariableExpr is numeric types ============== */ @Test - public void validMultiplyAndAssignmentOperationExpr_numericMatched() { + void validMultiplyAndAssignmentOperationExpr_numericMatched() { // No need swap test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -30,7 +30,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericMatched() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { + void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { // No need swap test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -39,7 +39,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -48,7 +48,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -57,7 +57,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { + void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -66,7 +66,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -75,7 +75,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -84,7 +84,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -93,7 +93,7 @@ public void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -102,7 +102,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -111,7 +111,7 @@ public void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -121,7 +121,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -131,7 +131,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -141,7 +141,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { + void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { // No Need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -152,7 +152,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { /** ==== Multiply And Assignment Operators: LHS data type is boolean and its boxed type ===== */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -162,7 +162,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -174,7 +174,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericTyp /** ======== Multiply And Assignment Operators: LHS data type is Integer Box Type ============ */ // RHS should be int, char, short, byte or these types' boxed types. @Test - public void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -183,7 +183,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT, "y"); @@ -192,7 +192,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "y"); @@ -201,7 +201,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedTy } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "y"); @@ -210,7 +210,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBox } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -219,7 +219,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -229,7 +229,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -239,7 +239,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxed } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -249,7 +249,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -259,7 +259,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxe } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG, "y"); @@ -269,7 +269,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -281,7 +281,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedT /** ==== Multiply And Assignment Operators: LHS data type is Float boxed type ====== */ // RHS could be numeric or numeric boxed type, beside double and its boxed type. @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -290,7 +290,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -299,7 +299,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedTy } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "y"); @@ -308,7 +308,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -317,7 +317,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -326,7 +326,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -336,7 +336,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -346,7 +346,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -356,7 +356,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -368,7 +368,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceTyp /** ==== Multiply And Assignment Operators: LHS data type is Short/Char/Byte Boxed Type ====== */ // RHS has no valid type. @Test - public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -378,7 +378,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedT } @Test - public void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType() { // Swap test case in // "validMultiplyAndAssignmentOperationExpr_validCharacterBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "x"); @@ -389,7 +389,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxed } @Test - public void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBoxedType() { // Swap test case in // "validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); @@ -400,7 +400,7 @@ public void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBox } @Test - public void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -410,7 +410,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -422,7 +422,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedTyp /** ======== Multiply And Assignment Operators: LHS data type is Double Boxed Type ============ */ // RHS could be any numeric type or numeric boxed type. @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { // Swap test case in // "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); @@ -432,7 +432,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedT } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -441,7 +441,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedTyp } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -450,7 +450,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); ValueExpr valueExpr = ValueExpr.withValue(StringObjectValue.withValue("abc")); @@ -460,7 +460,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceTy } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); ValueExpr valueExprExpr = ValueExpr.createNullExpr(); @@ -470,7 +470,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType() { // No need swap test. VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -481,7 +481,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType( /** ======== Multiply And Assignment Operators: LHS data type is Long boxed type ============ */ @Test - public void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -490,7 +490,7 @@ public void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -500,7 +500,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -510,7 +510,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -520,7 +520,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedTy } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -530,7 +530,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_nullWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -540,7 +540,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -550,7 +550,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -561,7 +561,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType /** ======== Multiply And Assignment Operators: LHS data type is Reference Type ============ */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -571,7 +571,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -581,7 +581,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -591,7 +591,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -602,7 +602,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedTy /** =========== Multiply And Assignment Operators: Variable is declaration ================ */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -612,7 +612,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr rhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -622,7 +622,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIsDecl() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).build(); Variable rVariable = Variable.builder().setName("y").setType(TypeNode.INT).build(); @@ -634,7 +634,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIs /** ======================= Multiply And Assignment Operators: Void type ===================== */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_voidType() { + void invalidMultiplyAndAssignmentOperationExpr_voidType() { // No need swap case. VariableExpr lhsExprExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); MethodInvocationExpr rhsExpr = @@ -646,7 +646,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_voidType() { /** =================== XOR Assignment Operators: boolean type ======================= */ @Test - public void validXorAssignmentOperationExpr_booleanType() { + void validXorAssignmentOperationExpr_booleanType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -655,7 +655,7 @@ public void validXorAssignmentOperationExpr_booleanType() { } @Test - public void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { + void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { // Swap case in "validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -664,7 +664,7 @@ public void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { } @Test - public void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { + void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { // Swap case in "validXorAssignmentOperationExpr_booleanWithBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -673,7 +673,7 @@ public void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { } @Test - public void validXorAssignmentOperationExpr_booleanBoxedType() { + void validXorAssignmentOperationExpr_booleanBoxedType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -682,7 +682,7 @@ public void validXorAssignmentOperationExpr_booleanBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -692,7 +692,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { + void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -702,7 +702,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { + void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -712,7 +712,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { // No valid swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -722,7 +722,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { // No valid swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -733,7 +733,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { /** ======= XOR Assignment Operators: LHS is non-floating-point numeric types ========= */ @Test - public void validXorAssignmentOperationExpr_integerWithCharType() { + void validXorAssignmentOperationExpr_integerWithCharType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -742,7 +742,7 @@ public void validXorAssignmentOperationExpr_integerWithCharType() { } @Test - public void validXorAssignmentOperationExpr_integerWithIntegerType() { + void validXorAssignmentOperationExpr_integerWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -751,7 +751,7 @@ public void validXorAssignmentOperationExpr_integerWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_integerWithByteType() { + void validXorAssignmentOperationExpr_integerWithByteType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE, "y"); @@ -760,7 +760,7 @@ public void validXorAssignmentOperationExpr_integerWithByteType() { } @Test - public void validXorAssignmentOperationExpr_integerWithShortType() { + void validXorAssignmentOperationExpr_integerWithShortType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT, "y"); @@ -769,7 +769,7 @@ public void validXorAssignmentOperationExpr_integerWithShortType() { } @Test - public void validXorAssignmentOperationExpr_integerWithLongType() { + void validXorAssignmentOperationExpr_integerWithLongType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG, "y"); @@ -778,7 +778,7 @@ public void validXorAssignmentOperationExpr_integerWithLongType() { } @Test - public void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { + void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithByteType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -787,7 +787,7 @@ public void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { } @Test - public void validXorAssignmentOperationExpr_charWithIntegerType() { + void validXorAssignmentOperationExpr_charWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -796,7 +796,7 @@ public void validXorAssignmentOperationExpr_charWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_shortWithIntegerType() { + void validXorAssignmentOperationExpr_shortWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -805,7 +805,7 @@ public void validXorAssignmentOperationExpr_shortWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_longWithIntegerType() { + void validXorAssignmentOperationExpr_longWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -814,7 +814,7 @@ public void validXorAssignmentOperationExpr_longWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { + void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -823,7 +823,7 @@ public void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { } @Test - public void validXorAssignmentOperationExpr_longWithByteBoxedType() { + void validXorAssignmentOperationExpr_longWithByteBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -832,7 +832,7 @@ public void validXorAssignmentOperationExpr_longWithByteBoxedType() { } @Test - public void validXorAssignmentOperationExpr_integerWithLongBoxedType() { + void validXorAssignmentOperationExpr_integerWithLongBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -841,7 +841,7 @@ public void validXorAssignmentOperationExpr_integerWithLongBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { + void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { // Swap case in "invalidXorAssignmentOperationExpr_doubleWithIntegerTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -851,7 +851,7 @@ public void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { + void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -861,7 +861,7 @@ public void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_charWithFloatTypes() { + void invalidXorAssignmentOperationExpr_charWithFloatTypes() { // Swap case in "invalidXorAssignmentOperationExpr_floatWithCharTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -871,7 +871,7 @@ public void invalidXorAssignmentOperationExpr_charWithFloatTypes() { } @Test - public void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { + void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_floatBoxedWithCharTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -881,7 +881,7 @@ public void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithNumericTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -891,7 +891,7 @@ public void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithNullTypes() { + void invalidXorAssignmentOperationExpr_integerWithNullTypes() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -901,7 +901,7 @@ public void invalidXorAssignmentOperationExpr_integerWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { + void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { // Swap case in invalidXorAssignmentOperationExpr_referenceWithCharTypes. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -912,7 +912,7 @@ public void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { /** ============= XOR Assignment Operators: LHS is integer boxed type ================= */ @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { // Swap case in "validXorAssignmentOperationExpr_charWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -921,7 +921,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { // Swap case in validXorAssignmentOperationExpr_charWithIntegerBoxedType. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -930,7 +930,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { // Swap case in "validXorAssignmentOperationExpr_byteWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE, "y"); @@ -939,7 +939,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -948,7 +948,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "y"); @@ -957,7 +957,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { // Swap case in "invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -967,7 +967,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -977,7 +977,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { // Swap case in "invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -987,7 +987,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -998,7 +998,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedTyp /** =========== XOR Assignment Operators: LHS is floating-point type =============== */ @Test - public void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1008,7 +1008,7 @@ public void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1018,7 +1018,7 @@ public void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1028,7 +1028,7 @@ public void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1038,7 +1038,7 @@ public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() } @Test - public void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { + void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithDoubleTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1048,7 +1048,7 @@ public void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { } @Test - public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { + void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1058,7 +1058,7 @@ public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { } @Test - public void invalidXorAssignmentOperationExpr_floatWithCharTypes() { + void invalidXorAssignmentOperationExpr_floatWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_charWithFloatTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1068,7 +1068,7 @@ public void invalidXorAssignmentOperationExpr_floatWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { + void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1078,7 +1078,7 @@ public void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -1088,7 +1088,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -1098,7 +1098,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { // Swap case in invalidXorAssignmentOperationExpr_referenceWithIntegerBoxedTypes. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -1108,7 +1108,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { // No swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -1119,7 +1119,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { /** ======= XOR Assignment Operators: LHS is non integer numeric boxed type =========== */ @Test - public void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1129,7 +1129,7 @@ public void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType( } @Test - public void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1139,7 +1139,7 @@ public void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType } @Test - public void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { + void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { // No swap case need. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1149,7 +1149,7 @@ public void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { } @Test - public void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { + void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { // No swap case need. VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1160,7 +1160,7 @@ public void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { /** ============= XOR Assignment Operators: LHS is non primitive type ================= */ @Test - public void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithReferencedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -1170,7 +1170,7 @@ public void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { } @Test - public void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { + void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithReferencedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1180,7 +1180,7 @@ public void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_referenceWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1190,7 +1190,7 @@ public void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType( } @Test - public void invalidXorAssignmentOperationExpr_voidType() { + void invalidXorAssignmentOperationExpr_voidType() { // No need swap case. VariableExpr lhsExprExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); MethodInvocationExpr rhsExpr = @@ -1202,7 +1202,7 @@ public void invalidXorAssignmentOperationExpr_voidType() { /** =========== XOR Assignment Operators: Variable is declaration ================ */ @Test - public void invalidXorAssignmentOperationExpr_variableExprIsDecl() { + void invalidXorAssignmentOperationExpr_variableExprIsDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1212,7 +1212,7 @@ public void invalidXorAssignmentOperationExpr_variableExprIsDecl() { } @Test - public void invalidXorAssignmentOperationExpr_valueExprIsDecl() { + void invalidXorAssignmentOperationExpr_valueExprIsDecl() { VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr rhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1222,7 +1222,7 @@ public void invalidXorAssignmentOperationExpr_valueExprIsDecl() { } @Test - public void invalidXorAssignmentOperationExpr_variableExprAndValueExprIsDecl() { + void invalidXorAssignmentOperationExpr_variableExprAndValueExprIsDecl() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).build(); Variable rVariable = Variable.builder().setName("y").setType(TypeNode.INT).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java index 04bb8a05ca..4d79d3c7ac 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CastExprTest { +class CastExprTest { @Test - public void validCastExpr_basic() { + void validCastExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder() @@ -31,7 +31,7 @@ public void validCastExpr_basic() { } @Test - public void validCastExpr_basicNull() { + void validCastExpr_basicNull() { CastExpr.builder() .setType(TypeNode.withReference(ConcreteReference.withClazz(Object.class))) .setExpr(ValueExpr.createNullExpr()) @@ -40,7 +40,7 @@ public void validCastExpr_basicNull() { } @Test - public void validCastExpr_basicPrimitiveSame() { + void validCastExpr_basicPrimitiveSame() { Variable variable = Variable.builder().setName("x").setType(TypeNode.LONG).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.LONG).setExpr(variableExpr).build(); @@ -48,7 +48,7 @@ public void validCastExpr_basicPrimitiveSame() { } @Test - public void validCastExpr_basicPrimitiveBoolean() { + void validCastExpr_basicPrimitiveBoolean() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.BOOLEAN).setExpr(variableExpr).build(); @@ -56,7 +56,7 @@ public void validCastExpr_basicPrimitiveBoolean() { } @Test - public void validCastExpr_basicPrimitiveNarrowing() { + void validCastExpr_basicPrimitiveNarrowing() { Variable variable = Variable.builder().setName("x").setType(TypeNode.LONG).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.INT).setExpr(variableExpr).build(); @@ -70,7 +70,7 @@ public void validCastExpr_basicPrimitiveNarrowing() { } @Test - public void validCastExpr_basicPrimitiveWidening() { + void validCastExpr_basicPrimitiveWidening() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.LONG).setExpr(variableExpr).build(); @@ -83,21 +83,21 @@ public void validCastExpr_basicPrimitiveWidening() { } @Test - public void validCastExpr_castPrimitiveToBoxedType() { + void validCastExpr_castPrimitiveToBoxedType() { PrimitiveValue intValue = PrimitiveValue.builder().setValue("3").setType(TypeNode.INT).build(); ValueExpr valueExpr = ValueExpr.withValue(intValue); CastExpr.builder().setType(TypeNode.INT_OBJECT).setExpr(valueExpr).build(); } @Test - public void validCastExpr_castBoxedTypeToPrimitive() { + void validCastExpr_castBoxedTypeToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.DOUBLE_OBJECT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.DOUBLE).setExpr(variableExpr).build(); } @Test - public void validCastExpr_booleanToBoxedType() { + void validCastExpr_booleanToBoxedType() { PrimitiveValue booleanValue = PrimitiveValue.builder().setValue("true").setType(TypeNode.BOOLEAN).build(); ValueExpr valueExpr = ValueExpr.withValue(booleanValue); @@ -105,14 +105,14 @@ public void validCastExpr_booleanToBoxedType() { } @Test - public void validCastExpr_castBooleanToPrimitive() { + void validCastExpr_castBooleanToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.BOOLEAN).setExpr(variableExpr).build(); } @Test - public void invalidCastExpr_castBoxedPrimitiveArray() { + void invalidCastExpr_castBoxedPrimitiveArray() { TypeNode intArray = TypeNode.builder().setTypeKind(TypeNode.TypeKind.INT).setIsArray(true).build(); TypeNode integerArray = @@ -129,7 +129,7 @@ public void invalidCastExpr_castBoxedPrimitiveArray() { } @Test - public void invalidCastExpr_castObjectToPrimitive() { + void invalidCastExpr_castObjectToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -138,7 +138,7 @@ public void invalidCastExpr_castObjectToPrimitive() { } @Test - public void invalidCastExpr_castPrimitiveToObject() { + void invalidCastExpr_castPrimitiveToObject() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -151,7 +151,7 @@ public void invalidCastExpr_castPrimitiveToObject() { } @Test - public void invalidCastExpr_castBooleanToNumeric() { + void invalidCastExpr_castBooleanToNumeric() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -160,7 +160,7 @@ public void invalidCastExpr_castBooleanToNumeric() { } @Test - public void invalidCastExpr_castNumericToBoolean() { + void invalidCastExpr_castNumericToBoolean() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -169,7 +169,7 @@ public void invalidCastExpr_castNumericToBoolean() { } @Test - public void invalidCastExpr_castToVoidType() { + void invalidCastExpr_castToVoidType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java index d08ad60225..9b7015862d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java @@ -18,12 +18,12 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ClassDefinitionTest { +class ClassDefinitionTest { @Test - public void validClassDefinition_basicWithCommentsAndHeader() { + void validClassDefinition_basicWithCommentsAndHeader() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND CLASS"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -45,7 +45,7 @@ public void validClassDefinition_basicWithCommentsAndHeader() { } @Test - public void validClassDefinition_exprCommentAndBlockStatements() { + void validClassDefinition_exprCommentAndBlockStatements() { ClassDefinition.builder() .setName("LibraryServiceStub") .setIsNested(true) @@ -74,7 +74,7 @@ public void validClassDefinition_exprCommentAndBlockStatements() { } @Test - public void validClassDefinition_nestedBasic() { + void validClassDefinition_nestedBasic() { ClassDefinition.builder() .setName("LibraryServiceStub") .setIsNested(true) @@ -92,7 +92,7 @@ public void validClassDefinition_nestedBasic() { } @Test - public void validClassDefinition_withAnnotationsExtendsAndImplements() { + void validClassDefinition_withAnnotationsExtendsAndImplements() { ClassDefinition.builder() .setPackageString("com.google.example.library.v1.stub") .setName("LibraryServiceStub") @@ -110,7 +110,7 @@ public void validClassDefinition_withAnnotationsExtendsAndImplements() { } @Test - public void validClassDefinition_statementsAndMethods() { + void validClassDefinition_statementsAndMethods() { List statements = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr()), @@ -149,7 +149,7 @@ public void validClassDefinition_statementsAndMethods() { } @Test - public void invalidClassDefinition_nestedWithFileHeader() { + void invalidClassDefinition_nestedWithFileHeader() { assertThrows( IllegalStateException.class, () -> { @@ -164,7 +164,7 @@ public void invalidClassDefinition_nestedWithFileHeader() { } @Test - public void invalidClassDefinition_implementsNullType() { + void invalidClassDefinition_implementsNullType() { assertThrows( IllegalStateException.class, () -> { @@ -178,7 +178,7 @@ public void invalidClassDefinition_implementsNullType() { } @Test - public void invalidClassDefinition_outerClassMissingPackage() { + void invalidClassDefinition_outerClassMissingPackage() { assertThrows( NullPointerException.class, () -> { @@ -190,7 +190,7 @@ public void invalidClassDefinition_outerClassMissingPackage() { } @Test - public void invalidClassDefinition_outerClassStatic() { + void invalidClassDefinition_outerClassStatic() { assertThrows( IllegalStateException.class, () -> { @@ -204,7 +204,7 @@ public void invalidClassDefinition_outerClassStatic() { } @Test - public void invalidClassDefinition_outerClassPrivate() { + void invalidClassDefinition_outerClassPrivate() { assertThrows( IllegalStateException.class, () -> { @@ -217,7 +217,7 @@ public void invalidClassDefinition_outerClassPrivate() { } @Test - public void invalidClassDefinition_extendsPrimitiveType() { + void invalidClassDefinition_extendsPrimitiveType() { assertThrows( IllegalStateException.class, () -> { @@ -231,7 +231,7 @@ public void invalidClassDefinition_extendsPrimitiveType() { } @Test - public void invalidClassDefinition_extendsNullType() { + void invalidClassDefinition_extendsNullType() { assertThrows( IllegalStateException.class, () -> { @@ -245,7 +245,7 @@ public void invalidClassDefinition_extendsNullType() { } @Test - public void invalidClassDefinition_abstractFinal() { + void invalidClassDefinition_abstractFinal() { assertThrows( IllegalStateException.class, () -> { @@ -261,7 +261,7 @@ public void invalidClassDefinition_abstractFinal() { } @Test - public void invalidClassDefinition_implementsPrimtiveType() { + void invalidClassDefinition_implementsPrimtiveType() { assertThrows( IllegalStateException.class, () -> { @@ -275,7 +275,7 @@ public void invalidClassDefinition_implementsPrimtiveType() { } @Test - public void invalidClassDefinition_extendsImplementsSameType() { + void invalidClassDefinition_extendsImplementsSameType() { TypeNode cloneableType = TypeNode.withReference(ConcreteReference.withClazz(Cloneable.class)); assertThrows( IllegalStateException.class, @@ -294,7 +294,7 @@ public void invalidClassDefinition_extendsImplementsSameType() { } @Test - public void invalidClassDefinition_assignmentWithUnscopedVariableExprStatement() { + void invalidClassDefinition_assignmentWithUnscopedVariableExprStatement() { Variable variable = createVariable("x", TypeNode.INT); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -319,7 +319,7 @@ public void invalidClassDefinition_assignmentWithUnscopedVariableExprStatement() } @Test - public void invalidClassDefinition_unscopedVariableExprStatement() { + void invalidClassDefinition_unscopedVariableExprStatement() { List statements = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr()), @@ -341,7 +341,7 @@ public void invalidClassDefinition_unscopedVariableExprStatement() { } @Test - public void invalidClassDefinition_badStatementType() { + void invalidClassDefinition_badStatementType() { List statements = Arrays.asList(createForStatement()); assertThrows( IllegalStateException.class, diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java index 6fdc65a937..f0786fbe3c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java @@ -23,18 +23,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ConcreteReferenceTest { +class ConcreteReferenceTest { @Test - public void basicConcreteReference() { + void basicConcreteReference() { Reference reference = ConcreteReference.builder().setClazz(Integer.class).build(); assertEquals(Integer.class.getSimpleName(), reference.name()); assertFalse(reference.isStaticImport()); } @Test - public void basicConcreteReference_setIsStaticImport() { + void basicConcreteReference_setIsStaticImport() { Reference reference = ConcreteReference.builder().setClazz(Integer.class).setIsStaticImport(true).build(); assertEquals(Integer.class.getSimpleName(), reference.name()); @@ -42,14 +42,14 @@ public void basicConcreteReference_setIsStaticImport() { } @Test - public void basicConcreteReference_nested() { + void basicConcreteReference_nested() { Reference reference = ConcreteReference.builder().setClazz(Map.Entry.class).build(); assertEquals("Map.Entry", reference.name()); assertFalse(reference.isStaticImport()); } @Test - public void basicConcreteReference_nestedAndStaticImport() { + void basicConcreteReference_nestedAndStaticImport() { Reference reference = ConcreteReference.builder().setClazz(Map.Entry.class).setIsStaticImport(true).build(); assertEquals(Map.Entry.class.getSimpleName(), reference.name()); @@ -57,7 +57,7 @@ public void basicConcreteReference_nestedAndStaticImport() { } @Test - public void parameterizedConcreteReference() { + void parameterizedConcreteReference() { Reference reference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -71,7 +71,7 @@ public void parameterizedConcreteReference() { } @Test - public void nestedParameterizedConcreteReference() { + void nestedParameterizedConcreteReference() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -96,7 +96,7 @@ public void nestedParameterizedConcreteReference() { } @Test - public void isSupertype_basic() { + void isSupertype_basic() { assertTrue(TypeNode.STRING.isSupertypeOrEquals(TypeNode.STRING)); assertFalse(TypeNode.INT.isSupertypeOrEquals(TypeNode.STRING)); assertFalse(TypeNode.STRING.isSupertypeOrEquals(TypeNode.INT)); @@ -109,7 +109,7 @@ public void isSupertype_basic() { } @Test - public void isSupertype_nestedGenerics() { + void isSupertype_nestedGenerics() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode typeOne = TypeNode.withReference( @@ -142,7 +142,7 @@ public void isSupertype_nestedGenerics() { } @Test - public void wildcards() { + void wildcards() { assertEquals(ConcreteReference.wildcard().name(), "?"); assertEquals( "? extends String", @@ -150,7 +150,7 @@ public void wildcards() { } @Test - public void isAssignableFrom_concreteRef() { + void isAssignableFrom_concreteRef() { assertFalse( ConcreteReference.withClazz(List.class) .isAssignableFrom(ConcreteReference.withClazz(Map.class))); @@ -195,7 +195,7 @@ public void isAssignableFrom_concreteRef() { } @Test - public void isAssignableFrom_vaporRef() { + void isAssignableFrom_vaporRef() { assertFalse( ConcreteReference.withClazz(List.class) .isAssignableFrom( @@ -207,7 +207,7 @@ public void isAssignableFrom_vaporRef() { } @Test - public void isAssignableFrom_vaporRefWithConcreteRefSupertype() { + void isAssignableFrom_vaporRefWithConcreteRefSupertype() { assertTrue( ConcreteReference.withClazz(List.class) .isAssignableFrom( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java index 436f00a536..6cc79fe697 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java @@ -16,25 +16,25 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class EnumRefExprTest { +class EnumRefExprTest { @Test - public void validEnumRefExpr_basic() { + void validEnumRefExpr_basic() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr.builder().setName("VOID").setType(enumType).build(); } @Test - public void invalidEnumRefExpr_primitiveType() { + void invalidEnumRefExpr_primitiveType() { assertThrows( IllegalStateException.class, () -> EnumRefExpr.builder().setName("VOID").setType(TypeNode.INT).build()); } @Test - public void invalidEnumRefExpr_nullType() { + void invalidEnumRefExpr_nullType() { assertThrows( IllegalStateException.class, () -> EnumRefExpr.builder().setName("VOID").setType(TypeNode.NULL).build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java index d97a3ddce3..b87711d645 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java @@ -17,12 +17,12 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ExprStatementTest { +class ExprStatementTest { @Test - public void validExprStatement_method() { + void validExprStatement_method() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -39,13 +39,13 @@ public void validExprStatement_method() { } @Test - public void validExprStatement_variable() { + void validExprStatement_variable() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); assertValidExprStatement(VariableExpr.builder().setVariable(variable).setIsDecl(true).build()); } @Test - public void validExprStatement_assignment() { + void validExprStatement_assignment() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -59,20 +59,20 @@ public void validExprStatement_assignment() { } @Test - public void validExprStatement_throw() { + void validExprStatement_throw() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); assertValidExprStatement(ThrowExpr.builder().setType(npeType).build()); } @Test - public void validExprStatement_return() { + void validExprStatement_return() { assertValidExprStatement( ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf")))); } @Test - public void validExprStatement_unaryOperation() { + void validExprStatement_unaryOperation() { assertValidExprStatement( UnaryOperationExpr.postfixIncrementWithExpr( VariableExpr.withVariable( @@ -80,7 +80,7 @@ public void validExprStatement_unaryOperation() { } @Test - public void validExprStatement_assignmentOperationExpr() { + void validExprStatement_assignmentOperationExpr() { VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setName("i").setType(TypeNode.INT).build()); ValueExpr rhsExpr = @@ -89,21 +89,21 @@ public void validExprStatement_assignmentOperationExpr() { } @Test - public void invalidExprStatement_variable() { + void invalidExprStatement_variable() { Variable variable = Variable.builder().setType(TypeNode.INT).setName("libraryClient").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); assertInvalidExprStatement(varExpr); } @Test - public void invalidExprStatement_value() { + void invalidExprStatement_value() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); assertInvalidExprStatement(valueExpr); } @Test - public void invalidExprStatement_logicalNotUnaryOperator() { + void invalidExprStatement_logicalNotUnaryOperator() { Expr logicalNotExpr = UnaryOperationExpr.logicalNotWithExpr( VariableExpr.withVariable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java index 569eebb3c0..5d44157e73 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java @@ -18,12 +18,12 @@ import static org.junit.Assert.assertThrows; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ForStatementTest { +class ForStatementTest { @Test - public void validForStatement() { + void validForStatement() { Variable variable = Variable.builder().setName("str").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -41,7 +41,7 @@ public void validForStatement() { } @Test - public void invalidForStatement() { + void invalidForStatement() { Variable variable = Variable.builder().setName("str").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java index 4d14429c1a..9b9d3af6ae 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GeneralForStatementTest { +class GeneralForStatementTest { /** ============================== incrementWith ====================================== */ @Test // validGeneralForStatement_basicIsDecl tests declare a variable inside in initialization expr. - public void validGeneralForStatement_basicIsDecl() { + void validGeneralForStatement_basicIsDecl() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -41,7 +41,7 @@ public void validGeneralForStatement_basicIsDecl() { @Test // validGeneralForStatement_basicIsNotDecl tests assigning a method-level local variable in // initialization expr. - public void validGeneralForStatement_basicIsNotDecl() { + void validGeneralForStatement_basicIsNotDecl() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(false).build(); @@ -57,7 +57,7 @@ public void validGeneralForStatement_basicIsNotDecl() { @Test // validGeneralForStatement_emptyBody tests set empty body in update expr. - public void validGeneralForStatement_emptyBody() { + void validGeneralForStatement_emptyBody() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(false).build(); @@ -74,7 +74,7 @@ public void validGeneralForStatement_emptyBody() { @Test // validForStatement_privateNotIsDeclVariable tests assigning an instance variable with private // scope. - public void validForStatement_privateNotIsDeclVariable() { + void validForStatement_privateNotIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -91,9 +91,9 @@ public void validForStatement_privateNotIsDeclVariable() { } @Test - // validForStatement_instanceStaticVariable tests assigning an instance variable with public scope + // validForStatement_instanceStaticVariable tests assigning an instance variable with scope // and static modifier. - public void validForStatement_instanceStaticVariable() { + void validForStatement_instanceStaticVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -113,7 +113,7 @@ public void validForStatement_instanceStaticVariable() { @Test // invalidForStatement_privateIsDeclVariable tests declaring a non-local variable inside of // for-loop. - public void invalidForStatement_privateIsDeclVariable() { + void invalidForStatement_privateIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -136,7 +136,7 @@ public void invalidForStatement_privateIsDeclVariable() { @Test // invalidForStatement_staticIsDeclVariable tests declare a static local variable in // initialization expr. - public void invalidForStatement_staticIsDeclVariable() { + void invalidForStatement_staticIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).setIsStatic(true).build(); @@ -155,7 +155,7 @@ public void invalidForStatement_staticIsDeclVariable() { @Test // invalidForStatement_finalIsNotDeclVariable tests invalid case of assigning the initial value to // a variable which is declared as a final instance variable. - public void invalidForStatement_finalIsNotDeclVariable() { + void invalidForStatement_finalIsNotDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -179,7 +179,7 @@ public void invalidForStatement_finalIsNotDeclVariable() { @Test // invalidForStatement_localFinalVariable tests declare a final variable in initialization expr, // updateExpr should throw error. - public void invalidForStatement_localFinalVariable() { + void invalidForStatement_localFinalVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).setIsFinal(true).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java index ead7d8be37..d0df3bd62f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java @@ -18,11 +18,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.IdentifierNode.InvalidIdentifierException; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class IdentifierNodeTest { +class IdentifierNodeTest { @Test - public void createIdentifier_basic() { + void createIdentifier_basic() { assertValidIdentifier("foobar"); assertValidIdentifier("x"); assertValidIdentifier("afalse"); @@ -34,7 +34,7 @@ public void createIdentifier_basic() { } @Test - public void createIdentifier_nameHasLiteral() { + void createIdentifier_nameHasLiteral() { assertValidIdentifier("a123L"); assertValidIdentifier("a10e3"); assertValidIdentifier("anull"); @@ -51,7 +51,7 @@ public void createIdentifier_nameHasLiteral() { } @Test - public void createIdentifier_namdHasInvalidSymbols() { + void createIdentifier_namdHasInvalidSymbols() { assertInvalidIdentifier("a.b"); assertInvalidIdentifier("a,b"); assertInvalidIdentifier("a-b"); @@ -81,7 +81,7 @@ public void createIdentifier_namdHasInvalidSymbols() { } @Test - public void createIdentifier_nameHasKeyword() { + void createIdentifier_nameHasKeyword() { assertValidIdentifier("aclass"); // Random sampling of keywords. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java index 46e183d6e0..ab2f8c5674 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java @@ -18,11 +18,11 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class IfStatementTest { +class IfStatementTest { @Test - public void validIfStatement_simple() { + void validIfStatement_simple() { IfStatement ifStatement = IfStatement.builder() .setConditionExpr(createConditionExpr("condition")) @@ -32,7 +32,7 @@ public void validIfStatement_simple() { } @Test - public void validIfStatement_booleanObjectCondition() { + void validIfStatement_booleanObjectCondition() { // The condition expression type can be boolean or its boxed type. VariableExpr condExpr = VariableExpr.withVariable( @@ -47,7 +47,7 @@ public void validIfStatement_booleanObjectCondition() { } @Test - public void validIfStatement_elseIfsAndElse() { + void validIfStatement_elseIfsAndElse() { VariableExpr condExpr = createConditionExpr("condition"); VariableExpr secondCondExpr = createConditionExpr("secondCondExpr"); VariableExpr thirdCondExpr = createConditionExpr("thirdCondExpr"); @@ -64,7 +64,7 @@ public void validIfStatement_elseIfsAndElse() { } @Test - public void validIfStatement_nested() { + void validIfStatement_nested() { VariableExpr condExpr = createConditionExpr("condition"); VariableExpr nestedCondExpr = createConditionExpr("nestedCondition"); IfStatement nestedIfStatement = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java index ba53349f85..382c0ebb8c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java @@ -17,11 +17,11 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class InstanceofExprTest { +class InstanceofExprTest { @Test - public void validInstanceofExpr_basicExprPrimitiveType() { + void validInstanceofExpr_basicExprPrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr expr = @@ -32,7 +32,7 @@ public void validInstanceofExpr_basicExprPrimitiveType() { } @Test - public void validInstanceofExpr_basicExprObjectType() { + void validInstanceofExpr_basicExprObjectType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr.builder().setCheckType(TypeNode.STRING).setExpr(variableExpr).build(); @@ -40,7 +40,7 @@ public void validInstanceofExpr_basicExprObjectType() { } @Test - public void invalidInstanceofExpr_primitiveObjectType() { + void invalidInstanceofExpr_primitiveObjectType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java index 9c89e3ee44..2d39575e81 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java @@ -19,11 +19,11 @@ import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaDocCommentTest { +class JavaDocCommentTest { @Test - public void emptyJavaDocComment() { + void emptyJavaDocComment() { JavaDocComment.Builder javaDocCommentBuilder = JavaDocComment.builder(); assertEquals(true, javaDocCommentBuilder.emptyComments()); @@ -33,14 +33,14 @@ public void emptyJavaDocComment() { } @Test - public void createJavaDocComment_basic() { + void createJavaDocComment_basic() { String content = "this is a test comment"; JavaDocComment javaDocComment = JavaDocComment.builder().addComment(content).build(); assertEquals(content, javaDocComment.comment()); } @Test - public void createJavaDocComment_specialCharacter() { + void createJavaDocComment_specialCharacter() { // Check that we handle special characters correctly which includes escape characters, // html escape characters and unexpected block end `*/`. JavaDocComment javaDocComment = @@ -67,7 +67,7 @@ public void createJavaDocComment_specialCharacter() { } @Test - public void createJavaDocComment_sampleCode() { + void createJavaDocComment_sampleCode() { String comment = "sample codes:"; String sampleCode = "resource = project/{project}/shelfId/{shelfId}"; JavaDocComment javaDocComment = @@ -82,7 +82,7 @@ public void createJavaDocComment_sampleCode() { } @Test - public void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { + void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { String comment = "sample codes:"; String formattedSampleCode = LineFormatter.lines( @@ -107,7 +107,7 @@ public void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { } @Test - public void createJavaDocComment_multipleComments() { + void createJavaDocComment_multipleComments() { // Add methods, like `addComment()`, should add components at any place, // and they will get printed in order. String comment1 = "This is a test comment."; @@ -142,7 +142,7 @@ public void createJavaDocComment_multipleComments() { } @Test - public void createJavaDocComment_multipleParams() { + void createJavaDocComment_multipleParams() { // Parameters should be grouped together and get printed after block comments. String comment = "This is a block comment."; String paramName1 = "shelfName"; @@ -163,7 +163,7 @@ public void createJavaDocComment_multipleParams() { } @Test - public void createJavaDocComment_multipleParamsAndReturn() { + void createJavaDocComment_multipleParamsAndReturn() { // Parameters should be grouped together and get printed after block comments. // Return text should get printed at the very end. String comment = "This is a block comment."; @@ -188,7 +188,7 @@ public void createJavaDocComment_multipleParamsAndReturn() { } @Test - public void createJavaDocComment_throwsAndDeprecatedAndReturn() { + void createJavaDocComment_throwsAndDeprecatedAndReturn() { // No matter how many times or order `setThrows`, `setDeprecated`, `setReturn` are called, // only one @throws, @deprecated, and @return will be printed. String throwsType = "com.google.api.gax.rpc.ApiException"; @@ -220,7 +220,7 @@ public void createJavaDocComment_throwsAndDeprecatedAndReturn() { } @Test - public void createJavaDocComment_allComponents() { + void createJavaDocComment_allComponents() { // No matter what order `setThrows`, `setDeprecated`, and `setReturn` are called, // They will be printed at the end. And `@param` should be grouped, // they should always be printed right before `@throws`, `@deprecated`, and `@return`. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java index 46bca0357f..15e35858b0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java @@ -18,18 +18,18 @@ import static org.junit.Assert.assertThrows; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LambdaExprTest { +class LambdaExprTest { @Test - public void validLambdaExpr_noArguments() { + void validLambdaExpr_noArguments() { LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) .build(); } @Test - public void validLambdaExpr_inferTypeFromReturnExpr() { + void validLambdaExpr_inferTypeFromReturnExpr() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -38,7 +38,7 @@ public void validLambdaExpr_inferTypeFromReturnExpr() { } @Test - public void validLambdaExpr_severalArguments() { + void validLambdaExpr_severalArguments() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -62,7 +62,7 @@ public void validLambdaExpr_severalArguments() { } @Test - public void validLambdaExpr_withBody() { + void validLambdaExpr_withBody() { VariableExpr fooVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("foo").setType(TypeNode.INT).build()) @@ -85,7 +85,7 @@ public void validLambdaExpr_withBody() { } @Test - public void validLambdaExpr_returnsVoid() { + void validLambdaExpr_returnsVoid() { LambdaExpr voidLambda = LambdaExpr.builder() .setReturnExpr( @@ -98,7 +98,7 @@ public void validLambdaExpr_returnsVoid() { } @Test - public void invalidLambdaExpr_undeclaredArgVarExpr() { + void invalidLambdaExpr_undeclaredArgVarExpr() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -114,7 +114,7 @@ public void invalidLambdaExpr_undeclaredArgVarExpr() { } @Test - public void invalidLambdaExpr_argVarExprWithModifiers() { + void invalidLambdaExpr_argVarExprWithModifiers() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -132,7 +132,7 @@ public void invalidLambdaExpr_argVarExprWithModifiers() { } @Test - public void invalidLambdaExpr_argVarExprWithNonLocalScope() { + void invalidLambdaExpr_argVarExprWithNonLocalScope() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -150,7 +150,7 @@ public void invalidLambdaExpr_argVarExprWithNonLocalScope() { } @Test - public void invalidLambdaExpr_repeatedArgName() { + void invalidLambdaExpr_repeatedArgName() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java index 3a54cb2706..df39b03121 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LogicalOperationExprTest { +class LogicalOperationExprTest { /** =============================== Logic And Operation Expr =============================== */ @Test - public void logicalAnd_validBasic() { + void logicalAnd_validBasic() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("isGood").build()); @@ -33,7 +33,7 @@ public void logicalAnd_validBasic() { } @Test - public void logicalAnd_validBoxedBoolean() { + void logicalAnd_validBoxedBoolean() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("isGood").build()); @@ -45,7 +45,7 @@ public void logicalAnd_validBoxedBoolean() { } @Test - public void logicalAnd_invalidNumericType() { + void logicalAnd_invalidNumericType() { VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); VariableExpr rhsExpr = @@ -57,7 +57,7 @@ public void logicalAnd_invalidNumericType() { } @Test - public void logicalAnd_invalidStringType() { + void logicalAnd_invalidStringType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("x").build()); @@ -71,7 +71,7 @@ public void logicalAnd_invalidStringType() { /** =============================== Logic Or Operation Expr =============================== */ @Test - public void logicalOr_validBoxedBoolean() { + void logicalOr_validBoxedBoolean() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("isGood").build()); @@ -83,7 +83,7 @@ public void logicalOr_validBoxedBoolean() { } @Test - public void logicalOr_invalidVoidType() { + void logicalOr_invalidVoidType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("x").build()); @@ -95,7 +95,7 @@ public void logicalOr_invalidVoidType() { } @Test - public void logicalOr_invalidNullType() { + void logicalOr_invalidNullType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("x").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java index 96e09352cc..17db2d8019 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java @@ -21,11 +21,11 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodDefinitionTest { +class MethodDefinitionTest { @Test - public void validMethodDefinition_basicWithComments() { + void validMethodDefinition_basicWithComments() { MethodDefinition.builder() .setHeaderCommentStatements(createCommentStatements()) .setName("close") @@ -37,7 +37,7 @@ public void validMethodDefinition_basicWithComments() { } @Test - public void validMethodDefinition_emptyBody() { + void validMethodDefinition_emptyBody() { MethodDefinition.builder() .setHeaderCommentStatements(createCommentStatements()) .setName("close") @@ -47,7 +47,7 @@ public void validMethodDefinition_emptyBody() { } @Test - public void validMethodDefinition_repeatedAnnotations() { + void validMethodDefinition_repeatedAnnotations() { MethodDefinition method = MethodDefinition.builder() .setName("close") @@ -65,7 +65,7 @@ public void validMethodDefinition_repeatedAnnotations() { } @Test - public void validMethodDefinition_basicWithReturnType() { + void validMethodDefinition_basicWithReturnType() { MethodDefinition.builder() .setName("close") .setScope(ScopeNode.PUBLIC) @@ -81,7 +81,7 @@ public void validMethodDefinition_basicWithReturnType() { } @Test - public void validMethodDefinition_throwInsteadOfReturnType() { + void validMethodDefinition_throwInsteadOfReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -99,7 +99,7 @@ public void validMethodDefinition_throwInsteadOfReturnType() { } @Test - public void validMethodDefinition_voidThrowInsteadOfReturnType() { + void validMethodDefinition_voidThrowInsteadOfReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -117,7 +117,7 @@ public void validMethodDefinition_voidThrowInsteadOfReturnType() { } @Test - public void validMethodDefinition_subtyping() { + void validMethodDefinition_subtyping() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -149,7 +149,7 @@ public void validMethodDefinition_subtyping() { } @Test - public void validMethodDefinition_basicAbstract() { + void validMethodDefinition_basicAbstract() { MethodDefinition.builder() .setName("close") .setIsAbstract(true) @@ -160,7 +160,7 @@ public void validMethodDefinition_basicAbstract() { } @Test - public void validMethodDefinition_constructor() { + void validMethodDefinition_constructor() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -174,7 +174,7 @@ public void validMethodDefinition_constructor() { } @Test - public void validMethodDefinition_withArgumentsAndReturnExpr() { + void validMethodDefinition_withArgumentsAndReturnExpr() { ValueExpr returnExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -201,7 +201,7 @@ public void validMethodDefinition_withArgumentsAndReturnExpr() { } @Test - public void validMethodDefinition_nonRuntimeException() { + void validMethodDefinition_nonRuntimeException() { MethodDefinition.builder() .setName("close") .setScope(ScopeNode.PUBLIC) @@ -213,7 +213,7 @@ public void validMethodDefinition_nonRuntimeException() { } @Test - public void validMethodDefinition_templateBasic() { + void validMethodDefinition_templateBasic() { TypeNode returnType = TypeNode.withReference(ConcreteReference.withClazz(Map.class)); MethodDefinition.builder() .setName("close") @@ -231,7 +231,7 @@ public void validMethodDefinition_templateBasic() { } @Test - public void validMethodDefinition_templateOnArguments() { + void validMethodDefinition_templateOnArguments() { Reference listRef = ConcreteReference.withClazz(List.class); List arguments = Arrays.asList( @@ -263,7 +263,7 @@ public void validMethodDefinition_templateOnArguments() { } @Test - public void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { + void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { // Not valid Java. Please change this test if you are trying to prevent this case. MethodDefinition.builder() .setName("close") @@ -275,7 +275,7 @@ public void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { } @Test - public void validMethodDefinition_boxedReturnType() { + void validMethodDefinition_boxedReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -288,7 +288,7 @@ public void validMethodDefinition_boxedReturnType() { } @Test - public void validMethodDefinition_setReturnExprUsingReturnExpr() { + void validMethodDefinition_setReturnExprUsingReturnExpr() { ReturnExpr returnExpr = ReturnExpr.withExpr( ValueExpr.withValue( @@ -303,7 +303,7 @@ public void validMethodDefinition_setReturnExprUsingReturnExpr() { } @Test - public void invalidMethodDefinition_badTemplateName() { + void invalidMethodDefinition_badTemplateName() { assertThrows( IdentifierNode.InvalidIdentifierException.class, () -> @@ -317,7 +317,7 @@ public void invalidMethodDefinition_badTemplateName() { } @Test - public void invalidMethodDefinition_primitiveReturnType() { + void invalidMethodDefinition_primitiveReturnType() { assertThrows( IllegalStateException.class, () -> @@ -332,7 +332,7 @@ public void invalidMethodDefinition_primitiveReturnType() { } @Test - public void invalidMethodDefinition_emptyTemplatesOnMethod() { + void invalidMethodDefinition_emptyTemplatesOnMethod() { assertThrows( IllegalStateException.class, () -> @@ -348,7 +348,7 @@ public void invalidMethodDefinition_emptyTemplatesOnMethod() { } @Test - public void invalidMethodDefinition_returnTemplatesNotPresent() { + void invalidMethodDefinition_returnTemplatesNotPresent() { assertThrows( IllegalStateException.class, () -> @@ -365,7 +365,7 @@ public void invalidMethodDefinition_returnTemplatesNotPresent() { } @Test - public void invalidMethodDefinition_noName() { + void invalidMethodDefinition_noName() { assertThrows( NullPointerException.class, () -> { @@ -378,7 +378,7 @@ public void invalidMethodDefinition_noName() { } @Test - public void invalidMethodDefinition_runtimeException() { + void invalidMethodDefinition_runtimeException() { assertThrows( IllegalStateException.class, () -> { @@ -394,7 +394,7 @@ public void invalidMethodDefinition_runtimeException() { } @Test - public void invalidMethodDefinition_abstractStatic() { + void invalidMethodDefinition_abstractStatic() { assertThrows( IllegalStateException.class, () -> { @@ -409,7 +409,7 @@ public void invalidMethodDefinition_abstractStatic() { } @Test - public void invalidMethodDefinition_localScope() { + void invalidMethodDefinition_localScope() { assertThrows( IllegalStateException.class, () -> { @@ -422,7 +422,7 @@ public void invalidMethodDefinition_localScope() { } @Test - public void invalidMethodDefinition_constructorOverride() { + void invalidMethodDefinition_constructorOverride() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -441,7 +441,7 @@ public void invalidMethodDefinition_constructorOverride() { } @Test - public void invalidMethodDefinition_constructorFinalOrStatic() { + void invalidMethodDefinition_constructorFinalOrStatic() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -469,7 +469,7 @@ public void invalidMethodDefinition_constructorFinalOrStatic() { } @Test - public void invalidMethodDefinition_constructorHasReturnExpr() { + void invalidMethodDefinition_constructorHasReturnExpr() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -492,7 +492,7 @@ public void invalidMethodDefinition_constructorHasReturnExpr() { } @Test - public void invalidMethodDefinition_objectPrimitiveTypeMismatch() { + void invalidMethodDefinition_objectPrimitiveTypeMismatch() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); @@ -510,7 +510,7 @@ public void invalidMethodDefinition_objectPrimitiveTypeMismatch() { } @Test - public void invalidMethodDefinition_mismatchedTypes() { + void invalidMethodDefinition_mismatchedTypes() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -539,7 +539,7 @@ public void invalidMethodDefinition_mismatchedTypes() { } @Test - public void invalidMethodDefinition_abstractFinal() { + void invalidMethodDefinition_abstractFinal() { assertThrows( IllegalStateException.class, () -> { @@ -554,7 +554,7 @@ public void invalidMethodDefinition_abstractFinal() { } @Test - public void invalidMethodDefinition_abstractPrivate() { + void invalidMethodDefinition_abstractPrivate() { assertThrows( IllegalStateException.class, () -> { @@ -568,7 +568,7 @@ public void invalidMethodDefinition_abstractPrivate() { } @Test - public void invalidMethodDefinition_invalidException() { + void invalidMethodDefinition_invalidException() { assertThrows( IllegalStateException.class, () -> { @@ -583,7 +583,7 @@ public void invalidMethodDefinition_invalidException() { } @Test - public void invalidMethodDefinition_missingNonVoidReturnType() { + void invalidMethodDefinition_missingNonVoidReturnType() { assertThrows( NullPointerException.class, () -> { @@ -597,7 +597,7 @@ public void invalidMethodDefinition_missingNonVoidReturnType() { } @Test - public void invalidMethodDefinition_mismatchedPrimitiveReturnType() { + void invalidMethodDefinition_mismatchedPrimitiveReturnType() { ValueExpr booleanValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("false").build()) @@ -616,7 +616,7 @@ public void invalidMethodDefinition_mismatchedPrimitiveReturnType() { } @Test - public void invalidMethodDefinition_mismatchedObjectReturnType() { + void invalidMethodDefinition_mismatchedObjectReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -635,7 +635,7 @@ public void invalidMethodDefinition_mismatchedObjectReturnType() { } @Test - public void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { + void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -654,7 +654,7 @@ public void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { } @Test - public void invalidMethodDefinition_repeatedArgumentName() { + void invalidMethodDefinition_repeatedArgumentName() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -678,7 +678,7 @@ public void invalidMethodDefinition_repeatedArgumentName() { } @Test - public void invalidMethodDefinition_nonDeclArguments() { + void invalidMethodDefinition_nonDeclArguments() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -702,7 +702,7 @@ public void invalidMethodDefinition_nonDeclArguments() { } @Test - public void invalidMethodDefinition_argumentsWithModifiers() { + void invalidMethodDefinition_argumentsWithModifiers() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -729,7 +729,7 @@ public void invalidMethodDefinition_argumentsWithModifiers() { } @Test - public void invalidMethodDefinition_argumentsWithScope() { + void invalidMethodDefinition_argumentsWithScope() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -755,7 +755,7 @@ public void invalidMethodDefinition_argumentsWithScope() { } @Test - public void invalidMethodDefinition_nullReturnType() { + void invalidMethodDefinition_nullReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -768,7 +768,7 @@ public void invalidMethodDefinition_nullReturnType() { } @Test - public void invalidMethodDefinition_missingReturnType() { + void invalidMethodDefinition_missingReturnType() { assertThrows( NullPointerException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java index eed99da9b7..7261cd2b77 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodInvocationExprTest { +class MethodInvocationExprTest { @Test - public void validBuildMethodInvocationExpr() { + void validBuildMethodInvocationExpr() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -37,7 +37,7 @@ public void validBuildMethodInvocationExpr() { } @Test - public void validBuildMethodInvocationExpr_hasArguments() { + void validBuildMethodInvocationExpr_hasArguments() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -59,7 +59,7 @@ public void validBuildMethodInvocationExpr_hasArguments() { } @Test - public void validBuildMethodInvocationExpr_staticReference() { + void validBuildMethodInvocationExpr_staticReference() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -75,7 +75,7 @@ public void validBuildMethodInvocationExpr_staticReference() { } @Test - public void invalidBuildMethodInvocationExpr_nullReturnType() { + void invalidBuildMethodInvocationExpr_nullReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -87,7 +87,7 @@ public void invalidBuildMethodInvocationExpr_nullReturnType() { } @Test - public void invalidBuildMethodInvocationExpr_staticAndExprBoth() { + void invalidBuildMethodInvocationExpr_staticAndExprBoth() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -110,7 +110,7 @@ public void invalidBuildMethodInvocationExpr_staticAndExprBoth() { } @Test - public void invalidBuildMethodInvocationExpr_nullArgument() { + void invalidBuildMethodInvocationExpr_nullArgument() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java index 2287a75394..12112f7b45 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java @@ -21,11 +21,11 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class NewObjectExprTest { +class NewObjectExprTest { @Test - public void validNewObjectValue_basic() { + void validNewObjectValue_basic() { // isGeneric() is true and generics() is not empty. // [Constructing] `new List()`, no exception should be thrown. ConcreteReference ref = @@ -40,7 +40,7 @@ public void validNewObjectValue_basic() { } @Test - public void validNewObjectValue_hasArgument() { + void validNewObjectValue_hasArgument() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -58,7 +58,7 @@ public void validNewObjectValue_hasArgument() { } @Test - public void validNewObjectExpr_edgeCase() { + void validNewObjectExpr_edgeCase() { // isGeneric() is false, but generics() is not empty. // The expression is still valid, we will set isGeneric() as true for the users. // [Constructing] `new List()`, no exception should be thrown. @@ -74,7 +74,7 @@ public void validNewObjectExpr_edgeCase() { } @Test - public void validNewObjectExpr_noGenericWithArgs() { + void validNewObjectExpr_noGenericWithArgs() { // isGeneric() is false, and generics() is empty. // [Constructing] `new Integer(123)` no exception should be thrown. ConcreteReference ref = ConcreteReference.builder().setClazz(Integer.class).build(); @@ -88,7 +88,7 @@ public void validNewObjectExpr_noGenericWithArgs() { } @Test - public void validNewObjectExpr_emptyGeneric() { + void validNewObjectExpr_emptyGeneric() { // isGeneric() is true, but generics() is empty. // [Constructing] `new LinkedList<>()` no exception should be thrown. ConcreteReference ref = ConcreteReference.builder().setClazz(LinkedList.class).build(); @@ -99,7 +99,7 @@ public void validNewObjectExpr_emptyGeneric() { } @Test - public void validNewObjectExpr_genericsAndArgs() { + void validNewObjectExpr_genericsAndArgs() { // isGeneric() is true, generics() is not empty, and argument list is also not empty. // [Constructing] `new HashMap, Integer>>(initialCapacity, loadFactor)`. ConcreteReference listRef = @@ -130,7 +130,7 @@ public void validNewObjectExpr_genericsAndArgs() { } @Test - public void invalidNewObjectExpr_primitiveType() { + void invalidNewObjectExpr_primitiveType() { // New object expressions should be reference types. assertThrows( IllegalStateException.class, @@ -140,7 +140,7 @@ public void invalidNewObjectExpr_primitiveType() { } @Test - public void invalidNewObjectExpr_nullType() { + void invalidNewObjectExpr_nullType() { // New object expressions cannot be null type. assertThrows( IllegalStateException.class, @@ -150,7 +150,7 @@ public void invalidNewObjectExpr_nullType() { } @Test - public void invalidNewObjectValue_nullArgument() { + void invalidNewObjectValue_nullArgument() { VaporReference ref = VaporReference.builder() .setName("Student") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java index fa9dfa2669..8e31801a47 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java @@ -17,13 +17,13 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class NullObjectValueTest { +class NullObjectValueTest { private static final String NULL_VALUE = "null"; @Test - public void createNullObjectValue_valid() { + void createNullObjectValue_valid() { NullObjectValue nullValue = NullObjectValue.create(); assertEquals(NULL_VALUE, nullValue.value()); assertThat(nullValue.type()).isEqualTo(TypeNode.NULL); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java index 37c3ae9cc4..6045d7ec35 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java @@ -19,11 +19,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PrimitiveValueTest { +class PrimitiveValueTest { @Test - public void createPrimitiveValue_basic() { + void createPrimitiveValue_basic() { assertValidValue(TypeKind.INT, "3"); assertValidValue(TypeKind.BOOLEAN, "false"); assertValidValue(TypeKind.LONG, "123"); @@ -32,7 +32,7 @@ public void createPrimitiveValue_basic() { } @Test - public void createPrimitiveValue_invalid() { + void createPrimitiveValue_invalid() { assertInvalidValue(TypeKind.INT, "123.f"); assertInvalidValue(TypeKind.INT, "false"); assertInvalidValue(TypeKind.BOOLEAN, "False"); @@ -40,7 +40,7 @@ public void createPrimitiveValue_invalid() { } @Test - public void createPrimitiveValue_unsupported() { + void createPrimitiveValue_unsupported() { assertInvalidValue(TypeKind.BYTE, "0x2"); assertInvalidValue(TypeKind.SHORT, "1"); assertInvalidValue(TypeKind.CHAR, "a"); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java index 8ba47c8ac6..03e579d411 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReferenceConstructorExprTest { +class ReferenceConstructorExprTest { @Test - public void validReferenceConstructorExpr_thisConstructorBasic() { + void validReferenceConstructorExpr_thisConstructorBasic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -33,7 +33,7 @@ public void validReferenceConstructorExpr_thisConstructorBasic() { } @Test - public void validReferenceConstructorExpr_hasArguments() { + void validReferenceConstructorExpr_hasArguments() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -51,7 +51,7 @@ public void validReferenceConstructorExpr_hasArguments() { } @Test - public void validReferenceConstructorExpr_superConstructorBasic() { + void validReferenceConstructorExpr_superConstructorBasic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -63,7 +63,7 @@ public void validReferenceConstructorExpr_superConstructorBasic() { } @Test - public void invalidReferenceConstructorExpr_nonReferenceType() { + void invalidReferenceConstructorExpr_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -72,7 +72,7 @@ public void invalidReferenceConstructorExpr_nonReferenceType() { } @Test - public void invalidReferenceConstructorExpr_nullType() { + void invalidReferenceConstructorExpr_nullType() { assertThrows( IllegalStateException.class, () -> { @@ -81,7 +81,7 @@ public void invalidReferenceConstructorExpr_nullType() { } @Test - public void invalidReferenceConstructorExpr_nullArgument() { + void invalidReferenceConstructorExpr_nullArgument() { VaporReference ref = VaporReference.builder() .setName("Student") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java index b4e4b43496..c210900a4f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReferenceTest { +class ReferenceTest { @Test - public void nestedGenerics_concreteReferenceOuter() { + void nestedGenerics_concreteReferenceOuter() { Reference mapReference = VaporReference.builder() .setName("HashMap") @@ -50,7 +50,7 @@ public void nestedGenerics_concreteReferenceOuter() { } @Test - public void nestedGenerics_vaporReferenceOuter() { + void nestedGenerics_vaporReferenceOuter() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -77,7 +77,7 @@ public void nestedGenerics_vaporReferenceOuter() { } @Test - public void mixedConcreteVaporReferenceEquals() { + void mixedConcreteVaporReferenceEquals() { Reference mapReferenceVaporOuter = ConcreteReference.builder() .setClazz(HashMap.class) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java index f1b3f1f424..829f763328 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java @@ -17,12 +17,12 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RelationalOperationExprTest { +class RelationalOperationExprTest { /** ==================== Equality Operators: LHS data type is numeric ======================= */ @Test - public void equalToOperationExpr_validBasic() { + void equalToOperationExpr_validBasic() { // LHS: numeric type, RHS: matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -32,7 +32,7 @@ public void equalToOperationExpr_validBasic() { } @Test - public void equalToOperationExpr_validNumericTYpe() { + void equalToOperationExpr_validNumericTYpe() { // LHS: numeric type, RHS: unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); @@ -42,7 +42,7 @@ public void equalToOperationExpr_validNumericTYpe() { } @Test - public void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { + void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { // LHS: numeric type, RHS: matched numeric Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validBoxedWithMatchedUnBoxedType". @@ -53,7 +53,7 @@ public void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { } @Test - public void notEqualToOperationExpr_validNumericBoxTYpe() { + void notEqualToOperationExpr_validNumericBoxTYpe() { // LHS: numeric type, RHS: unmatched numeric Boxed type. // Swapping LHS and RHS test case is covered in // equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType". @@ -64,7 +64,7 @@ public void notEqualToOperationExpr_validNumericBoxTYpe() { } @Test - public void equalToOperationExpr_invalidNumericBooleanBoxedType() { + void equalToOperationExpr_invalidNumericBooleanBoxedType() { // LHS: numeric type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBoxedBooleanWithNumericType". @@ -76,7 +76,7 @@ public void equalToOperationExpr_invalidNumericBooleanBoxedType() { } @Test - public void notEqualToOperationExpr_invalidNumericStringType() { + void notEqualToOperationExpr_invalidNumericStringType() { // LHS: numeric type, RHS: referenced type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithNumericType". @@ -88,7 +88,7 @@ public void notEqualToOperationExpr_invalidNumericStringType() { } @Test - public void notEqualToOperationExpr_invalidNumericNullType() { + void notEqualToOperationExpr_invalidNumericNullType() { // LHS: numeric type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNullWithNumericType". @@ -100,7 +100,7 @@ public void notEqualToOperationExpr_invalidNumericNullType() { } @Test - public void equalToOperationExpr_invalidNumericBooleanType() { + void equalToOperationExpr_invalidNumericBooleanType() { // LHS: numeric type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in // notEqualToOperationExpr_invalidBooleanToNumericType. @@ -112,7 +112,7 @@ public void equalToOperationExpr_invalidNumericBooleanType() { } @Test - public void equalToOperationExpr_invalidNumericTypeWithArrayType() { + void equalToOperationExpr_invalidNumericTypeWithArrayType() { // LHS: Numeric Type, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidArrayWithNotArrayType". @@ -127,7 +127,7 @@ public void equalToOperationExpr_invalidNumericTypeWithArrayType() { /** =============== Equality Operators: LHS data type is numeric boxed type ================ */ @Test - public void equalToOperationExpr_validBoxedWithMatchedBoxedType() { + void equalToOperationExpr_validBoxedWithMatchedBoxedType() { // LHS: Boxed type, RHS: Matched Boxed. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -137,7 +137,7 @@ public void equalToOperationExpr_validBoxedWithMatchedBoxedType() { } @Test - public void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { + void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { // LHS: Boxed type, RHS: Unmatched Boxed. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validMatchedNumericBoxTYpe". @@ -148,7 +148,7 @@ public void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { } @Test - public void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { + void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { // LHS: Numeric boxed type, RHS: other numeric type. // Swapping LHS and RHS test case is covered in "notEqualToOperationExpr_validNumericBoxTYpe". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); @@ -158,7 +158,7 @@ public void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { } @Test - public void equalToOperationExpr_validNumericBoxedWithNullType() { + void equalToOperationExpr_validNumericBoxedWithNullType() { // LHS: Boxed type, RHS: Null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithNumericBoxedType". @@ -169,7 +169,7 @@ public void equalToOperationExpr_validNumericBoxedWithNullType() { } @Test - public void equalToOperationExpr_validNumericBoxedWithNewObjectType() { + void equalToOperationExpr_validNumericBoxedWithNewObjectType() { // LHS: Numeric boxed type, RHS: new object. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithNumericBoxedType". @@ -180,7 +180,7 @@ public void equalToOperationExpr_validNumericBoxedWithNewObjectType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { + void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { // LHS: Numeric boxed type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidBooleanToOtherBoxedType". @@ -192,7 +192,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { + void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { // LHS: Numeric boxed type, RHS: Boolean Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType". @@ -204,7 +204,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { + void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { // LHS: Numeric boxed type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithNumericBoxedType". @@ -217,7 +217,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { /** ============= Equality Operators: LHS data type is boolean or its boxed type ============== */ @Test - public void equalToOperationExpr_validBooleanType() { + void equalToOperationExpr_validBooleanType() { // LHS: boolean type, RHS: boolean Type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); @@ -227,7 +227,7 @@ public void equalToOperationExpr_validBooleanType() { } @Test - public void equalToOperationExpr_validRHSBooleanBoxedType() { + void equalToOperationExpr_validRHSBooleanBoxedType() { // LHS: boolean type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validLHSBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); @@ -237,7 +237,7 @@ public void equalToOperationExpr_validRHSBooleanBoxedType() { } @Test - public void equalToOperationExpr_validLHSBooleanBoxedType() { + void equalToOperationExpr_validLHSBooleanBoxedType() { // LHS: boolean boxed type, RHS: boolean Type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validRHSBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); @@ -247,7 +247,7 @@ public void equalToOperationExpr_validLHSBooleanBoxedType() { } @Test - public void notEqualToOperationExpr_validBooleanBoxedToNullType() { + void notEqualToOperationExpr_validBooleanBoxedToNullType() { // LHS: boolean boxed type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithBooleanBoxedType". @@ -258,7 +258,7 @@ public void notEqualToOperationExpr_validBooleanBoxedToNullType() { } @Test - public void notEqualToOperationExpr_validBooleanBoxedToObjectType() { + void notEqualToOperationExpr_validBooleanBoxedToObjectType() { // LHS: boolean boxed type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithBooleanBoxedType". @@ -269,7 +269,7 @@ public void notEqualToOperationExpr_validBooleanBoxedToObjectType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToNumericType() { + void notEqualToOperationExpr_invalidBooleanToNumericType() { // LHS: boolean type, RHS: char boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBooleanType". @@ -281,7 +281,7 @@ public void notEqualToOperationExpr_invalidBooleanToNumericType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { + void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { // LHS: boolean type, RHS: numeric boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithBooleanType". @@ -293,7 +293,7 @@ public void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToReferenceType() { + void notEqualToOperationExpr_invalidBooleanToReferenceType() { // LHS: boolean type, RHS: object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithBooleanType". @@ -305,7 +305,7 @@ public void notEqualToOperationExpr_invalidBooleanToReferenceType() { } @Test - public void equalToOperationExpr_invalidBooleanWithNullType() { + void equalToOperationExpr_invalidBooleanWithNullType() { // LHS: boolean type, RHS: null type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNullWithBooleanType". @@ -317,7 +317,7 @@ public void equalToOperationExpr_invalidBooleanWithNullType() { } @Test - public void equalToOperationExpr_invalidBooleanWithObjectType() { + void equalToOperationExpr_invalidBooleanWithObjectType() { // LHS: boolean type, RHS: object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidObjectWithBooleanType". @@ -329,7 +329,7 @@ public void equalToOperationExpr_invalidBooleanWithObjectType() { } @Test - public void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { + void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { // LHS: boolean boxed type, RHS: numeric // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBooleanBoxedType". @@ -341,7 +341,7 @@ public void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { } @Test - public void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { + void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { // LHS: boolean boxed type, RHS: numeric // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType". @@ -353,7 +353,7 @@ public void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { } @Test - public void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { + void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { // LHS: boolean boxed type, RHS: reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithBooleanBoxedType". @@ -366,7 +366,7 @@ public void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { /** ===================== Equality Operators: LHS data type is Array ======================== */ @Test - public void equalToOperationExpr_validArrayWithMatchedType() { + void equalToOperationExpr_validArrayWithMatchedType() { // LHS: Array with numeric type, RHS: Array with matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = @@ -380,7 +380,7 @@ public void equalToOperationExpr_validArrayWithMatchedType() { } @Test - public void equalToOperationExpr_validArrayWithNullType() { + void equalToOperationExpr_validArrayWithNullType() { // LHS: Array with numeric type, RHS: null // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validANullWithArrayType". VariableExpr lhsExpr = @@ -393,7 +393,7 @@ public void equalToOperationExpr_validArrayWithNullType() { } @Test - public void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { + void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { // LHS: Array with numeric type, RHS: Array with unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = @@ -408,7 +408,7 @@ public void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { } @Test - public void equalToOperationExpr_invalidArrayWithNotArrayType() { + void equalToOperationExpr_invalidArrayWithNotArrayType() { // LHS: Array with numeric type, RHS: not Array // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericTypeWithArrayType". @@ -422,7 +422,7 @@ public void equalToOperationExpr_invalidArrayWithNotArrayType() { } @Test - public void equalToOperationExpr_invalidArrayWithObjectType() { + void equalToOperationExpr_invalidArrayWithObjectType() { // LHS: Array with numeric type, RHS: New Object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidObjectTypeWithArray". @@ -437,7 +437,7 @@ public void equalToOperationExpr_invalidArrayWithObjectType() { /** ================== Equality Operators: LHS data type is reference type =================== */ @Test - public void equalToOperationExpr_validReferenceWithMatchedType() { + void equalToOperationExpr_validReferenceWithMatchedType() { // LHS: String type, RHS: matched String type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -447,7 +447,7 @@ public void equalToOperationExpr_validReferenceWithMatchedType() { } @Test - public void equalToOperationExpr_validReferenceWithNullType() { + void equalToOperationExpr_validReferenceWithNullType() { // LHS: String type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithReferenceType". @@ -458,7 +458,7 @@ public void equalToOperationExpr_validReferenceWithNullType() { } @Test - public void equalToOperationExpr_validReferenceWithObjectType() { + void equalToOperationExpr_validReferenceWithObjectType() { // LHS: String type, RHS: New object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithStringType". @@ -469,7 +469,7 @@ public void equalToOperationExpr_validReferenceWithObjectType() { } @Test - public void equalToOperationExpr_validAnyObjectTypeWithObject() { + void equalToOperationExpr_validAnyObjectTypeWithObject() { // LHS: Any reference type, RHS: Object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithAnyObjectType". @@ -486,7 +486,7 @@ public void equalToOperationExpr_validAnyObjectTypeWithObject() { } @Test - public void equalToOperationExpr_validAnyReferenceTypeWithNull() { + void equalToOperationExpr_validAnyReferenceTypeWithNull() { // LHS: Any reference type, RHS: Null type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithAnyReferenceType". @@ -503,7 +503,7 @@ public void equalToOperationExpr_validAnyReferenceTypeWithNull() { } @Test - public void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { + void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { // LHS: String type, RHS: Unmatched reference type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -520,7 +520,7 @@ public void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { } @Test - public void equalToOperationExpr_invalidReferenceWithNumericType() { + void equalToOperationExpr_invalidReferenceWithNumericType() { // LHS: String type, RHS: Numeric type // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidNumericStringType". @@ -532,7 +532,7 @@ public void equalToOperationExpr_invalidReferenceWithNumericType() { } @Test - public void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { + void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { // LHS: String type, RHS: numeric boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithReferenceType". @@ -544,7 +544,7 @@ public void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { } @Test - public void equalToOperationExpr_invalidReferenceWithBooleanType() { + void equalToOperationExpr_invalidReferenceWithBooleanType() { // LHS: String type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidBooleanToReferenceType". @@ -556,7 +556,7 @@ public void equalToOperationExpr_invalidReferenceWithBooleanType() { } @Test - public void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { + void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { // LHS: String type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBoxedBooleanWithReferencedType". @@ -569,7 +569,7 @@ public void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { /** ================== Equality Operators: LHS data type is Object or null =================== */ @Test - public void equalToOperationExpr_validObjectWithAnyObjectType() { + void equalToOperationExpr_validObjectWithAnyObjectType() { // LHS: Object type, RHS: Any reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validAnyObjectTypeWithObject". @@ -586,7 +586,7 @@ public void equalToOperationExpr_validObjectWithAnyObjectType() { } @Test - public void equalToOperationExpr_validNullWithAnyReferenceType() { + void equalToOperationExpr_validNullWithAnyReferenceType() { // LHS: Null type, RHS: any reference type // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validAnyReferenceTypeWithNull". @@ -603,7 +603,7 @@ public void equalToOperationExpr_validNullWithAnyReferenceType() { } @Test - public void equalToOperationExpr_validObjectWithNullType() { + void equalToOperationExpr_validObjectWithNullType() { // LHS: Object, RHS: Null. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validNullWithObjectType". VariableExpr lhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); @@ -613,7 +613,7 @@ public void equalToOperationExpr_validObjectWithNullType() { } @Test - public void equalToOperationExpr_validNullWithObjectType() { + void equalToOperationExpr_validNullWithObjectType() { // LHS: Null, RHS: Object. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validObjectWithNullType". VariableExpr rhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); @@ -623,7 +623,7 @@ public void equalToOperationExpr_validNullWithObjectType() { } @Test - public void equalToOperationExpr_validNullWithNullType() { + void equalToOperationExpr_validNullWithNullType() { // LHS: Null, RHS: Null. // No need swap LHS and RHS test case. ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -633,7 +633,7 @@ public void equalToOperationExpr_validNullWithNullType() { } @Test - public void equalToOperationExpr_validObjectWithStringType() { + void equalToOperationExpr_validObjectWithStringType() { // LHS: Object type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validReferenceWithObjectType". @@ -644,7 +644,7 @@ public void equalToOperationExpr_validObjectWithStringType() { } @Test - public void equalToOperationExpr_validObjectWithBooleanBoxedType() { + void equalToOperationExpr_validObjectWithBooleanBoxedType() { // LHS: Object type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validBooleanBoxedToObjectType". @@ -655,7 +655,7 @@ public void equalToOperationExpr_validObjectWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_validObjectWithNumericBoxedType() { + void equalToOperationExpr_validObjectWithNumericBoxedType() { // LHS: Object type, RHS: Any Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNumericBoxedWithNewObjectType". @@ -666,7 +666,7 @@ public void equalToOperationExpr_validObjectWithNumericBoxedType() { } @Test - public void equalToOperationExpr_validNullWithReferenceType() { + void equalToOperationExpr_validNullWithReferenceType() { // LHS: Null type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithReferenceType". @@ -677,7 +677,7 @@ public void equalToOperationExpr_validNullWithReferenceType() { } @Test - public void equalToOperationExpr_validNullWithBooleanBoxedType() { + void equalToOperationExpr_validNullWithBooleanBoxedType() { // LHS: Object type, RHS: Any Boxed type // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validBooleanBoxedToNullType". @@ -688,7 +688,7 @@ public void equalToOperationExpr_validNullWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_validNullWithNumericBoxedType() { + void equalToOperationExpr_validNullWithNumericBoxedType() { // LHS: Object type, RHS: Any Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNumericBoxedWithNullType". @@ -699,7 +699,7 @@ public void equalToOperationExpr_validNullWithNumericBoxedType() { } @Test - public void equalToOperationExpr_validANullWithArrayType() { + void equalToOperationExpr_validANullWithArrayType() { // LHS: Null, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validArrayWithNullType". NullObjectValue nullObjectValue = NullObjectValue.create(); @@ -712,7 +712,7 @@ public void equalToOperationExpr_validANullWithArrayType() { } @Test - public void equalToOperationExpr_invalidNullWithNumericType() { + void equalToOperationExpr_invalidNullWithNumericType() { // LHS: Null type, RHS: Nny Numeric type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidNumericNullType". @@ -724,7 +724,7 @@ public void equalToOperationExpr_invalidNullWithNumericType() { } @Test - public void equalToOperationExpr_invalidNullWithBooleanType() { + void equalToOperationExpr_invalidNullWithBooleanType() { // LHS: Null type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanWithNullType". @@ -736,7 +736,7 @@ public void equalToOperationExpr_invalidNullWithBooleanType() { } @Test - public void equalToOperationExpr_invalidObjectWithNumericType() { + void equalToOperationExpr_invalidObjectWithNumericType() { // LHS: Object type, RHS: Any Numeric type. VariableExpr lhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -746,7 +746,7 @@ public void equalToOperationExpr_invalidObjectWithNumericType() { } @Test - public void equalToOperationExpr_invalidObjectWithBooleanType() { + void equalToOperationExpr_invalidObjectWithBooleanType() { // LHS: Object type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanWithObjectType". @@ -758,7 +758,7 @@ public void equalToOperationExpr_invalidObjectWithBooleanType() { } @Test - public void equalToOperationExpr_invalidObjectTypeWithArray() { + void equalToOperationExpr_invalidObjectTypeWithArray() { // LHS: New Object type, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidArrayWithObjectType". @@ -774,7 +774,7 @@ public void equalToOperationExpr_invalidObjectTypeWithArray() { /** ================== Less Than Operators: expr types are numeric types =================== */ // The expression types on LHS or RHS could be any numeric type or any numeric boxed type. @Test - public void lessThanOperationExpr_validMatchedNumericType() { + void lessThanOperationExpr_validMatchedNumericType() { // LHS: Numeric type, RHS: Matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -784,7 +784,7 @@ public void lessThanOperationExpr_validMatchedNumericType() { } @Test - public void lessThanOperationExpr_validUnmatchedNumericType() { + void lessThanOperationExpr_validUnmatchedNumericType() { // LHS: Numeric type, RHS: Unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -794,7 +794,7 @@ public void lessThanOperationExpr_validUnmatchedNumericType() { } @Test - public void lessThanOperationExpr_validMatchedNumericBoxedType() { + void lessThanOperationExpr_validMatchedNumericBoxedType() { // LHS: Numeric type, RHS: Matched numeric type. // Swap case in "lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); @@ -804,7 +804,7 @@ public void lessThanOperationExpr_validMatchedNumericBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() { + void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() { // LHS: Numeric boxed type, RHS: Matched numeric type. // Swap case in "lessThanOperationExpr_validMatchedNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); @@ -814,7 +814,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() } @Test - public void lessThanOperationExpr_validUnmatchedNumericBoxedType() { + void lessThanOperationExpr_validUnmatchedNumericBoxedType() { // LHS: Numeric type, RHS: Unmatched numeric boxed type. // Swap case in "lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); @@ -824,7 +824,7 @@ public void lessThanOperationExpr_validUnmatchedNumericBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType() { // LHS: Numeric boxed type, RHS: Unmatched numeric type. // Swap case in "lessThanOperationExpr_validUnmatchedNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -834,7 +834,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType( } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { // LHS: Numeric boxed type, RHS: Matched numeric boxed type. // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -844,7 +844,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() { // LHS: Numeric boxed type, RHS: Unmatched numeric boxed type. // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -856,7 +856,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() /** ================= Less Than Operators: expr types are non-numeric types ================== */ // Invalid if any of expression type on LHS or RHS is non-numeric type or non numeric boxed type. @Test - public void lessThanOperationExpr_invalidNumericTypeWithNullType() { + void lessThanOperationExpr_invalidNumericTypeWithNullType() { // LHS: Null type, RHS: Numeric type. // Swap case in "lessThanOperationExpr_invalidNumericWithNullType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -867,7 +867,7 @@ public void lessThanOperationExpr_invalidNumericTypeWithNullType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { // LHS: Numeric boxed type, RHS: Null type. // Swap case in "lessThanOperationExpr_invalidNullWithNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -878,7 +878,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { } @Test - public void lessThanOperationExpr_invalidNumericTypeWithObjectType() { + void lessThanOperationExpr_invalidNumericTypeWithObjectType() { // LHS: Numeric type, RHS: Object Type. // Swap case in "lessThanOperationExpr_invalidObjectNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -889,7 +889,7 @@ public void lessThanOperationExpr_invalidNumericTypeWithObjectType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { // LHS: Numeric boxed type, RHS: Object Type. // Swap case in "lessThanOperationExpr_invalidObjectNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -900,7 +900,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { // LHS: Numeric boxed type, RHS: Reference Type. // Swap case in "lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -911,7 +911,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { } @Test - public void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { + void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { // LHS: Reference type, RHS: Numeric boxed Type. // Swap case in "lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -922,7 +922,7 @@ public void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidObjectNumericType() { + void lessThanOperationExpr_invalidObjectNumericType() { // LHS: Object type, RHS: Numeric Type. // Swap case in "lessThanOperationExpr_invalidNumericTypeWithObjectType". NewObjectExpr lhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -933,7 +933,7 @@ public void lessThanOperationExpr_invalidObjectNumericType() { } @Test - public void lessThanOperationExpr_invalidObjectNumericBoxedType() { + void lessThanOperationExpr_invalidObjectNumericBoxedType() { // LHS: Object type, RHS: Numeric boxed Type. // Swap case in "lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType". NewObjectExpr lhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -944,7 +944,7 @@ public void lessThanOperationExpr_invalidObjectNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidNumericWithNullType() { + void lessThanOperationExpr_invalidNumericWithNullType() { // LHS: Null type, RHS: Numeric box type. ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -955,7 +955,7 @@ public void lessThanOperationExpr_invalidNumericWithNullType() { } @Test - public void lessThanOperationExpr_invalidNullWithNumericBoxedType() { + void lessThanOperationExpr_invalidNullWithNumericBoxedType() { // LHS: Null type, RHS: Numeric box type. // Swap case in "lessThanOperationExpr_invalidNumericTypeWithNullType". ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -966,7 +966,7 @@ public void lessThanOperationExpr_invalidNullWithNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidVoidType() { + void lessThanOperationExpr_invalidVoidType() { // LHS: Null type, RHS: Numeric box type. // No need swap case MethodInvocationExpr lhsExpr = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java index 260c5955f7..cb570034b3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java @@ -16,17 +16,17 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReturnExprTest { +class ReturnExprTest { @Test - public void validReturnExpr_basic() { + void validReturnExpr_basic() { ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); // No exception thrown, we're good. } @Test - public void invalidReturnExpr_nestedReturnExpr() { + void invalidReturnExpr_nestedReturnExpr() { ReturnExpr returnExpr = ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); assertThrows(IllegalStateException.class, () -> ReturnExpr.withExpr(returnExpr)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java index 1f29f92b14..8d7d92db0f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java @@ -16,19 +16,19 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class StringObjectValueTest { +class StringObjectValueTest { @Test - public void createStringObjectValue_basic() { + void createStringObjectValue_basic() { StringObjectValue s = StringObjectValue.builder().setValue("test").build(); assertThat(s.value()).isEqualTo("\"test\""); assertThat(s.type()).isEqualTo(TypeNode.STRING); } @Test - public void createStringObjectValue_escapeCharacter() { + void createStringObjectValue_escapeCharacter() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("\" \t \\ \b \r \f \n '"); String expected = "\"\\\" \\t \\\\ \\b \\r \\f \\n '\""; assertThat(valueSpecialChar.value()).isEqualTo(expected); @@ -36,7 +36,7 @@ public void createStringObjectValue_escapeCharacter() { } @Test - public void createStringObjectValue_specialCharacter() { + void createStringObjectValue_specialCharacter() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("Tom said: \"Hi!\"; \n"); String expected = "\"Tom said: \\\"Hi!\\\"; \\n\""; assertThat(valueSpecialChar.value()).isEqualTo(expected); @@ -44,7 +44,7 @@ public void createStringObjectValue_specialCharacter() { } @Test - public void createStringObjectValue_specialCharacterComment() { + void createStringObjectValue_specialCharacterComment() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("Service comment may include special characters: <>&\"`'@"); String expected = "\"Service comment may include special characters: <>&\\\"`'@\""; @@ -53,7 +53,7 @@ public void createStringObjectValue_specialCharacterComment() { } @Test - public void createStringObjectValue_usPunctuation() { + void createStringObjectValue_usPunctuation() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("US Punctuation, one of !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); String expected = "\"US Punctuation, one of !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\""; @@ -62,7 +62,7 @@ public void createStringObjectValue_usPunctuation() { } @Test - public void createStringObjectValue_htmlCharacterComment() { + void createStringObjectValue_htmlCharacterComment() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("  ( [ – >:<"); String expected = "\"  ( [ – >:<\""; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java index 3c7a264ca9..1e06bec08c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SuperObjectValueTest { +class SuperObjectValueTest { @Test - public void validSuperObjectValue_basic() { + void validSuperObjectValue_basic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -33,7 +33,7 @@ public void validSuperObjectValue_basic() { } @Test - public void invalidSuperObjectValue_nonReferenceType() { + void invalidSuperObjectValue_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -42,7 +42,7 @@ public void invalidSuperObjectValue_nonReferenceType() { } @Test - public void invalidSuperObjectValue_nullType() { + void invalidSuperObjectValue_nullType() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java index f7957d03e3..67a6a1c6c6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SynchronizedStatementTest { +class SynchronizedStatementTest { @Test - public void validSynchronizedStatement_basicThis() { + void validSynchronizedStatement_basicThis() { SynchronizedStatement.builder() .setLock( ThisObjectValue.withType( @@ -31,7 +31,7 @@ public void validSynchronizedStatement_basicThis() { } @Test - public void validSynchronizedStatement_basicVariableExpr() { + void validSynchronizedStatement_basicVariableExpr() { SynchronizedStatement.builder() .setLock( VariableExpr.withVariable( @@ -42,7 +42,7 @@ public void validSynchronizedStatement_basicVariableExpr() { } @Test - public void invalidSynchronizedStatement_primitiveLock() { + void invalidSynchronizedStatement_primitiveLock() { assertThrows( IllegalStateException.class, () -> @@ -57,7 +57,7 @@ public void invalidSynchronizedStatement_primitiveLock() { } @Test - public void invalidSynchronizedStatement_declaredVariableExpr() { + void invalidSynchronizedStatement_declaredVariableExpr() { VariableExpr strVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("str").setType(TypeNode.STRING).build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java index 9cde2c39d3..153fb797ba 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java @@ -17,11 +17,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TernaryExprTest { +class TernaryExprTest { @Test - public void validTernaryExpr_primitiveType() { + void validTernaryExpr_primitiveType() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -43,7 +43,7 @@ public void validTernaryExpr_primitiveType() { } @Test - public void validTernaryExpr_objectType() { + void validTernaryExpr_objectType() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -65,7 +65,7 @@ public void validTernaryExpr_objectType() { } @Test - public void validTernaryExpr_primitiveAndBoxedType() { + void validTernaryExpr_primitiveAndBoxedType() { // [Constructing] `condition ? intValue : integerValue` // The type of whole expression should be Integer. Variable conditionVariable = @@ -88,7 +88,7 @@ public void validTernaryExpr_primitiveAndBoxedType() { } @Test - public void validTernaryExpr_boxedAndPrimitiveType() { + void validTernaryExpr_boxedAndPrimitiveType() { // [Constructing] `condition ? doubleObjectVariable : doubleVariable` // The type of whole expression should be Double. Variable conditionVariable = @@ -112,7 +112,7 @@ public void validTernaryExpr_boxedAndPrimitiveType() { } @Test - public void validTernaryExpr_objectAndNull() { + void validTernaryExpr_objectAndNull() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -126,7 +126,7 @@ public void validTernaryExpr_objectAndNull() { } @Test - public void validTernaryExpr_nullAndObject() { + void validTernaryExpr_nullAndObject() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -140,7 +140,7 @@ public void validTernaryExpr_nullAndObject() { } @Test - public void validTernaryExpr_superAndSubtype() { + void validTernaryExpr_superAndSubtype() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -156,7 +156,7 @@ public void validTernaryExpr_superAndSubtype() { } @Test - public void validTernaryExpr_subAndSupertype() { + void validTernaryExpr_subAndSupertype() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -172,7 +172,7 @@ public void validTernaryExpr_subAndSupertype() { } @Test - public void invalidTernaryExpr_mismatchedPrimitiveTypes() { + void invalidTernaryExpr_mismatchedPrimitiveTypes() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -193,7 +193,7 @@ public void invalidTernaryExpr_mismatchedPrimitiveTypes() { } @Test - public void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { + void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -216,7 +216,7 @@ public void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { } @Test - public void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { + void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { assertThrows( IllegalStateException.class, () -> @@ -238,7 +238,7 @@ public void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { } @Test - public void invalidTernaryExpr_incompatibleThenElseObjectTypes() { + void invalidTernaryExpr_incompatibleThenElseObjectTypes() { assertThrows( IllegalStateException.class, () -> diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java index 83e7c75ab8..870f4fb7af 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ThisObjectValueTest { +class ThisObjectValueTest { @Test - public void validThisObjectValue_basic() { + void validThisObjectValue_basic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -32,7 +32,7 @@ public void validThisObjectValue_basic() { } @Test - public void invalidThisObjectValue_nonReferenceType() { + void invalidThisObjectValue_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -41,7 +41,7 @@ public void invalidThisObjectValue_nonReferenceType() { } @Test - public void invalidThisObjectValue_nullType() { + void invalidThisObjectValue_nullType() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java index cc4b38f3df..e4baf14fc1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java @@ -17,18 +17,18 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ThrowExprTest { +class ThrowExprTest { @Test - public void createThrowExpr_basic() { + void createThrowExpr_basic() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); ThrowExpr.builder().setType(npeType).build(); // No exception thrown, we're good. } @Test - public void createThrowExpr_basicExpr() { + void createThrowExpr_basicExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); VariableExpr throwVarExpr = VariableExpr.builder() @@ -46,14 +46,14 @@ public void createThrowExpr_basicExpr() { } @Test - public void createThrowExpr_basicWithStringMessage() { + void createThrowExpr_basicWithStringMessage() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); ThrowExpr.builder().setType(npeType).setMessageExpr("Some message").build(); // No exception thrown, we're good. } @Test - public void createThrowExpr_messageExpr() { + void createThrowExpr_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -65,14 +65,14 @@ public void createThrowExpr_messageExpr() { } @Test - public void createThrowExpr_badExceptionType() { + void createThrowExpr_badExceptionType() { TypeNode nonExceptionType = TypeNode.STRING; assertThrows( IllegalStateException.class, () -> ThrowExpr.builder().setType(nonExceptionType).build()); } @Test - public void createThrowExpr_badMessageExpr() { + void createThrowExpr_badMessageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder().setMethodName("foobar").setReturnType(TypeNode.INT).build(); @@ -82,7 +82,7 @@ public void createThrowExpr_badMessageExpr() { } @Test - public void createThrowExpr_causeExpr() { + void createThrowExpr_causeExpr() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr.builder() @@ -96,7 +96,7 @@ public void createThrowExpr_causeExpr() { } @Test - public void createThrowExpr_causeExpr_throwableSubtype() { + void createThrowExpr_causeExpr_throwableSubtype() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr.builder() @@ -110,7 +110,7 @@ public void createThrowExpr_causeExpr_throwableSubtype() { } @Test - public void createThrowExpr_causeExpr_onThrowableSubtype() { + void createThrowExpr_causeExpr_onThrowableSubtype() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); assertThrows( @@ -123,7 +123,7 @@ public void createThrowExpr_causeExpr_onThrowableSubtype() { } @Test - public void createThrowExpr_messageAndCauseExpr() { + void createThrowExpr_messageAndCauseExpr() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); Expr messageExpr = @@ -143,7 +143,7 @@ public void createThrowExpr_messageAndCauseExpr() { } @Test - public void createThrowExpr_cannotThrowVariableDeclaration() { + void createThrowExpr_cannotThrowVariableDeclaration() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable( @@ -161,7 +161,7 @@ public void createThrowExpr_cannotThrowVariableDeclaration() { } @Test - public void createThrowExpr_cannotThrowNonExceptionTypedExpr() { + void createThrowExpr_cannotThrowNonExceptionTypedExpr() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("str").setType(TypeNode.STRING).build()) @@ -171,7 +171,7 @@ public void createThrowExpr_cannotThrowNonExceptionTypedExpr() { } @Test - public void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { + void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { Expr messageExpr = MethodInvocationExpr.builder() .setMethodName("foobar") @@ -191,7 +191,7 @@ public void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { } @Test - public void createThrowExpr_cannotHaveThrowVariableAndCauseExprPresent() { + void createThrowExpr_cannotHaveThrowVariableAndCauseExprPresent() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java index 9837c192f5..efa02ee2a8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java @@ -20,12 +20,12 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TryCatchStatementTest { +class TryCatchStatementTest { @Test - public void validTryCatchStatement_simple() { + void validTryCatchStatement_simple() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -41,7 +41,7 @@ public void validTryCatchStatement_simple() { } @Test - public void validTryCatchStatement_simpleMultiBlock() { + void validTryCatchStatement_simpleMultiBlock() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -67,7 +67,7 @@ public void validTryCatchStatement_simpleMultiBlock() { } @Test - public void validTryCatchStatement_withResources() { + void validTryCatchStatement_withResources() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -85,7 +85,7 @@ public void validTryCatchStatement_withResources() { } @Test - public void validTryCatchStatement_sampleCode() { + void validTryCatchStatement_sampleCode() { TryCatchStatement tryCatch = TryCatchStatement.builder() .setTryBody(Arrays.asList(ExprStatement.withExpr(createAssignmentExpr()))) @@ -95,7 +95,7 @@ public void validTryCatchStatement_sampleCode() { } @Test - public void invalidTryCatchStatement_missingCatchVariable() { + void invalidTryCatchStatement_missingCatchVariable() { assertThrows( IllegalStateException.class, () -> @@ -105,7 +105,7 @@ public void invalidTryCatchStatement_missingCatchVariable() { } @Test - public void invalidTryCatchStatement_catchVariableNotDecl() { + void invalidTryCatchStatement_catchVariableNotDecl() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -121,7 +121,7 @@ public void invalidTryCatchStatement_catchVariableNotDecl() { } @Test - public void invalidTryCatchStatement_nonExceptionReference() { + void invalidTryCatchStatement_nonExceptionReference() { Reference exceptionReference = ConcreteReference.withClazz(Integer.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java index 5b80fdedc0..4977a5b877 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java @@ -22,9 +22,9 @@ import com.google.api.generator.engine.ast.TypeNode.TypeKind; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TypeNodeTest { +class TypeNodeTest { private static final TypeNode INT_ARRAY = TypeNode.builder().setTypeKind(TypeKind.INT).setIsArray(true).build(); private static final TypeNode INTEGER_ARRAY = @@ -37,7 +37,7 @@ public class TypeNodeTest { TypeNode.builder().setTypeKind(TypeKind.BOOLEAN).setIsArray(true).build(); @Test - public void strictEquals_basic() { + void strictEquals_basic() { assertFalse(TypeNode.INT.strictEquals(TypeNode.BOOLEAN)); assertFalse(TypeNode.CHAR.strictEquals(TypeNode.NULL)); assertFalse(TypeNode.INT.strictEquals(INT_ARRAY)); @@ -45,7 +45,7 @@ public void strictEquals_basic() { } @Test - public void strictEquals_referenceType() { + void strictEquals_referenceType() { TypeNode list = TypeNode.withReference(ConcreteReference.withClazz(List.class)); TypeNode intList = TypeNode.withReference( @@ -64,7 +64,7 @@ public void strictEquals_referenceType() { } @Test - public void isBoxedTypeEquals_basic() { + void isBoxedTypeEquals_basic() { assertTrue(TypeNode.INT.isBoxedTypeEquals(TypeNode.INT_OBJECT)); assertTrue(TypeNode.DOUBLE_OBJECT.isBoxedTypeEquals(TypeNode.DOUBLE)); assertFalse(TypeNode.BOOLEAN_OBJECT.isBoxedTypeEquals(TypeNode.SHORT)); @@ -73,14 +73,14 @@ public void isBoxedTypeEquals_basic() { } @Test - public void isBoxedTypeEquals_arrayType() { + void isBoxedTypeEquals_arrayType() { assertFalse(TypeNode.INT.isBoxedTypeEquals(INT_ARRAY)); assertFalse(INTEGER_ARRAY.isBoxedTypeEquals(INT_ARRAY)); assertFalse(BOOLEAN_ARRAY.isBoxedTypeEquals(INT_ARRAY)); } @Test - public void equals_basic() { + void equals_basic() { assertTrue(TypeNode.INT.equals(TypeNode.INT_OBJECT)); assertTrue(TypeNode.DOUBLE_OBJECT.equals(TypeNode.DOUBLE)); assertTrue(TypeNode.BOOLEAN.equals(TypeNode.BOOLEAN)); @@ -92,7 +92,7 @@ public void equals_basic() { } @Test - public void type_wildcardGenerics() { + void type_wildcardGenerics() { // No exception thrown equates to success. TypeNode.withReference( ConcreteReference.builder() @@ -102,7 +102,7 @@ public void type_wildcardGenerics() { } @Test - public void type_wildcardUpperBoundGenerics() { + void type_wildcardUpperBoundGenerics() { // No exception thrown equates to success. TypeNode.withReference( ConcreteReference.builder() @@ -114,7 +114,7 @@ public void type_wildcardUpperBoundGenerics() { } @Test - public void compareTypes() { + void compareTypes() { // Primitive and primitive. // Can't compare objects to themselves, so this test is omitted. assertThat(TypeNode.INT.compareTo(TypeNode.BOOLEAN)).isGreaterThan(0); @@ -144,13 +144,13 @@ public void compareTypes() { } @Test - public void invalidType_topLevelWildcard() { + void invalidType_topLevelWildcard() { assertThrows( IllegalStateException.class, () -> TypeNode.withReference(ConcreteReference.wildcard())); } @Test - public void isBoxedType_basic() { + void isBoxedType_basic() { assertTrue(TypeNode.isBoxedType(TypeNode.INT_OBJECT)); assertTrue(TypeNode.isBoxedType(TypeNode.BOOLEAN_OBJECT)); assertTrue(TypeNode.isBoxedType(TypeNode.DOUBLE_OBJECT)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java index b1a45f5312..fc1fecfa2f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class UnaryOperationExprTest { +class UnaryOperationExprTest { /** =============================== Logic Not Operation Expr =============================== */ @Test - public void validLogicalNotOperationExpr_basic() { + void validLogicalNotOperationExpr_basic() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build()); @@ -30,7 +30,7 @@ public void validLogicalNotOperationExpr_basic() { } @Test - public void validLogicalNot_boxedType() { + void validLogicalNot_boxedType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build()); @@ -39,7 +39,7 @@ public void validLogicalNot_boxedType() { } @Test - public void invalidLogicalNot_numericType() { + void invalidLogicalNot_numericType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.INT).build()); assertThrows( @@ -47,7 +47,7 @@ public void invalidLogicalNot_numericType() { } @Test - public void invalidLogicalNot_referenceType() { + void invalidLogicalNot_referenceType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.STRING).build()); assertThrows( @@ -58,7 +58,7 @@ public void invalidLogicalNot_referenceType() { * =============================== Post Increment Operation Expr =============================== */ @Test - public void validPostIncrement_basic() { + void validPostIncrement_basic() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.INT).build()); UnaryOperationExpr.postfixIncrementWithExpr(variableExpr); @@ -66,7 +66,7 @@ public void validPostIncrement_basic() { } @Test - public void validPostIncrement_boxedType() { + void validPostIncrement_boxedType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.FLOAT_OBJECT).build()); @@ -75,7 +75,7 @@ public void validPostIncrement_boxedType() { } @Test - public void invalidPostIncrement_boxedBooleanType() { + void invalidPostIncrement_boxedBooleanType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build()); @@ -85,7 +85,7 @@ public void invalidPostIncrement_boxedBooleanType() { } @Test - public void invalidPostIncrement_referenceType() { + void invalidPostIncrement_referenceType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.STRING).build()); assertThrows( @@ -94,7 +94,7 @@ public void invalidPostIncrement_referenceType() { } @Test - public void invalidPostIncrement_finalVariable() { + void invalidPostIncrement_finalVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setIsFinal(true).setVariable(variable).build(); @@ -104,7 +104,7 @@ public void invalidPostIncrement_finalVariable() { } @Test - public void invalidPostIncrement_declaredVariable() { + void invalidPostIncrement_declaredVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setIsDecl(true).setVariable(variable).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java index 486bc2efab..598a40c087 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java @@ -18,11 +18,11 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VaporReferenceTest { +class VaporReferenceTest { @Test - public void basic() { + void basic() { String pkg = "com.google.example.examples.library.v1"; String name = "Babbage"; Reference ref = VaporReference.builder().setName(name).setPakkage(pkg).build(); @@ -34,7 +34,7 @@ public void basic() { } @Test - public void basic_isStaticImport() { + void basic_isStaticImport() { String pkg = "com.google.example.examples.library.v1"; String name = "Babbage"; Reference ref = @@ -49,7 +49,7 @@ public void basic_isStaticImport() { } @Test - public void basic_nested() { + void basic_nested() { String pkg = "com.google.example.examples.library.v1"; String name = "Charles"; Reference ref = @@ -69,7 +69,7 @@ public void basic_nested() { } @Test - public void basic_nestedAndStaticImport() { + void basic_nestedAndStaticImport() { String pkg = "com.google.example.examples.library.v1"; String name = "Charles"; String enclosingClassName = "Babbage"; @@ -89,7 +89,7 @@ public void basic_nestedAndStaticImport() { } @Test - public void concreteHierarchiesNotHandled() { + void concreteHierarchiesNotHandled() { String pkg = "java.io"; String name = "IOException"; Reference ref = VaporReference.builder().setName(name).setPakkage(pkg).build(); @@ -101,7 +101,7 @@ public void concreteHierarchiesNotHandled() { } @Test - public void enclosingClass() { + void enclosingClass() { String pkg = "java.util"; String enclosingName = "Map"; String name = "Entry"; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java index 43a5fd4f09..08dc046356 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java @@ -19,11 +19,11 @@ import java.util.Arrays; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VariableExprTest { +class VariableExprTest { @Test - public void validVariableExpr_basic() { + void validVariableExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThat(variableExpr.variable()).isEqualTo(variable); @@ -35,7 +35,7 @@ public void validVariableExpr_basic() { } @Test - public void validVariableExpr_staticReference() { + void validVariableExpr_staticReference() { VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.INT).setName("MAX_VALUE").build()) .setStaticReferenceType(TypeNode.INT_OBJECT) @@ -43,7 +43,7 @@ public void validVariableExpr_staticReference() { } @Test - public void validVariableExpr_classFieldOnStaticReference() { + void validVariableExpr_classFieldOnStaticReference() { VariableExpr.builder() .setVariable( Variable.builder() @@ -55,7 +55,7 @@ public void validVariableExpr_classFieldOnStaticReference() { } @Test - public void validVariableExpr_classFieldOnExprReference() { + void validVariableExpr_classFieldOnExprReference() { VariableExpr.builder() .setVariable( Variable.builder() @@ -71,7 +71,7 @@ public void validVariableExpr_classFieldOnExprReference() { } @Test - public void validVariableExpr_withFields() { + void validVariableExpr_withFields() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -89,7 +89,7 @@ public void validVariableExpr_withFields() { } @Test - public void validVariableExpr_declaration() { + void validVariableExpr_declaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -99,7 +99,7 @@ public void validVariableExpr_declaration() { } @Test - public void validVariableExpr_volatileDeclaration() { + void validVariableExpr_volatileDeclaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -118,7 +118,7 @@ public void validVariableExpr_volatileDeclaration() { } @Test - public void validVariableExpr_reference() { + void validVariableExpr_reference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -128,7 +128,7 @@ public void validVariableExpr_reference() { } @Test - public void validVariableExpr_referenceWithModifiersSet() { + void validVariableExpr_referenceWithModifiersSet() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -144,7 +144,7 @@ public void validVariableExpr_referenceWithModifiersSet() { } @Test - public void validVariableExpr_templatedArgInMethod() { + void validVariableExpr_templatedArgInMethod() { Variable variable = Variable.builder() .setName("x") @@ -158,7 +158,7 @@ public void validVariableExpr_templatedArgInMethod() { } @Test - public void validVariableExpr_templatedArgNameAndTypeInMethod() { + void validVariableExpr_templatedArgNameAndTypeInMethod() { Variable variable = Variable.builder() .setName("x") @@ -174,7 +174,7 @@ public void validVariableExpr_templatedArgNameAndTypeInMethod() { } @Test - public void validVariableExpr_declarationWithAnnotations() { + void validVariableExpr_declarationWithAnnotations() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -194,7 +194,7 @@ public void validVariableExpr_declarationWithAnnotations() { } @Test - public void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObject() { + void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObject() { Variable variable = Variable.builder() .setName("x") @@ -210,7 +210,7 @@ public void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObjec } @Test - public void invalidVariableExpr_badTemplateName() { + void invalidVariableExpr_badTemplateName() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); assertThrows( IdentifierNode.InvalidIdentifierException.class, @@ -222,7 +222,7 @@ public void invalidVariableExpr_badTemplateName() { } @Test - public void invalidVariableExpr_referencePrimitiveType() { + void invalidVariableExpr_referencePrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -237,7 +237,7 @@ public void invalidVariableExpr_referencePrimitiveType() { } @Test - public void invalidVariableExpr_referenceAndDecl() { + void invalidVariableExpr_referenceAndDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -253,7 +253,7 @@ public void invalidVariableExpr_referenceAndDecl() { } @Test - public void invalidVariableExpr_exprAndStaticReference() { + void invalidVariableExpr_exprAndStaticReference() { Variable refVariable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); assertThrows( IllegalStateException.class, @@ -266,7 +266,7 @@ public void invalidVariableExpr_exprAndStaticReference() { } @Test - public void invalidVariableExpr_primitiveStaticReference() { + void invalidVariableExpr_primitiveStaticReference() { assertThrows( IllegalStateException.class, () -> @@ -277,7 +277,7 @@ public void invalidVariableExpr_primitiveStaticReference() { } @Test - public void invalidVariableExpr_standaloneClassField() { + void invalidVariableExpr_standaloneClassField() { assertThrows( IllegalStateException.class, () -> @@ -291,7 +291,7 @@ public void invalidVariableExpr_standaloneClassField() { } @Test - public void invalidVariableExpr_classFieldOnPrimitiveType() { + void invalidVariableExpr_classFieldOnPrimitiveType() { assertThrows( IllegalStateException.class, () -> @@ -310,7 +310,7 @@ public void invalidVariableExpr_classFieldOnPrimitiveType() { } @Test - public void invalidVariableExpr_annotationNoDeclaration() { + void invalidVariableExpr_annotationNoDeclaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr.Builder variableExprBuilder = VariableExpr.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java index b11cfd0662..50a752f796 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java @@ -19,11 +19,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VariableTest { +class VariableTest { @Test - public void createVariable_basic() { + void createVariable_basic() { assertValidVariable(TypeKind.INT, "intVar"); assertValidVariable(TypeKind.BOOLEAN, "boolVar"); assertValidVariable(TypeKind.DOUBLE, "doubleVar"); @@ -33,7 +33,7 @@ public void createVariable_basic() { } @Test - public void createVariable_setIdentifier() { + void createVariable_setIdentifier() { IdentifierNode identifierNode = IdentifierNode.builder().setName("x").build(); Variable variable = Variable.builder() @@ -46,7 +46,7 @@ public void createVariable_setIdentifier() { } @Test - public void createVariable_invalidType() { + void createVariable_invalidType() { assertInvalidVariable(TypeNode.VOID); assertInvalidVariable(TypeNode.NULL); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java index ebaedc31ef..82127968c8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java @@ -19,11 +19,11 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class WhileStatementTest { +class WhileStatementTest { @Test - public void validWhileStatement_simple() { + void validWhileStatement_simple() { WhileStatement whileStatement = WhileStatement.builder() .setConditionExpr(createConditionExpr("condition")) @@ -33,7 +33,7 @@ public void validWhileStatement_simple() { } @Test - public void validWhileStatement_booleanObjectCondition() { + void validWhileStatement_booleanObjectCondition() { // The condition expression type can be boolean or its boxed type. VariableExpr condExpr = VariableExpr.withVariable( @@ -47,7 +47,7 @@ public void validWhileStatement_booleanObjectCondition() { } @Test - public void validWhileStatement_nested() { + void validWhileStatement_nested() { WhileStatement nestedWhileStatement = WhileStatement.builder() .setConditionExpr(createConditionExpr("nestedCondition")) @@ -62,7 +62,7 @@ public void validWhileStatement_nested() { } @Test - public void invalidWhileStatement_emptyBody() { + void invalidWhileStatement_emptyBody() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java index 7fb5b1d5a5..2e940c0cc0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java @@ -16,12 +16,12 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class InvalidSymbolTest { +class InvalidSymbolTest { @Test - public void invalidSymbolDetected() { + void invalidSymbolDetected() { assertThat(InvalidSymbol.containsInvalidSymbol("foo")).isFalse(); assertThat(InvalidSymbol.containsInvalidSymbol("foo`foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java index ef5d87e587..cfda620d60 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java @@ -16,11 +16,11 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class KeywordTest { +class KeywordTest { @Test - public void keywordDetected() { + void keywordDetected() { // Modifiers. assertThat(Keyword.isKeyword("static")).isTrue(); assertThat(Keyword.isKeyword("private")).isTrue(); @@ -47,32 +47,32 @@ public void keywordDetected() { } @Test - public void unescapedKeyword_shouldReturnItselfIfEmpty() { + void unescapedKeyword_shouldReturnItselfIfEmpty() { assertThat(Keyword.unescapeKeyword("")).isEqualTo(""); } @Test - public void unescapedKeyword_shouldReturnItselfIfDoesNotEndWithEscapeChar() { + void unescapedKeyword_shouldReturnItselfIfDoesNotEndWithEscapeChar() { assertThat(Keyword.unescapeKeyword("hello")).isEqualTo("hello"); } @Test - public void unescapedKeyword_shouldReturnItselfIfEndsWithEscapeCharButNotAKeyword() { + void unescapedKeyword_shouldReturnItselfIfEndsWithEscapeCharButNotAKeyword() { assertThat(Keyword.unescapeKeyword("important_")).isEqualTo("important_"); } @Test - public void unescapedKeyword_shouldUnescapeIfEndsWithEscapeCharAndAKeyword() { + void unescapedKeyword_shouldUnescapeIfEndsWithEscapeCharAndAKeyword() { assertThat(Keyword.unescapeKeyword("import_")).isEqualTo("import"); } @Test - public void escapeKeyword_shouldEscapeIfIsAKeyword() { + void escapeKeyword_shouldEscapeIfIsAKeyword() { assertThat(Keyword.escapeKeyword("final")).isEqualTo("final_"); } @Test - public void escapeKeyword_shouldNotEscapeIfIsNotAKeyword() { + void escapeKeyword_shouldNotEscapeIfIsNotAKeyword() { assertThat(Keyword.escapeKeyword("fantasy")).isEqualTo("fantasy"); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java index 80b155045e..fe4ee22713 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java @@ -16,17 +16,17 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LiteralTest { +class LiteralTest { @Test - public void booleanDetected() { + void booleanDetected() { assertThat(Literal.isBooleanLiteral("True")).isFalse(); assertThat(Literal.isBooleanLiteral("true")).isTrue(); } @Test - public void nullLDetected() { + void nullLDetected() { assertThat(Literal.isNullLiteral("NULL")).isFalse(); assertThat(Literal.isNullLiteral("null")).isTrue(); assertThat(Literal.isNullLiteral("null_asdf")).isFalse(); @@ -34,7 +34,7 @@ public void nullLDetected() { } @Test - public void integerDetected() { + void integerDetected() { assertThat(Literal.isIntegerLiteral("a123")).isFalse(); assertThat(Literal.isIntegerLiteral("123")).isTrue(); assertThat(Literal.isIntegerLiteral("-123")).isTrue(); @@ -44,7 +44,7 @@ public void integerDetected() { } @Test - public void longDetected() { + void longDetected() { assertThat(Literal.isLongLiteral("123")).isTrue(); assertThat(Literal.isLongLiteral("123L")).isTrue(); assertThat(Literal.isLongLiteral("123l")).isTrue(); @@ -53,7 +53,7 @@ public void longDetected() { } @Test - public void floatDetected() { + void floatDetected() { assertThat(Literal.isFloatLiteral("123")).isTrue(); assertThat(Literal.isFloatLiteral("123f")).isTrue(); assertThat(Literal.isFloatLiteral("123.")).isFalse(); @@ -68,7 +68,7 @@ public void floatDetected() { } @Test - public void doubleDetected() { + void doubleDetected() { assertThat(Literal.isDoubleLiteral("123")).isTrue(); assertThat(Literal.isDoubleLiteral("0.01")).isTrue(); assertThat(Literal.isDoubleLiteral(".01")).isTrue(); @@ -86,7 +86,7 @@ public void doubleDetected() { } @Test - public void literalDetected() { + void literalDetected() { assertThat(Literal.isLiteral("False")).isFalse(); assertThat(Literal.isLiteral("asdf")).isFalse(); assertThat(Literal.isLiteral("asdf12345")).isFalse(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java index 4e89227519..dfcdc5e3fe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java @@ -16,12 +16,12 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class OperatorTest { +class OperatorTest { @Test - public void operatorsDetected() { + void operatorsDetected() { assertThat(Operator.containsOperator("foo")).isFalse(); assertThat(Operator.containsOperator("foo+foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java index 81f6c93f13..96e5bddd7d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java @@ -16,11 +16,11 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SeparatorTest { +class SeparatorTest { @Test - public void separatorTest() { + void separatorTest() { assertThat(Separator.containsSeparator("foo")).isFalse(); assertThat(Separator.containsSeparator("foo.foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java index 4977749e0e..08d00af14d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java @@ -71,22 +71,22 @@ import java.util.Map; import java.util.stream.LongStream; import javax.annotation.Generated; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ImportWriterVisitorTest { +class ImportWriterVisitorTest { private static final String CURRENT_PACKAGE = "com.google.api.generator.engine.foobar"; private static final String CURRENT_CLASS = "SomeClass"; private ImportWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new ImportWriterVisitor(); writerVisitor.initialize(CURRENT_PACKAGE, CURRENT_CLASS); } @Test - public void writeReferenceTypeImports_basic() { + void writeReferenceTypeImports_basic() { TypeNode.withReference(ConcreteReference.withClazz(List.class)).accept(writerVisitor); assertEquals("import java.util.List;\n\n", writerVisitor.write()); @@ -98,7 +98,7 @@ public void writeReferenceTypeImports_basic() { } @Test - public void writeReferenceTypeImports_useFullName() { + void writeReferenceTypeImports_useFullName() { TypeNode.withReference( ConcreteReference.builder().setClazz(List.class).setUseFullName(true).build()) .accept(writerVisitor); @@ -116,7 +116,7 @@ public void writeReferenceTypeImports_useFullName() { } @Test - public void writeNewObjectExprImports_basic() { + void writeNewObjectExprImports_basic() { // [Constructing] `new ArrayList<>()` NewObjectExpr newObjectExpr = NewObjectExpr.builder() @@ -128,7 +128,7 @@ public void writeNewObjectExprImports_basic() { } @Test - public void writeNewObjectExprImports_withArgs() { + void writeNewObjectExprImports_withArgs() { // [Constructing] `new FileOutputStream(File file)` and the argument needs to be imported. ConcreteReference fileOutputStreamRef = ConcreteReference.withClazz(FileOutputStream.class); ConcreteReference fileRef = ConcreteReference.withClazz(File.class); @@ -147,7 +147,7 @@ public void writeNewObjectExprImports_withArgs() { } @Test - public void writeNewObjectExprImports_genericsAndVariableArgs() { + void writeNewObjectExprImports_genericsAndVariableArgs() { // [Constructing] `new HashMap, Integer>>(int initialCapacity, float loadFactor)` ConcreteReference listRef = ConcreteReference.builder() @@ -179,7 +179,7 @@ public void writeNewObjectExprImports_genericsAndVariableArgs() { } @Test - public void writeNewObjectExprImports_methodExprArg() { + void writeNewObjectExprImports_methodExprArg() { // [Constructing] `new IOException(message, cause(mapArg))` and `cause(mapArg)` is a method // invocation with a `HashMap` argument. TypeNode exceptionType = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); @@ -208,7 +208,7 @@ public void writeNewObjectExprImports_methodExprArg() { } @Test - public void writeTernaryExprImports() { + void writeTernaryExprImports() { MethodInvocationExpr conditionExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -246,7 +246,7 @@ public void writeTernaryExprImports() { } @Test - public void writeVariableExprImports_staticReference() { + void writeVariableExprImports_staticReference() { VariableExpr variableExpr = VariableExpr.builder() .setVariable( @@ -268,7 +268,7 @@ public void writeVariableExprImports_staticReference() { } @Test - public void writeVariableExprImports_wildcardType() { + void writeVariableExprImports_wildcardType() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -286,7 +286,7 @@ public void writeVariableExprImports_wildcardType() { } @Test - public void writeVariableExprImport_wildcardTypeWithUpperBound() { + void writeVariableExprImport_wildcardTypeWithUpperBound() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -310,7 +310,7 @@ public void writeVariableExprImport_wildcardTypeWithUpperBound() { } @Test - public void writeVariableExprImports_reference() { + void writeVariableExprImports_reference() { Variable variable = Variable.builder() .setName("expr") @@ -334,7 +334,7 @@ public void writeVariableExprImports_reference() { } @Test - public void writeVariableExprImports_nestedReference() { + void writeVariableExprImports_nestedReference() { Variable variable = Variable.builder() .setName("expr") @@ -367,7 +367,7 @@ public void writeVariableExprImports_nestedReference() { } @Test - public void writeVariableExprImports_withAnnotations() { + void writeVariableExprImports_withAnnotations() { Variable variable = Variable.builder() .setName("expr") @@ -393,7 +393,7 @@ public void writeVariableExprImports_withAnnotations() { } @Test - public void writeVariableExprImports_annotationsWithDescription() { + void writeVariableExprImports_annotationsWithDescription() { Variable variable = Variable.builder() .setName("expr") @@ -430,7 +430,7 @@ public void writeVariableExprImports_annotationsWithDescription() { } @Test - public void writeVaporReferenceImport_outermostForNestedClass() { + void writeVaporReferenceImport_outermostForNestedClass() { VaporReference nestedVaporReference = VaporReference.builder() .setName("Inner") @@ -443,7 +443,7 @@ public void writeVaporReferenceImport_outermostForNestedClass() { } @Test - public void writeConcreteReferenceImport_outermostForNestedClass() { + void writeConcreteReferenceImport_outermostForNestedClass() { ConcreteReference nestedConcreteReference = ConcreteReference.withClazz(Outer.Middle.Inner.class); TypeNode.withReference(nestedConcreteReference).accept(writerVisitor); @@ -451,7 +451,7 @@ public void writeConcreteReferenceImport_outermostForNestedClass() { } @Test - public void writeAnonymousClassExprImports() { + void writeAnonymousClassExprImports() { // [Constructing] Function, MethodDefinition> ConcreteReference exceptionListRef = ConcreteReference.builder() @@ -526,7 +526,7 @@ public void writeAnonymousClassExprImports() { } @Test - public void writeThrowExprImports_basic() { + void writeThrowExprImports_basic() { TypeNode exceptionTypes = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); String message = "Some message asdf"; @@ -537,7 +537,7 @@ public void writeThrowExprImports_basic() { } @Test - public void writeThrowExprImports_throwExpr() { + void writeThrowExprImports_throwExpr() { Expr exprToThrow = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -557,7 +557,7 @@ public void writeThrowExprImports_throwExpr() { } @Test - public void writeThrowExprImports_messageExpr() { + void writeThrowExprImports_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -584,7 +584,7 @@ public void writeThrowExprImports_messageExpr() { } @Test - public void writeThrowExprImports_messageAndCauseExpr() { + void writeThrowExprImports_messageAndCauseExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -620,7 +620,7 @@ public void writeThrowExprImports_messageAndCauseExpr() { } @Test - public void writeInstanceofExprImports_basic() { + void writeInstanceofExprImports_basic() { TypeNode exprType = TypeNode.withReference(ConcreteReference.withClazz(Expr.class)); TypeNode assignExprType = TypeNode.withReference(ConcreteReference.withClazz(AssignmentExpr.class)); @@ -639,7 +639,7 @@ public void writeInstanceofExprImports_basic() { } @Test - public void writeEnumRefExprImports_basic() { + void writeEnumRefExprImports_basic() { TypeNode enumType = TypeNode.withReference( ConcreteReference.builder() @@ -655,7 +655,7 @@ public void writeEnumRefExprImports_basic() { } @Test - public void writeEnumRefExprImports_nested() { + void writeEnumRefExprImports_nested() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr enumRefExpr = EnumRefExpr.builder().setName("VOID").setType(enumType).build(); @@ -664,7 +664,7 @@ public void writeEnumRefExprImports_nested() { } @Test - public void writeReturnExprImports_basic() { + void writeReturnExprImports_basic() { ReturnExpr returnExpr = ReturnExpr.withExpr( MethodInvocationExpr.builder() @@ -676,7 +676,7 @@ public void writeReturnExprImports_basic() { } @Test - public void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { + void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = Arrays.asList( @@ -718,7 +718,7 @@ public void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { } @Test - public void writeReferenceConstructorExprImports_basic() { + void writeReferenceConstructorExprImports_basic() { VaporReference ref = VaporReference.builder().setName("Parent").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -729,7 +729,7 @@ public void writeReferenceConstructorExprImports_basic() { } @Test - public void writeReferenceConstructorExprImports_withArgs() { + void writeReferenceConstructorExprImports_withArgs() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -749,7 +749,7 @@ public void writeReferenceConstructorExprImports_withArgs() { } @Test - public void writeArithmeticOperationExprImports() { + void writeArithmeticOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -764,7 +764,7 @@ public void writeArithmeticOperationExprImports() { } @Test - public void writeSynchronizedStatementImports_basicThis() { + void writeSynchronizedStatementImports_basicThis() { SynchronizedStatement synchronizedStatement = SynchronizedStatement.builder() .setLock( @@ -786,7 +786,7 @@ public void writeSynchronizedStatementImports_basicThis() { } @Test - public void writeSuperObjectValueImports() { + void writeSuperObjectValueImports() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -805,7 +805,7 @@ public void writeSuperObjectValueImports() { } @Test - public void writeSynchronizedStatementImports_basicVariableExpr() { + void writeSynchronizedStatementImports_basicVariableExpr() { VariableExpr strVarExpr = VariableExpr.withVariable( Variable.builder() @@ -833,7 +833,7 @@ public void writeSynchronizedStatementImports_basicVariableExpr() { } @Test - public void writeUnaryOperationExprImports_LogicalNot() { + void writeUnaryOperationExprImports_LogicalNot() { MethodInvocationExpr expr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -846,7 +846,7 @@ public void writeUnaryOperationExprImports_LogicalNot() { } @Test - public void writeUnaryOperationExprImports_PostIncrement() { + void writeUnaryOperationExprImports_PostIncrement() { MethodInvocationExpr expr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -859,7 +859,7 @@ public void writeUnaryOperationExprImports_PostIncrement() { } @Test - public void writeRelationalOperationExprImports() { + void writeRelationalOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -889,7 +889,7 @@ public void writeRelationalOperationExprImports() { } @Test - public void writeLogicalOperationExprImports() { + void writeLogicalOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -908,14 +908,14 @@ public void writeLogicalOperationExprImports() { } @Test - public void writeEmptyLineStatementImports() { + void writeEmptyLineStatementImports() { EmptyLineStatement statement = EmptyLineStatement.create(); statement.accept(writerVisitor); assertThat(writerVisitor.write()).isEmpty(); } @Test - public void writePackageInfoDefinitionImports() { + void writePackageInfoDefinitionImports() { PackageInfoDefinition packageInfo = PackageInfoDefinition.builder() .setPakkage("com.google.example.library.v1") @@ -935,7 +935,7 @@ public void writePackageInfoDefinitionImports() { } @Test - public void writeLambdaExprImports() { + void writeLambdaExprImports() { // Similar to method defnitions. Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = @@ -981,7 +981,7 @@ public void writeLambdaExprImports() { } @Test - public void importArrayExprTypes() { + void importArrayExprTypes() { ArrayExpr arrayExpr = ArrayExpr.builder() .setType( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java index e538b11cc7..d9a38d8d7f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java @@ -90,26 +90,26 @@ import java.util.Map; import java.util.concurrent.TimeoutException; import javax.annotation.Generated; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class JavaWriterVisitorTest { +class JavaWriterVisitorTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void writeIdentifier() { + void writeIdentifier() { String idName = "foobar"; IdentifierNode.builder().setName(idName).build().accept(writerVisitor); assertEquals(idName, writerVisitor.write()); } @Test - public void writePrimitiveType() { + void writePrimitiveType() { TypeNode intType = TypeNode.INT; assertThat(intType).isNotNull(); intType.accept(writerVisitor); @@ -117,7 +117,7 @@ public void writePrimitiveType() { } @Test - public void writePrimitiveArrayType() { + void writePrimitiveArrayType() { TypeNode byteArrayType = TypeNode.builder().setTypeKind(TypeNode.TypeKind.BYTE).setIsArray(true).build(); assertThat(byteArrayType).isNotNull(); @@ -126,7 +126,7 @@ public void writePrimitiveArrayType() { } @Test - public void writeReferenceType_basic() { + void writeReferenceType_basic() { TypeNode.withReference(ConcreteReference.withClazz(List.class)).accept(writerVisitor); assertEquals("List", writerVisitor.write()); @@ -138,7 +138,7 @@ public void writeReferenceType_basic() { } @Test - public void writeVaporReferenceType_nestedClasses() { + void writeVaporReferenceType_nestedClasses() { VaporReference nestedVaporReference = VaporReference.builder() .setName("Inner") @@ -150,7 +150,7 @@ public void writeVaporReferenceType_nestedClasses() { } @Test - public void writeConcreteReferenceType_nestedClasses() { + void writeConcreteReferenceType_nestedClasses() { ConcreteReference nestedConcreteReference = ConcreteReference.withClazz(Outer.Middle.Inner.class); TypeNode.withReference(nestedConcreteReference).accept(writerVisitor); @@ -158,7 +158,7 @@ public void writeConcreteReferenceType_nestedClasses() { } @Test - public void writeReferenceType_useFullName() { + void writeReferenceType_useFullName() { TypeNode.withReference( ConcreteReference.builder().setClazz(List.class).setUseFullName(true).build()) .accept(writerVisitor); @@ -176,21 +176,21 @@ public void writeReferenceType_useFullName() { } @Test - public void writeAnnotation_simple() { + void writeAnnotation_simple() { AnnotationNode annotation = AnnotationNode.OVERRIDE; annotation.accept(writerVisitor); assertEquals("@Override\n", writerVisitor.write()); } @Test - public void writeAnnotation_withStringDescription() { + void writeAnnotation_withStringDescription() { AnnotationNode annotation = AnnotationNode.withSuppressWarnings("all"); annotation.accept(writerVisitor); assertEquals("@SuppressWarnings(\"all\")\n", writerVisitor.write()); } @Test - public void writeAnnotation_withValueDescription() { + void writeAnnotation_withValueDescription() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -206,7 +206,7 @@ public void writeAnnotation_withValueDescription() { } @Test - public void writeAnnotation_withVariableExprDescription() { + void writeAnnotation_withVariableExprDescription() { TypeNode conditionalOnPropertyType = TypeNode.withReference( VaporReference.builder() @@ -235,7 +235,7 @@ public void writeAnnotation_withVariableExprDescription() { } @Test - public void writeAnnotation_withMultipleNamedDescriptions() { + void writeAnnotation_withMultipleNamedDescriptions() { TypeNode conditionalOnPropertyType = TypeNode.withReference( VaporReference.builder() @@ -274,7 +274,7 @@ public void writeAnnotation_withMultipleNamedDescriptions() { } @Test - public void writeAnnotation_withInvalidDescriptions() { + void writeAnnotation_withInvalidDescriptions() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -339,7 +339,7 @@ public void writeAnnotation_withInvalidDescriptions() { } @Test - public void writeAnnotation_withArrayExpr() { + void writeAnnotation_withArrayExpr() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -358,7 +358,7 @@ public void writeAnnotation_withArrayExpr() { } @Test - public void writeAnnotation_withArrayExprAssignment() { + void writeAnnotation_withArrayExprAssignment() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -404,7 +404,7 @@ public void writeAnnotation_withArrayExprAssignment() { } @Test - public void writeArrayExpr_add1StringExpr() { + void writeArrayExpr_add1StringExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) @@ -415,7 +415,7 @@ public void writeArrayExpr_add1StringExpr() { } @Test - public void writeArrayExpr_addManyStrExpr() { + void writeArrayExpr_addManyStrExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) @@ -428,7 +428,7 @@ public void writeArrayExpr_addManyStrExpr() { } @Test - public void writeArrayExpr_addManyClassExpr() { + void writeArrayExpr_addManyClassExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.CLASS_OBJECT)) @@ -441,7 +441,7 @@ public void writeArrayExpr_addManyClassExpr() { } @Test - public void writeArrayExpr_mixedVariablesStaticAndNormalReference() { + void writeArrayExpr_mixedVariablesStaticAndNormalReference() { VariableExpr clazzVar = VariableExpr.builder() .setVariable( @@ -458,7 +458,7 @@ public void writeArrayExpr_mixedVariablesStaticAndNormalReference() { } @Test - public void writeArrayExpr_assignemntWithDeclaration() { + void writeArrayExpr_assignemntWithDeclaration() { VariableExpr varExpr = VariableExpr.builder() .setVariable( @@ -481,7 +481,7 @@ public void writeArrayExpr_assignemntWithDeclaration() { } @Test - public void writeNewObjectExpr_basic() { + void writeNewObjectExpr_basic() { // isGeneric() is true, but generics() is empty. ConcreteReference ref = ConcreteReference.withClazz(List.class); TypeNode type = TypeNode.withReference(ref); @@ -491,7 +491,7 @@ public void writeNewObjectExpr_basic() { } @Test - public void writeNewObjectExpr_withMethodExprArgs() { + void writeNewObjectExpr_withMethodExprArgs() { // isGeneric() is false, and generics() is empty. // [Constructing] `new IOException(message, cause())` and `cause()` is a method invocation. TypeNode type = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); @@ -512,7 +512,7 @@ public void writeNewObjectExpr_withMethodExprArgs() { } @Test - public void writeNewObjectExpr_withGenericsAndArgs() { + void writeNewObjectExpr_withGenericsAndArgs() { // isGeneric() is true and generics() is not empty. ConcreteReference listRef = ConcreteReference.builder() @@ -553,7 +553,7 @@ public void writeNewObjectExpr_withGenericsAndArgs() { /** =============================== EXPRESSIONS =============================== */ @Test - public void writeValueExpr() { + void writeValueExpr() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); valueExpr.accept(writerVisitor); @@ -561,7 +561,7 @@ public void writeValueExpr() { } @Test - public void writeVariableExpr_basic() { + void writeVariableExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -570,7 +570,7 @@ public void writeVariableExpr_basic() { } @Test - public void writeVariableExpr_wildcardType() { + void writeVariableExpr_wildcardType() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -587,7 +587,7 @@ public void writeVariableExpr_wildcardType() { } @Test - public void writeVariableExpr_wildcardTypeWithUpperBound() { + void writeVariableExpr_wildcardTypeWithUpperBound() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -607,7 +607,7 @@ public void writeVariableExpr_wildcardTypeWithUpperBound() { } @Test - public void writeVariableExpr_staticReference() { + void writeVariableExpr_staticReference() { VariableExpr variableExpr = VariableExpr.builder() .setVariable( @@ -620,7 +620,7 @@ public void writeVariableExpr_staticReference() { } @Test - public void writeVariableExpr_nonDeclIgnoresModifiers() { + void writeVariableExpr_nonDeclIgnoresModifiers() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -635,7 +635,7 @@ public void writeVariableExpr_nonDeclIgnoresModifiers() { } @Test - public void writeVariableExpr_basicLocalDecl() { + void writeVariableExpr_basicLocalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr expr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -644,7 +644,7 @@ public void writeVariableExpr_basicLocalDecl() { } @Test - public void writeVariableExpr_localFinalDecl() { + void writeVariableExpr_localFinalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = @@ -655,7 +655,7 @@ public void writeVariableExpr_localFinalDecl() { } @Test - public void writeVariableExpr_scopedDecl() { + void writeVariableExpr_scopedDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr expr = VariableExpr.builder() @@ -669,7 +669,7 @@ public void writeVariableExpr_scopedDecl() { } @Test - public void writeVariableExpr_scopedStaticFinalDecl() { + void writeVariableExpr_scopedStaticFinalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -685,7 +685,7 @@ public void writeVariableExpr_scopedStaticFinalDecl() { } @Test - public void writeVariableExpr_scopedStaticFinalVolatileDecl() { + void writeVariableExpr_scopedStaticFinalVolatileDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -702,7 +702,7 @@ public void writeVariableExpr_scopedStaticFinalVolatileDecl() { } @Test - public void writeVariableExpr_basicReference() { + void writeVariableExpr_basicReference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -714,7 +714,7 @@ public void writeVariableExpr_basicReference() { } @Test - public void writeVariableExpr_basicReferenceWithModifiersSet() { + void writeVariableExpr_basicReferenceWithModifiersSet() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -732,7 +732,7 @@ public void writeVariableExpr_basicReferenceWithModifiersSet() { } @Test - public void writeVariableExpr_nestedReference() { + void writeVariableExpr_nestedReference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -751,7 +751,7 @@ public void writeVariableExpr_nestedReference() { } @Test - public void writeArithmeticOperationExpr_concatStringWithMethod() { + void writeArithmeticOperationExpr_concatStringWithMethod() { ValueExpr lhsExpr = ValueExpr.withValue(StringObjectValue.withValue("someWord")); MethodInvocationExpr methodInvocationExpr = MethodInvocationExpr.builder().setMethodName("getMethod").build(); @@ -768,7 +768,7 @@ public void writeArithmeticOperationExpr_concatStringWithMethod() { } @Test - public void writeArithmeticOperationExpr_concatStringWithNumber() { + void writeArithmeticOperationExpr_concatStringWithNumber() { ValueExpr rhsExpr = ValueExpr.withValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build()); ValueExpr lhsExpr = ValueExpr.withValue(StringObjectValue.withValue("someWord")); @@ -780,7 +780,7 @@ public void writeArithmeticOperationExpr_concatStringWithNumber() { /** =============================== COMMENT =============================== */ @Test - public void writeBlockCommentStatement_basic() { + void writeBlockCommentStatement_basic() { String content = "this is a test comment"; BlockComment blockComment = BlockComment.builder().setComment(content).build(); CommentStatement commentStatement = CommentStatement.withComment(blockComment); @@ -790,7 +790,7 @@ public void writeBlockCommentStatement_basic() { } @Test - public void writeLineCommentStatement_basic() { + void writeLineCommentStatement_basic() { String content = "this is a test comment"; LineComment lineComment = LineComment.builder().setComment(content).build(); CommentStatement commentStatement = CommentStatement.withComment(lineComment); @@ -800,7 +800,7 @@ public void writeLineCommentStatement_basic() { } @Test - public void writeJavaDocCommentStatement_allComponents() { + void writeJavaDocCommentStatement_allComponents() { String content = "this is a test comment"; String deprecatedText = "Use the {@link ArchivedBookName} class instead."; String paramName = "shelfName"; @@ -861,7 +861,7 @@ public void writeJavaDocCommentStatement_allComponents() { } @Test - public void writeBlockComment_shortLines() { + void writeBlockComment_shortLines() { String content = "Apache License \nThis is a test file header"; BlockComment blockComment = BlockComment.builder().setComment(content).build(); String expected = @@ -871,7 +871,7 @@ public void writeBlockComment_shortLines() { } @Test - public void writeBlockComment_newLineInBetween() { + void writeBlockComment_newLineInBetween() { String content = "Apache License \n" + "Licensed under the Apache License, Version 2.0 (the \"License\");\n\n" @@ -890,7 +890,7 @@ public void writeBlockComment_newLineInBetween() { } @Test - public void writeLineComment_longLine() { + void writeLineComment_longLine() { String content = "this is a long test comment with so many words, hello world, hello again, hello for 3" + " times, blah, blah!"; @@ -905,7 +905,7 @@ public void writeLineComment_longLine() { } @Test - public void writeLineComment_specialChar() { + void writeLineComment_specialChar() { String content = "usage: gradle run -PmainClass=com.google.example.examples.library.v1.Hopper" + " [--args='[--shelf \"Novel\\\"`\b\t\n\r" @@ -923,7 +923,7 @@ public void writeLineComment_specialChar() { } @Test - public void writeJavaDocComment_specialChar() { + void writeJavaDocComment_specialChar() { // Only comments and sample codes in JavaDocComment need this escaper. //

    • are hard-coded in monolith generator, which do not need escaping. JavaDocComment javaDocComment = @@ -962,7 +962,7 @@ public void writeJavaDocComment_specialChar() { } @Test - public void writeFailingComment_specialChar() { + void writeFailingComment_specialChar() { JavaDocComment javaDocComment = JavaDocComment.builder() .addUnescapedComment( @@ -981,7 +981,7 @@ public void writeFailingComment_specialChar() { } @Test - public void writeTernaryExpr_basic() { + void writeTernaryExpr_basic() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -1002,7 +1002,7 @@ public void writeTernaryExpr_basic() { } @Test - public void writeAssignmentExpr_basicValue() { + void writeAssignmentExpr_basicValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1018,7 +1018,7 @@ public void writeAssignmentExpr_basicValue() { } @Test - public void writeAssignmentExpr_varToVar() { + void writeAssignmentExpr_varToVar() { Variable variable = Variable.builder().setName("foobar").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -1040,7 +1040,7 @@ public void writeAssignmentExpr_varToVar() { } @Test - public void writeAssignmentExpr_nullObjectValueReferenceType() { + void writeAssignmentExpr_nullObjectValueReferenceType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1056,7 +1056,7 @@ public void writeAssignmentExpr_nullObjectValueReferenceType() { } @Test - public void writeStringObjectValue_basic() { + void writeStringObjectValue_basic() { Value value = StringObjectValue.withValue("test"); Expr valueExpr = ValueExpr.builder().setValue(value).build(); valueExpr.accept(writerVisitor); @@ -1064,7 +1064,7 @@ public void writeStringObjectValue_basic() { } @Test - public void writeAssignmentExpr_stringObjectValue() { + void writeAssignmentExpr_stringObjectValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1079,7 +1079,7 @@ public void writeAssignmentExpr_stringObjectValue() { } @Test - public void writeAssignmentExpr_variableDeclarationWithAnnotation() { + void writeAssignmentExpr_variableDeclarationWithAnnotation() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -1098,7 +1098,7 @@ public void writeAssignmentExpr_variableDeclarationWithAnnotation() { } @Test - public void writeMethodInvocationExpr_basic() { + void writeMethodInvocationExpr_basic() { MethodInvocationExpr methodExpr = MethodInvocationExpr.builder().setMethodName("foobar").build(); @@ -1107,7 +1107,7 @@ public void writeMethodInvocationExpr_basic() { } @Test - public void writeMethodInvocationExpr_staticRef() { + void writeMethodInvocationExpr_staticRef() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1126,7 +1126,7 @@ public void writeMethodInvocationExpr_staticRef() { } @Test - public void writeMethodInvocationExpr_genericWithArgs() { + void writeMethodInvocationExpr_genericWithArgs() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -1173,7 +1173,7 @@ public void writeMethodInvocationExpr_genericWithArgs() { } @Test - public void writeMethodInvocationExpr_chained() { + void writeMethodInvocationExpr_chained() { Variable variable = Variable.builder().setType(TypeNode.INT).setName("libraryClient").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); @@ -1199,7 +1199,7 @@ public void writeMethodInvocationExpr_chained() { } @Test - public void writeCastExpr_basic() { + void writeCastExpr_basic() { Variable variable = Variable.builder().setType(TypeNode.STRING).setName("str").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr castExpr = @@ -1212,7 +1212,7 @@ public void writeCastExpr_basic() { } @Test - public void writeCastExpr_methodInvocation() { + void writeCastExpr_methodInvocation() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1236,7 +1236,7 @@ public void writeCastExpr_methodInvocation() { } @Test - public void writeCastExpr_nested() { + void writeCastExpr_nested() { Variable variable = Variable.builder().setType(TypeNode.STRING).setName("str").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr castExpr = @@ -1250,7 +1250,7 @@ public void writeCastExpr_nested() { } @Test - public void writeAnonymousClassExpr_basic() { + void writeAnonymousClassExpr_basic() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); AssignmentExpr assignmentExpr = createAssignmentExpr("foobar", "false", TypeNode.BOOLEAN); @@ -1277,7 +1277,7 @@ public void writeAnonymousClassExpr_basic() { } @Test - public void writeAnonymousClassExpr_withStatementsMethods() { + void writeAnonymousClassExpr_withStatementsMethods() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); // [Constructing] private static final String s = "foo"; @@ -1322,7 +1322,7 @@ public void writeAnonymousClassExpr_withStatementsMethods() { } @Test - public void writeAnonymousClassExpr_generics() { + void writeAnonymousClassExpr_generics() { // [Constructing] Function, MethodDefinition> ConcreteReference exceptionListRef = ConcreteReference.builder() @@ -1378,7 +1378,7 @@ public void writeAnonymousClassExpr_generics() { } @Test - public void writeThrowExpr_basic() { + void writeThrowExpr_basic() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr throwExpr = ThrowExpr.builder().setType(npeType).build(); @@ -1387,7 +1387,7 @@ public void writeThrowExpr_basic() { } @Test - public void writeThrowExpr_basicThrowExpr() { + void writeThrowExpr_basicThrowExpr() { Expr exprToThrow = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -1402,7 +1402,7 @@ public void writeThrowExpr_basicThrowExpr() { } @Test - public void writeThrowExpr_basicWithMessage() { + void writeThrowExpr_basicWithMessage() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); String message = "Some message asdf"; @@ -1412,7 +1412,7 @@ public void writeThrowExpr_basicWithMessage() { } @Test - public void writeThrowExpr_basicWithCause() { + void writeThrowExpr_basicWithCause() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr throwExpr = @@ -1428,7 +1428,7 @@ public void writeThrowExpr_basicWithCause() { } @Test - public void writeThrowExpr_messageExpr() { + void writeThrowExpr_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -1442,7 +1442,7 @@ public void writeThrowExpr_messageExpr() { } @Test - public void writeThrowExpr_messageAndCauseExpr() { + void writeThrowExpr_messageAndCauseExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -1465,7 +1465,7 @@ public void writeThrowExpr_messageAndCauseExpr() { } @Test - public void writeInstanceofExpr() { + void writeInstanceofExpr() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr instanceofExpr = @@ -1475,7 +1475,7 @@ public void writeInstanceofExpr() { } @Test - public void writeEnumRefExpr_basic() { + void writeEnumRefExpr_basic() { TypeNode enumType = TypeNode.withReference( ConcreteReference.builder() @@ -1489,7 +1489,7 @@ public void writeEnumRefExpr_basic() { } @Test - public void writeEnumRefExpr_nested() { + void writeEnumRefExpr_nested() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr enumRefExpr = EnumRefExpr.builder().setName("VOID").setType(enumType).build(); @@ -1498,7 +1498,7 @@ public void writeEnumRefExpr_nested() { } @Test - public void writeReturnExpr_basic() { + void writeReturnExpr_basic() { ReturnExpr returnExpr = ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); returnExpr.accept(writerVisitor); @@ -1507,7 +1507,7 @@ public void writeReturnExpr_basic() { /** =============================== STATEMENTS =============================== */ @Test - public void writeExprStatement() { + void writeExprStatement() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1527,14 +1527,14 @@ public void writeExprStatement() { } @Test - public void writeBlockStatement_empty() { + void writeBlockStatement_empty() { BlockStatement blockStatement = BlockStatement.builder().build(); blockStatement.accept(writerVisitor); assertEquals("{\n}\n", writerVisitor.write()); } @Test - public void writeBlockStatement_simple() { + void writeBlockStatement_simple() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1555,7 +1555,7 @@ public void writeBlockStatement_simple() { } @Test - public void writeBlockStatement_static() { + void writeBlockStatement_static() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1581,7 +1581,7 @@ public void writeBlockStatement_static() { } @Test - public void writeIfStatement_simple() { + void writeIfStatement_simple() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List ifBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1597,7 +1597,7 @@ public void writeIfStatement_simple() { } @Test - public void writeIfStatement_withElse() { + void writeIfStatement_withElse() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List ifBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1625,7 +1625,7 @@ public void writeIfStatement_withElse() { } @Test - public void writeIfStatement_elseIfs() { + void writeIfStatement_elseIfs() { List ifBody = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr("x", "3", TypeNode.INT)), @@ -1666,7 +1666,7 @@ public void writeIfStatement_elseIfs() { } @Test - public void writeIfStatement_nested() { + void writeIfStatement_nested() { List ifBody = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr("x", "3", TypeNode.INT)), @@ -1729,7 +1729,7 @@ public void writeIfStatement_nested() { } @Test - public void writeWhileStatement_simple() { + void writeWhileStatement_simple() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List whileBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1745,7 +1745,7 @@ public void writeWhileStatement_simple() { } @Test - public void writeForStatement() { + void writeForStatement() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1769,7 +1769,7 @@ public void writeForStatement() { } @Test - public void writeGeneralForStatement_basicIsDecl() { + void writeGeneralForStatement_basicIsDecl() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1792,7 +1792,7 @@ public void writeGeneralForStatement_basicIsDecl() { } @Test - public void writeGeneralForStatement_basicIsNotDecl() { + void writeGeneralForStatement_basicIsNotDecl() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1814,7 +1814,7 @@ public void writeGeneralForStatement_basicIsNotDecl() { } @Test - public void writeTryCatchStatement_simple() { + void writeTryCatchStatement_simple() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1836,7 +1836,7 @@ public void writeTryCatchStatement_simple() { } @Test - public void writeTryCatchStatement_simpleMultiCatch() { + void writeTryCatchStatement_simpleMultiCatch() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -1869,7 +1869,7 @@ public void writeTryCatchStatement_simpleMultiCatch() { } @Test - public void writeTryCatchStatement_simpleMultiCatchOrderMatters() { + void writeTryCatchStatement_simpleMultiCatchOrderMatters() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -1902,7 +1902,7 @@ public void writeTryCatchStatement_simpleMultiCatchOrderMatters() { } @Test - public void writeTryCatchStatement_withResources() { + void writeTryCatchStatement_withResources() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1932,7 +1932,7 @@ public void writeTryCatchStatement_withResources() { } @Test - public void writeTryCatchStatement_sampleCodeNoCatch() { + void writeTryCatchStatement_sampleCodeNoCatch() { TryCatchStatement tryCatch = TryCatchStatement.builder() .setTryBody( @@ -1945,7 +1945,7 @@ public void writeTryCatchStatement_sampleCodeNoCatch() { } @Test - public void writeTryCatchStatement_sampleCodeWithCatch() { + void writeTryCatchStatement_sampleCodeWithCatch() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1976,7 +1976,7 @@ public void writeTryCatchStatement_sampleCodeWithCatch() { } @Test - public void writeSynchronizedStatement_basicThis() { + void writeSynchronizedStatement_basicThis() { SynchronizedStatement synchronizedStatement = SynchronizedStatement.builder() .setLock( @@ -1993,7 +1993,7 @@ public void writeSynchronizedStatement_basicThis() { } @Test - public void writeSynchronizedStatement_basicVariableExpr() { + void writeSynchronizedStatement_basicVariableExpr() { VariableExpr strVarExpr = VariableExpr.withVariable( Variable.builder().setName("str").setType(TypeNode.STRING).build()); @@ -2012,7 +2012,7 @@ public void writeSynchronizedStatement_basicVariableExpr() { } @Test - public void writeMethodDefinition_basic() { + void writeMethodDefinition_basic() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2029,7 +2029,7 @@ public void writeMethodDefinition_basic() { } @Test - public void writeMethodDefinition_constructor() { + void writeMethodDefinition_constructor() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -2047,7 +2047,7 @@ public void writeMethodDefinition_constructor() { } @Test - public void writeMethodDefinition_basicEmptyBody() { + void writeMethodDefinition_basicEmptyBody() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2060,7 +2060,7 @@ public void writeMethodDefinition_basicEmptyBody() { } @Test - public void writeMethodDefinition_basicAbstract() { + void writeMethodDefinition_basicAbstract() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2078,7 +2078,7 @@ public void writeMethodDefinition_basicAbstract() { } @Test - public void writeMethodDefinition_basicAbstractEmptyBody() { + void writeMethodDefinition_basicAbstractEmptyBody() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2092,7 +2092,7 @@ public void writeMethodDefinition_basicAbstractEmptyBody() { } @Test - public void writeMethodDefinition_withArgumentsAndReturnExpr() { + void writeMethodDefinition_withArgumentsAndReturnExpr() { ValueExpr returnExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -2131,7 +2131,7 @@ public void writeMethodDefinition_withArgumentsAndReturnExpr() { } @Test - public void writeMethodDefinition_withCommentsAnnotationsAndThrows() { + void writeMethodDefinition_withCommentsAnnotationsAndThrows() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND METHOD"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -2208,7 +2208,7 @@ public void writeMethodDefinition_withCommentsAnnotationsAndThrows() { } @Test - public void writeMethodDefinition_templatedReturnTypeAndArguments() { + void writeMethodDefinition_templatedReturnTypeAndArguments() { Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = Arrays.asList( @@ -2249,7 +2249,7 @@ public void writeMethodDefinition_templatedReturnTypeAndArguments() { } @Test - public void writeClassDefinition_basicWithFileHeader() { + void writeClassDefinition_basicWithFileHeader() { List fileHeader = Arrays.asList(CommentStatement.withComment(BlockComment.withComment("Apache License"))); ClassDefinition classDef = @@ -2273,7 +2273,7 @@ public void writeClassDefinition_basicWithFileHeader() { } @Test - public void writeClassDefinition_withAnnotationsExtendsAndImplements() { + void writeClassDefinition_withAnnotationsExtendsAndImplements() { ClassDefinition classDef = ClassDefinition.builder() .setPackageString("com.google.example.library.v1.stub") @@ -2304,7 +2304,7 @@ public void writeClassDefinition_withAnnotationsExtendsAndImplements() { } @Test - public void writeClassDefinition_commentsStatementsAndMethods() { + void writeClassDefinition_commentsStatementsAndMethods() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND CLASS"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -2443,7 +2443,7 @@ public void writeClassDefinition_commentsStatementsAndMethods() { } @Test - public void writeClassDefinition_withImportCollision() { + void writeClassDefinition_withImportCollision() { VaporReference firstType = VaporReference.builder() @@ -2508,7 +2508,7 @@ public void writeClassDefinition_withImportCollision() { } @Test - public void writeReferenceConstructorExpr_thisConstructorWithArguments() { + void writeReferenceConstructorExpr_thisConstructorWithArguments() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2530,7 +2530,7 @@ public void writeReferenceConstructorExpr_thisConstructorWithArguments() { } @Test - public void writeReferenceConstructorExpr_superConstructorWithNoArguments() { + void writeReferenceConstructorExpr_superConstructorWithNoArguments() { VaporReference ref = VaporReference.builder().setName("Parent").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2541,7 +2541,7 @@ public void writeReferenceConstructorExpr_superConstructorWithNoArguments() { } @Test - public void writeThisObjectValue_methodReturn() { + void writeThisObjectValue_methodReturn() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2560,7 +2560,7 @@ public void writeThisObjectValue_methodReturn() { } @Test - public void writeThisObjectValue_accessFieldAndInvokeMethod() { + void writeThisObjectValue_accessFieldAndInvokeMethod() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2589,7 +2589,7 @@ public void writeThisObjectValue_accessFieldAndInvokeMethod() { } @Test - public void writeSuperObjectValue_accessFieldAndInvokeMethod() { + void writeSuperObjectValue_accessFieldAndInvokeMethod() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2619,7 +2619,7 @@ public void writeSuperObjectValue_accessFieldAndInvokeMethod() { } @Test - public void writeUnaryOperationExpr_postfixIncrement() { + void writeUnaryOperationExpr_postfixIncrement() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("i").build()); UnaryOperationExpr postIncrementOperationExpr = @@ -2629,7 +2629,7 @@ public void writeUnaryOperationExpr_postfixIncrement() { } @Test - public void writeUnaryOperationExpr_logicalNot() { + void writeUnaryOperationExpr_logicalNot() { MethodInvocationExpr methodInvocationExpr = MethodInvocationExpr.builder() .setMethodName("isEmpty") @@ -2642,7 +2642,7 @@ public void writeUnaryOperationExpr_logicalNot() { } @Test - public void writeRelationalOperationExpr_equalTo() { + void writeRelationalOperationExpr_equalTo() { VariableExpr variableExprLHS = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("isGood").build()); @@ -2659,7 +2659,7 @@ public void writeRelationalOperationExpr_equalTo() { } @Test - public void writeRelationOperationExpr_notEqualTo() { + void writeRelationOperationExpr_notEqualTo() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -2681,7 +2681,7 @@ public void writeRelationOperationExpr_notEqualTo() { } @Test - public void writeRelationalOperationExpr_lessThan() { + void writeRelationalOperationExpr_lessThan() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("i", TypeNode.INT)); MethodInvocationExpr rhsExpr = MethodInvocationExpr.builder() @@ -2696,7 +2696,7 @@ public void writeRelationalOperationExpr_lessThan() { } @Test - public void writeLogicalOperationExpr_logicalAnd() { + void writeLogicalOperationExpr_logicalAnd() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("isEmpty", TypeNode.BOOLEAN)); VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); @@ -2714,7 +2714,7 @@ public void writeLogicalOperationExpr_logicalAnd() { } @Test - public void writeLogicalOperationExpr_logicalOr() { + void writeLogicalOperationExpr_logicalOr() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("isGood", TypeNode.BOOLEAN)); MethodInvocationExpr rhsExpr = MethodInvocationExpr.builder() @@ -2728,7 +2728,7 @@ public void writeLogicalOperationExpr_logicalOr() { } @Test - public void writeAssignmentOperationExpr_multiplyAssignment() { + void writeAssignmentOperationExpr_multiplyAssignment() { VariableExpr lhsExpr = createVariableExpr("h", TypeNode.INT); ValueExpr rhsExpr = ValueExpr.withValue( @@ -2740,7 +2740,7 @@ public void writeAssignmentOperationExpr_multiplyAssignment() { } @Test - public void writeAssignmentOperationExpr_xorAssignment() { + void writeAssignmentOperationExpr_xorAssignment() { VariableExpr lhsExpr = createVariableExpr("h", TypeNode.INT); TypeNode objectType = TypeNode.withReference( @@ -2761,7 +2761,7 @@ public void writeAssignmentOperationExpr_xorAssignment() { } @Test - public void writeLambdaExpr_noParameters() { + void writeLambdaExpr_noParameters() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -2771,7 +2771,7 @@ public void writeLambdaExpr_noParameters() { } @Test - public void writeLambdaExpr_assignToVariable() { + void writeLambdaExpr_assignToVariable() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -2788,7 +2788,7 @@ public void writeLambdaExpr_assignToVariable() { } @Test - public void writeLambdaExpr_oneParameter() { + void writeLambdaExpr_oneParameter() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2805,7 +2805,7 @@ public void writeLambdaExpr_oneParameter() { } @Test - public void writeLambdaExpr_severalParameters() { + void writeLambdaExpr_severalParameters() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2832,7 +2832,7 @@ public void writeLambdaExpr_severalParameters() { } @Test - public void writeLambdaExpr_body() { + void writeLambdaExpr_body() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2864,21 +2864,21 @@ public void writeLambdaExpr_body() { } @Test - public void writeEmptyLineStatement() { + void writeEmptyLineStatement() { EmptyLineStatement statement = EmptyLineStatement.create(); statement.accept(writerVisitor); assertEquals("\n", writerVisitor.write()); } @Test - public void writeBreakStatement() { + void writeBreakStatement() { BreakStatement statement = BreakStatement.create(); statement.accept(writerVisitor); assertEquals("break;", writerVisitor.write()); } @Test - public void writePackageInfoDefinition() { + void writePackageInfoDefinition() { PackageInfoDefinition packageInfo = PackageInfoDefinition.builder() .setPakkage("com.google.example.library.v1") @@ -2910,7 +2910,7 @@ public void writePackageInfoDefinition() { /** =============================== GOLDEN TESTS =============================== */ @Test - public void writeSGrpcServiceClientWithNestedClassImport() { + void writeSGrpcServiceClientWithNestedClassImport() { GapicContext context = TestProtoLoader.instance().parseNestedMessage(); Service nestedService = context.services().get(0); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, nestedService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java index 92ee331448..df828d5119 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java @@ -22,13 +22,13 @@ import com.google.api.generator.test.protoloader.TestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ClientLibraryPackageInfoComposerTest { +class ClientLibraryPackageInfoComposerTest { private GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); @Test - public void composePackageInfo_showcase() { + void composePackageInfo_showcase() { GapicPackageInfo packageInfo = ClientLibraryPackageInfoComposer.generatePackageInfo(context); JavaWriterVisitor visitor = new JavaWriterVisitor(); packageInfo.packageInfo().accept(visitor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java index 247cec9a85..715c7d5f7f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java @@ -26,9 +26,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ClientLibraryReflectConfigComposerTest { +class ClientLibraryReflectConfigComposerTest { private final Message.Builder testMessageBuilder = Message.builder() @@ -37,7 +37,7 @@ public class ClientLibraryReflectConfigComposerTest { .setType(TypeNode.OBJECT); @Test - public void composeReflectConfigs_showcase() { + void composeReflectConfigs_showcase() { final GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); List configs = Composer.composeNativeReflectConfig(context); assertThat(configs).isNotEmpty(); @@ -75,7 +75,7 @@ public void composeReflectConfigs_showcase() { } @Test - public void composeReflectConfigs_SimpleMessage() { + void composeReflectConfigs_SimpleMessage() { List entries = ClientLibraryReflectConfigComposer.calculateReflectConfigList( "foo.Bar", testMessageBuilder.build()); @@ -85,7 +85,7 @@ public void composeReflectConfigs_SimpleMessage() { } @Test - public void composeReflectConfigs_Enum() { + void composeReflectConfigs_Enum() { List entries = ClientLibraryReflectConfigComposer.calculateReflectConfigList( "e.Num", @@ -96,7 +96,7 @@ public void composeReflectConfigs_Enum() { } @Test - public void composeReflectConfigs_NestedEnums() { + void composeReflectConfigs_NestedEnums() { List nestedEnums = Arrays.asList("NestedEnum1", "NestedEnum2"); List entries = ClientLibraryReflectConfigComposer.calculateReflectConfigList( @@ -112,27 +112,27 @@ public void composeReflectConfigs_NestedEnums() { } @Test - public void formatNestedClassFullyQualifiedNames_noNested() { + void formatNestedClassFullyQualifiedNames_noNested() { assertEquals("a.B", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B")); assertEquals("aa.bb.CC", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.CC")); } @Test - public void formatNestedClassFullyQualifiedNames_oneNested() { + void formatNestedClassFullyQualifiedNames_oneNested() { assertEquals("a.B$C", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B.C")); assertEquals( "aa.bb.Cc$Dd", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.Cc.Dd")); } @Test - public void formatNestedClassFullyQualifiedNames_twoNested() { + void formatNestedClassFullyQualifiedNames_twoNested() { assertEquals("a.B$C$D", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B.C.D")); assertEquals( "aa.bb.Cc$Dd$Ee", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.Cc.Dd.Ee")); } @Test - public void duplicateEntries_found() { + void duplicateEntries_found() { assertThat(ClientLibraryReflectConfigComposer.calculateDuplicates(Arrays.asList("a", "a", "b"))) .containsExactly("a"); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index 66ad0584be..1d2053944f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -35,9 +35,9 @@ import java.nio.file.Paths; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ComposerTest { +class ComposerTest { private final GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); private final Service echoProtoService = context.services().get(0); private final List clazzes = @@ -54,7 +54,7 @@ public class ComposerTest { private List ListofSamples = Arrays.asList(new Sample[] {sample}); @Test - public void gapicClass_addApacheLicense() { + void gapicClass_addApacheLicense() { ClassDefinition classDef = ClassDefinition.builder() .setPackageString("com.google.showcase.v1beta1.stub") @@ -74,7 +74,7 @@ public void gapicClass_addApacheLicense() { } @Test - public void composeSamples_showcase() { + void composeSamples_showcase() { GapicClass testClass = clazzes.get(0).withSamples(ListofSamples); List testClassList = Arrays.asList(new GapicClass[] {testClass}); @@ -96,7 +96,7 @@ public void composeSamples_showcase() { } @Test - public void gapicClass_addRegionTagAndHeaderToSample() { + void gapicClass_addRegionTagAndHeaderToSample() { Sample testSample; testSample = Composer.addRegionTagAndHeaderToSample(sample, "showcase", "v1"); assertEquals("Showcase", testSample.regionTag().apiShortName()); @@ -105,7 +105,7 @@ public void gapicClass_addRegionTagAndHeaderToSample() { } @Test - public void composeSamples_parseProtoPackage() { + void composeSamples_parseProtoPackage() { String defaultHost = "accessapproval.googleapis.com:443"; String protoPack = "google.cloud.accessapproval.v1"; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java index 77205f0122..44f3b49beb 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java @@ -51,19 +51,19 @@ import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class AbstractTransportServiceStubClassComposerTest { +class AbstractTransportServiceStubClassComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void shouldGenerateRequestMutator_fieldConfiguredCorrectly() { + void shouldGenerateRequestMutator_fieldConfiguredCorrectly() { String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); autoPopulatedFieldList.add("TestField"); @@ -105,7 +105,7 @@ public void shouldGenerateRequestMutator_fieldConfiguredCorrectly() { } @Test - public void shouldNotGenerateRequestMutator_fieldConfiguredIncorrectly() { + void shouldNotGenerateRequestMutator_fieldConfiguredIncorrectly() { String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); autoPopulatedFieldList.add("TestField"); @@ -148,7 +148,7 @@ public void shouldNotGenerateRequestMutator_fieldConfiguredIncorrectly() { // TODO: add unit tests where the field is not found in the messageTypes map @Test - public void createAutoPopulatedRequestStatement_sampleField() { + void createAutoPopulatedRequestStatement_sampleField() { Reference RequestBuilderRef = VaporReference.builder() .setName("EchoRequest") @@ -194,7 +194,7 @@ public void createAutoPopulatedRequestStatement_sampleField() { } @Test - public void createRequestMutatorBody_TestField() { + void createRequestMutatorBody_TestField() { List bodyStatements = new ArrayList<>(); String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); @@ -266,7 +266,7 @@ public void createRequestMutatorBody_TestField() { } @Test - public void createRequestMutatorBody_TestFieldNotString_shouldReturnNull() { + void createRequestMutatorBody_TestFieldNotString_shouldReturnNull() { List bodyStatements = new ArrayList<>(); String ECHO_PACKAGE = "com.google.showcase.v1beta1"; @@ -335,7 +335,7 @@ public void createRequestMutatorBody_TestFieldNotString_shouldReturnNull() { } @Test - public void createRequestMutatorBody_TestFieldFormatNotUUID_shouldReturnNull() { + void createRequestMutatorBody_TestFieldFormatNotUUID_shouldReturnNull() { List bodyStatements = new ArrayList<>(); String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); @@ -403,7 +403,7 @@ public void createRequestMutatorBody_TestFieldFormatNotUUID_shouldReturnNull() { } @Test - public void createRequestMutatorBody_TestFieldIncorrectName_shouldReturnNull() { + void createRequestMutatorBody_TestFieldIncorrectName_shouldReturnNull() { List bodyStatements = new ArrayList<>(); String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); @@ -471,7 +471,7 @@ public void createRequestMutatorBody_TestFieldIncorrectName_shouldReturnNull() { } @Test - public void createRequestMutator_TestField() { + void createRequestMutator_TestField() { String ECHO_PACKAGE = "com.google.showcase.v1beta1"; List autoPopulatedFieldList = new ArrayList<>(); autoPopulatedFieldList.add("TestField"); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java index e03ba5c641..ad13e0f45e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java @@ -48,19 +48,19 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class BatchingDescriptorComposerTest { +class BatchingDescriptorComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void batchingDescriptor_hasSubresponseField() { + void batchingDescriptor_hasSubresponseField() { FileDescriptor serviceFileDescriptor = PubsubProto.getDescriptor(); FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); @@ -115,7 +115,7 @@ public void batchingDescriptor_hasSubresponseField() { } @Test - public void batchingDescriptor_noSubresponseField() { + void batchingDescriptor_noSubresponseField() { FileDescriptor serviceFileDescriptor = LoggingProto.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); assertEquals(serviceDescriptor.getName(), "LoggingServiceV2"); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java index 0d567f409d..717191842a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java @@ -53,10 +53,10 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class RetrySettingsComposerTest { +class RetrySettingsComposerTest { private static final VariableExpr RETRY_PARAM_DEFINITIONS_VAR_EXPR = createRetryParamDefinitionsVarExpr(); private static final VariableExpr RETRY_CODES_DEFINITIONS_VAR_EXPR = @@ -64,13 +64,13 @@ public class RetrySettingsComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void paramDefinitionsBlock_noConfigsFound() { + void paramDefinitionsBlock_noConfigsFound() { GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); Service service = context.services().get(0); @@ -98,7 +98,7 @@ public void paramDefinitionsBlock_noConfigsFound() { } @Test - public void paramDefinitionsBlock_basic() { + void paramDefinitionsBlock_basic() { GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); Service service = context.services().get(0); @@ -140,7 +140,7 @@ public void paramDefinitionsBlock_basic() { } @Test - public void codesDefinitionsBlock_noConfigsFound() { + void codesDefinitionsBlock_noConfigsFound() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -176,7 +176,7 @@ public void codesDefinitionsBlock_noConfigsFound() { } @Test - public void codesDefinitionsBlock_basic() { + void codesDefinitionsBlock_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -215,7 +215,7 @@ public void codesDefinitionsBlock_basic() { } @Test - public void simpleBuilderExpr_basic() { + void simpleBuilderExpr_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -296,7 +296,7 @@ public void simpleBuilderExpr_basic() { } @Test - public void lroBuilderExpr() { + void lroBuilderExpr() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -350,7 +350,7 @@ public void lroBuilderExpr() { } @Test - public void batchingSettings_minimalFlowControlSettings() { + void batchingSettings_minimalFlowControlSettings() { String filename = "pubsub_gapic.yaml"; Path path = Paths.get(TestProtoLoader.instance().getTestFilesDirectory(), filename); Optional> batchingSettingsOpt = @@ -404,7 +404,7 @@ public void batchingSettings_minimalFlowControlSettings() { } @Test - public void batchingSettings_fullFlowControlSettings() { + void batchingSettings_fullFlowControlSettings() { String filename = "logging_gapic.yaml"; Path path = Paths.get(TestProtoLoader.instance().getTestFilesDirectory(), filename); Optional> batchingSettingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java index 264060f474..04549457b8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java @@ -38,19 +38,19 @@ import java.util.Collections; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class DefaultValueComposerTest { +class DefaultValueComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void defaultValue_mapField() { + void defaultValue_mapField() { // Incorrect and will never happen in real usage, but proves that map detection is based on // isMap rather than type(). Field field = @@ -75,7 +75,7 @@ public void defaultValue_mapField() { } @Test - public void defaultValue_listField() { + void defaultValue_listField() { // Incorrect and will never happen in real usage, but proves that list detection is based on // isRepeated rather than type(). Field field = @@ -86,7 +86,7 @@ public void defaultValue_listField() { } @Test - public void defaultValue_enumField() { + void defaultValue_enumField() { // Incorrect and will never happen in real usage, but proves that enum detection is based on // isEnum() rather than type(). Field field = @@ -97,7 +97,7 @@ public void defaultValue_enumField() { } @Test - public void defaultValue_messageField() { + void defaultValue_messageField() { // Incorrect and will never happen in real usage, but proves that message detection is based on // isMessage() rather than type(). Field field = @@ -108,7 +108,7 @@ public void defaultValue_messageField() { } @Test - public void defaultValue_stringField() { + void defaultValue_stringField() { Field field = Field.builder().setName("foobar").setType(TypeNode.STRING).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -124,7 +124,7 @@ public void defaultValue_stringField() { } @Test - public void defaultValue_numericField() { + void defaultValue_numericField() { Field field = Field.builder().setName("foobar").setType(TypeNode.INT).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -138,7 +138,7 @@ public void defaultValue_numericField() { } @Test - public void defaultValue_booleanField() { + void defaultValue_booleanField() { Field field = Field.builder().setName("foobar").setType(TypeNode.BOOLEAN).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -146,7 +146,7 @@ public void defaultValue_booleanField() { } @Test - public void defaultValue_byteStringField() { + void defaultValue_byteStringField() { Field field = Field.builder() .setName("foobar") @@ -158,7 +158,7 @@ public void defaultValue_byteStringField() { } @Test - public void defaultValue_resourceNameWithOnePattern() { + void defaultValue_resourceNameWithOnePattern() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -176,7 +176,7 @@ public void defaultValue_resourceNameWithOnePattern() { } @Test - public void defaultValue_resourceNameWithMultiplePatterns_noBindings() { + void defaultValue_resourceNameWithMultiplePatterns_noBindings() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -201,7 +201,7 @@ public void defaultValue_resourceNameWithMultiplePatterns_noBindings() { } @Test - public void defaultValue_resourceNameWithMultiplePatterns_matchesBindings() { + void defaultValue_resourceNameWithMultiplePatterns_matchesBindings() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -230,7 +230,7 @@ public void defaultValue_resourceNameWithMultiplePatterns_matchesBindings() { } @Test - public void defaultValue_resourceNameWithWildcardPattern() { + void defaultValue_resourceNameWithWildcardPattern() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -248,7 +248,7 @@ public void defaultValue_resourceNameWithWildcardPattern() { } @Test - public void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { + void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { // Edge case that should never happen in practice. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -272,7 +272,7 @@ public void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { + void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { // Edge case that occurs in GCS. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -296,7 +296,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { + void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -334,7 +334,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { + void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -373,7 +373,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClass() { + void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClass() { // Edge case that occurs in GCS. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -412,7 +412,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClas } @Test - public void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesHttpBinding() { + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesHttpBinding() { FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(messagingFileDescriptor); Map typeStringsToResourceNames = @@ -446,8 +446,7 @@ Blurb Resource contains four patterns (in order of): } @Test - public void - createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesAdditionalHttpBinding() { + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesAdditionalHttpBinding() { FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(messagingFileDescriptor); Map typeStringsToResourceNames = @@ -482,8 +481,7 @@ Blurb Resource contains four patterns (in order of): } @Test - public void - createSimpleMessageBuilderValue_resourceNameMultiplePatterns_doesNotMatchHttpBinding() { + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_doesNotMatchHttpBinding() { FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(messagingFileDescriptor); Map typeStringsToResourceNames = @@ -518,7 +516,7 @@ Blurb Resource contains four patterns (in order of): } @Test - public void defaultValue_resourceNameMultiplePatterns_noHttpBinding() { + void defaultValue_resourceNameMultiplePatterns_noHttpBinding() { FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(messagingFileDescriptor); Map typeStringsToResourceNames = @@ -537,7 +535,7 @@ public void defaultValue_resourceNameMultiplePatterns_noHttpBinding() { } @Test - public void createSimpleMessage_basicPrimitivesOnly() { + void createSimpleMessage_basicPrimitivesOnly() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -554,7 +552,7 @@ public void createSimpleMessage_basicPrimitivesOnly() { } @Test - public void createSimpleMessage_containsMessagesEnumsAndResourceName() { + void createSimpleMessage_containsMessagesEnumsAndResourceName() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -574,7 +572,7 @@ public void createSimpleMessage_containsMessagesEnumsAndResourceName() { } @Test - public void createSimpleMessage_valueField() { + void createSimpleMessage_valueField() { FileDescriptor echoFileDescriptor = com.google.showcase.grpcrest.v1beta1.EchoGrpcrest.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -596,7 +594,7 @@ public void createSimpleMessage_valueField() { } @Test - public void createSimpleMessage_containsRepeatedField() { + void createSimpleMessage_containsRepeatedField() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -613,7 +611,7 @@ public void createSimpleMessage_containsRepeatedField() { } @Test - public void createSimpleMessage_onlyOneofs() { + void createSimpleMessage_onlyOneofs() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -627,7 +625,7 @@ public void createSimpleMessage_onlyOneofs() { } @Test - public void createAnonymousResourceNameClass() { + void createAnonymousResourceNameClass() { Expr expr = DefaultValueComposer.createAnonymousResourceNameClassValue("resource", null); expr.accept(writerVisitor); String expected = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java index 66e00a0da9..6895bccf9e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java @@ -19,11 +19,11 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceCallableFactoryClassComposerTest { +class GrpcServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -34,7 +34,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClasses_deprecated() { + void generateServiceClasses_deprecated() { GapicContext context = GrpcTestProtoLoader.instance().parseDeprecatedService(); Service protoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java index 1c00534433..3c2444411b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java @@ -19,11 +19,11 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceStubClassComposerTest { +class GrpcServiceStubClassComposerTest { @Test - public void generateGrpcServiceStubClass_simple() { + void generateGrpcServiceStubClass_simple() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, echoProtoService); @@ -33,7 +33,7 @@ public void generateGrpcServiceStubClass_simple() { } @Test - public void generateGrpcServiceStubClass_deprecated() { + void generateGrpcServiceStubClass_deprecated() { GapicContext context = GrpcTestProtoLoader.instance().parseDeprecatedService(); Service protoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, protoService); @@ -43,7 +43,7 @@ public void generateGrpcServiceStubClass_deprecated() { } @Test - public void generateGrpcServiceStubClass_httpBindings() { + void generateGrpcServiceStubClass_httpBindings() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseTesting(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -53,7 +53,7 @@ public void generateGrpcServiceStubClass_httpBindings() { } @Test - public void generateGrpcServiceStubClass_routingHeaders() { + void generateGrpcServiceStubClass_routingHeaders() { GapicContext context = GrpcTestProtoLoader.instance().parseExplicitDynamicRoutingHeaderTesting(); Service service = context.services().get(0); @@ -64,7 +64,7 @@ public void generateGrpcServiceStubClass_routingHeaders() { } @Test - public void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { + void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { GapicContext context = GrpcTestProtoLoader.instance().parsePubSubPublisher(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -74,7 +74,7 @@ public void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { } @Test - public void generateGrpcServiceStubClass_createBatchingCallable() { + void generateGrpcServiceStubClass_createBatchingCallable() { GapicContext context = GrpcTestProtoLoader.instance().parseLogging(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -84,7 +84,7 @@ public void generateGrpcServiceStubClass_createBatchingCallable() { } @Test - public void generateGrpcServiceStubClass_autopopulateField() { + void generateGrpcServiceStubClass_autopopulateField() { GapicContext context = GrpcTestProtoLoader.instance().parseAutoPopulateFieldTesting(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java index 7ef8dcf97e..1f6459e57c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java @@ -19,30 +19,23 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class MockServiceClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"MockEcho", GrpcTestProtoLoader.instance().parseShowcaseEcho()}, - {"MockDeprecatedService", GrpcTestProtoLoader.instance().parseDeprecatedService()} - }); - } - - @Parameterized.Parameter public String name; +class MockServiceClassComposerTest { - @Parameterized.Parameter(1) - public GapicContext context; + static Stream data() { + return Stream.of( + Arguments.of("MockEcho", GrpcTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "MockDeprecatedService", GrpcTestProtoLoader.instance().parseDeprecatedService())); + } - @Test - public void generateMockServiceClasses() { + @ParameterizedTest + @MethodSource("data") + void generateMockServiceClasses(String name, GapicContext context) { Service service = context.services().get(0); GapicClass clazz = MockServiceClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java index f377c26e3c..547caeecb3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java @@ -19,30 +19,22 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class MockServiceImplClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"MockEchoImpl", GrpcTestProtoLoader.instance().parseShowcaseEcho()}, - {"MockDeprecatedServiceImpl", GrpcTestProtoLoader.instance().parseDeprecatedService()} - }); +class MockServiceImplClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of("MockEchoImpl", GrpcTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "MockDeprecatedServiceImpl", GrpcTestProtoLoader.instance().parseDeprecatedService())); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Test - public void generateMockServiceImplClasses() { + @ParameterizedTest + @MethodSource("data") + void generateMockServiceImplClasses(String name, GapicContext context) { Service service = context.services().get(0); GapicClass clazz = MockServiceImplClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java index 151ccb578d..7df2fc017c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java @@ -20,62 +20,49 @@ import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; import java.util.*; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceClientClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceClientClassComposerTest { + + private static Stream data() { + return Stream.of( + Arguments.of( "EchoClient", GrpcTestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1"), + Arguments.of( "DeprecatedServiceClient", GrpcTestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - }, - { + "v1"), + Arguments.of( "IdentityClient", GrpcTestProtoLoader.instance().parseShowcaseIdentity(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1"), + Arguments.of( "BookshopClient", GrpcTestProtoLoader.instance().parseBookshopService(), "localhost:2665", - "v1beta1" - }, - { + "v1beta1"), + Arguments.of( "MessagingClient", GrpcTestProtoLoader.instance().parseShowcaseMessaging(), "localhost:7469", - "v1beta1" - }, - }); + "v1beta1")); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String packageVersionExpected; - - @Test - public void generateServiceClientClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceClientClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected) { Service service = context.services().get(0); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java index fc1cb2ee55..c20bf8bf56 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java @@ -19,40 +19,29 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceClientTestClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"EchoClientTest", GrpcTestProtoLoader.instance().parseShowcaseEcho(), 0}, - { +class ServiceClientTestClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of("EchoClientTest", GrpcTestProtoLoader.instance().parseShowcaseEcho(), 0), + Arguments.of( "DeprecatedServiceClientTest", GrpcTestProtoLoader.instance().parseDeprecatedService(), - 0 - }, - {"TestingClientTest", GrpcTestProtoLoader.instance().parseShowcaseTesting(), 0}, - {"SubscriberClientTest", GrpcTestProtoLoader.instance().parsePubSubPublisher(), 1}, - {"LoggingClientTest", GrpcTestProtoLoader.instance().parseLogging(), 0}, - }); + 0), + Arguments.of("TestingClientTest", GrpcTestProtoLoader.instance().parseShowcaseTesting(), 0), + Arguments.of( + "SubscriberClientTest", GrpcTestProtoLoader.instance().parsePubSubPublisher(), 1), + Arguments.of("LoggingClientTest", GrpcTestProtoLoader.instance().parseLogging(), 0)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public int serviceIndex; - - @Test - public void generateServiceClientTestClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceClientTestClasses(String name, GapicContext context, int serviceIndex) { Service echoProtoService = context.services().get(serviceIndex); GapicClass clazz = ServiceClientTestClassComposer.instance().generate(context, echoProtoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java index 7a955fecd3..90e0df1a2a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java @@ -19,46 +19,34 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.TestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceSettingsClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceSettingsClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of( "EchoSettings", TestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1"), + Arguments.of( "DeprecatedServiceSettings", TestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - } - }); + "v1")); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String packageVersionExpected; - - @Test - public void generateServiceSettingsClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceSettingsClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected) { Service service = context.services().get(0); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java index 8984c3550c..15317cab94 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java @@ -19,36 +19,26 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.TestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(Parameterized.class) -public class ServiceStubClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"EchoStub", TestProtoLoader.instance().parseShowcaseEcho(), "", ""}, - {"DeprecatedServiceStub", TestProtoLoader.instance().parseDeprecatedService(), "", ""} - }); +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class ServiceStubClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of("EchoStub", TestProtoLoader.instance().parseShowcaseEcho(), "", ""), + Arguments.of( + "DeprecatedServiceStub", TestProtoLoader.instance().parseDeprecatedService(), "", "")); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String packageVersionExpected; - - @Test - public void generateServiceStubClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceStubClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected) { Service service = context.services().get(0); GapicClass clazz = ServiceStubClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java index bfce68a45a..203b9f3894 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java @@ -19,64 +19,48 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceStubSettingsClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceStubSettingsClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of( "LoggingServiceV2StubSettings", GrpcTestProtoLoader.instance().parseLogging(), "logging", - "v2" - }, - { + "v2"), + Arguments.of( "PublisherStubSettings", GrpcTestProtoLoader.instance().parsePubSubPublisher(), "pubsub", - "v1" - }, - { + "v1"), + Arguments.of( "EchoStubSettings", GrpcTestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1"), + Arguments.of( "DeprecatedServiceStubSettings", GrpcTestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - }, - { + "v1"), + Arguments.of( "ApiVersionTestingStubSettings", GrpcTestProtoLoader.instance().parseApiVersionTesting(), "localhost:7469", - "v1" - } - }); + "v1")); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String packageVersionExpected; - - @Test - public void generateServiceStubSettingsClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceStubSettingsClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected) { Service service = context.services().get(0); GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java index 3896549231..376c7fd32c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java @@ -24,11 +24,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceCallableFactoryClassComposerTest { +class GrpcServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -44,7 +44,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java index 5056de88ee..62067343a7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java @@ -24,11 +24,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceStubClassComposerTest { +class GrpcServiceStubClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, echoProtoService); @@ -42,7 +42,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java index 2ab7a72170..a5ded2aaaa 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java @@ -26,11 +26,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceCallableFactoryClassComposerTest { +class HttpJsonServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -47,7 +47,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java index a2dfe0d98a..ec8334924f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java @@ -25,11 +25,12 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +class HttpJsonServiceClientTestClassComposerTest { -public class HttpJsonServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -45,7 +46,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java index 7a497ec3ac..8ed541475a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java @@ -25,11 +25,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceStubClassComposerTest { +class HttpJsonServiceStubClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -44,7 +44,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java index 66e88d87af..8efc43118c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java @@ -23,11 +23,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientClassComposerTest { +class ServiceClientClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, echoProtoService); @@ -41,7 +41,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesEmpty() { + void generateServiceClassesEmpty() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(1); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, echoProtoService); @@ -55,7 +55,7 @@ public void generateServiceClassesEmpty() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, wickedProtoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java index 1a1d463bce..b7164ce590 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java @@ -26,11 +26,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientTestClassComposerTest { +class ServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -45,7 +45,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java index 3d9b7bf8f0..5ee96c0cfe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java @@ -23,11 +23,11 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceSettingsClassComposerTest { +class ServiceSettingsClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, echoProtoService); @@ -41,7 +41,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClassesWicked() { + void generateServiceClassesWicked() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); Service wickedProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java index c9439d525f..160df81f1d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java @@ -23,30 +23,23 @@ import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceStubSettingsClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"EchoStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseEcho()}, - {"WickedStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseWicked()} - }); +class ServiceStubSettingsClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of( + "EchoStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "WickedStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseWicked())); } - @Parameterized.Parameter public String goldenFileName; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Test - public void generateServiceClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceClasses(String goldenFileName, GapicContext context) { Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, echoProtoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java index fa471f0ed2..7438d53b01 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java @@ -48,25 +48,25 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceNameHelperClassComposerTest { +class ResourceNameHelperClassComposerTest { private final String COLLIDING_RESOURCE_NAME_KEY = "config.googleapis.com/Resource"; private ServiceDescriptor echoService; private FileDescriptor echoFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); assertEquals(echoService.getName(), "Echo"); } @Test - public void getTokenSet_basic() { + void getTokenSet_basic() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}", @@ -80,7 +80,7 @@ public void getTokenSet_basic() { } @Test - public void concatToUpperSnakeCaseName_basic() { + void concatToUpperSnakeCaseName_basic() { assertEquals( "PROJECT_LOCATION_AUTOSCALING_POLICY", ResourceNameHelperClassComposer.concatToUpperSnakeCaseName( @@ -88,7 +88,7 @@ public void concatToUpperSnakeCaseName_basic() { } @Test - public void concatToUpperCamelCaseName_basic() { + void concatToUpperCamelCaseName_basic() { assertEquals( "ProjectLocationAutoscalingPolicy", ResourceNameHelperClassComposer.concatToUpperCamelCaseName( @@ -96,7 +96,7 @@ public void concatToUpperCamelCaseName_basic() { } @Test - public void generateResourceNameClass_echoFoobarMultiplePatterns() { + void generateResourceNameClass_echoFoobarMultiplePatterns() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -119,7 +119,7 @@ public void generateResourceNameClass_echoFoobarMultiplePatterns() { } @Test - public void generateResourceNameClass_loggingOnePatternMultipleVariables() { + void generateResourceNameClass_loggingOnePatternMultipleVariables() { FileDescriptor serviceFileDescriptor = LoggingConfigProto.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); assertEquals(serviceDescriptor.getName(), "ConfigServiceV2"); @@ -166,7 +166,7 @@ public void generateResourceNameClass_loggingOnePatternMultipleVariables() { } @Test - public void generateResourceNameClass_testingSessionOnePattern() { + void generateResourceNameClass_testingSessionOnePattern() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -193,7 +193,7 @@ public void generateResourceNameClass_testingSessionOnePattern() { } @Test - public void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparator() { + void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparator() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -220,7 +220,7 @@ public void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparat } @Test - public void generateResourceNameClass_childSingleton() { + void generateResourceNameClass_childSingleton() { ResourceName agentResname = ResourceName.builder() .setVariableName("agent") @@ -245,7 +245,7 @@ public void generateResourceNameClass_childSingleton() { } @Test - public void generateResourceNameClass_resourceNameCollisionIsAvoided() { + void generateResourceNameClass_resourceNameCollisionIsAvoided() { ResourceName collidingResourceName = Parser.parseResourceNames(CollisionsOuterClass.getDescriptor()) .get(COLLIDING_RESOURCE_NAME_KEY); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java index b49e731db2..9a4c0a3c67 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java @@ -22,22 +22,22 @@ import com.google.showcase.v1beta1.EchoOuterClass; import java.util.Arrays; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceNameTokenizerTest { +class ResourceNameTokenizerTest { private ServiceDescriptor echoService; private FileDescriptor echoFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); assertEquals(echoService.getName(), "Echo"); } @Test - public void parseTokenHierarchy_basic() { + void parseTokenHierarchy_basic() { List patterns = Arrays.asList( "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}", @@ -52,7 +52,7 @@ public void parseTokenHierarchy_basic() { } @Test - public void parseTokenHierarchy_substringsInPattern() { + void parseTokenHierarchy_substringsInPattern() { List patterns = Arrays.asList( "customers/{customer}/customerExtensionSettings/{customer_extension_setting}"); @@ -62,7 +62,7 @@ public void parseTokenHierarchy_substringsInPattern() { } @Test - public void parseTokenHierarchy_wildcards() { + void parseTokenHierarchy_wildcards() { List patterns = Arrays.asList( "projects/{project}/metricDescriptors/{metric_descriptor=**}", @@ -76,7 +76,7 @@ public void parseTokenHierarchy_wildcards() { } @Test - public void parseTokenHierarchy_singletonCollection() { + void parseTokenHierarchy_singletonCollection() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}", @@ -89,7 +89,7 @@ public void parseTokenHierarchy_singletonCollection() { } @Test - public void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { + void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { List patterns = Arrays.asList( "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}", @@ -110,7 +110,7 @@ public void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { } @Test - public void parseTokenHierarchy_invalidPatterns() { + void parseTokenHierarchy_invalidPatterns() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}/anotherSingleton", diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java index a38773eed8..ee2d4da0af 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java @@ -23,11 +23,11 @@ import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceCallableFactoryClassComposerTest { +class HttpJsonServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java index d1231ebd4a..807ac621b0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java @@ -35,20 +35,20 @@ import java.nio.file.Paths; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceStubClassComposerTest { +class HttpJsonServiceStubClassComposerTest { private HttpJsonServiceStubClassComposer composer; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { composer = HttpJsonServiceStubClassComposer.instance(); } @Test - public void generateComplianceServiceClasses() { + void generateComplianceServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service complianceProtoServices = context.services().get(0); GapicClass clazz = composer.generate(context, complianceProtoServices); @@ -63,7 +63,7 @@ public void generateComplianceServiceClasses() { } @Test - public void generateEchoServiceClasses() { + void generateEchoServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = composer.generate(context, echoProtoService); @@ -77,8 +77,7 @@ public void generateEchoServiceClasses() { } @Test - public void - getBindingFieldMethodName_shouldReturnGetFieldListIfTheFieldIsInLastPositionAndIsRepeated() { + void getBindingFieldMethodName_shouldReturnGetFieldListIfTheFieldIsInLastPositionAndIsRepeated() { Field field = Field.builder() .setIsRepeated(true) @@ -92,8 +91,7 @@ public void generateEchoServiceClasses() { } @Test - public void - getBindingFieldMethodName_shouldReturnGetFieldValueIfTheFieldIsInLastPositionAndIsEnum() { + void getBindingFieldMethodName_shouldReturnGetFieldValueIfTheFieldIsInLastPositionAndIsEnum() { Field field = Field.builder().setIsEnum(true).setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = @@ -103,7 +101,7 @@ public void generateEchoServiceClasses() { } @Test - public void + void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsInLastPositionAndNotRepeatedOrEnum() { Field field = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = @@ -113,7 +111,7 @@ public void generateEchoServiceClasses() { } @Test - public void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsNotInLastPosition() { + void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsNotInLastPosition() { Field field = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = HttpBinding.builder().setField(field).setName("doesNotMatter").build(); @@ -122,7 +120,7 @@ public void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsNotInLastP } @Test - public void parseOperationsCustomHttpRules_shouldReturnMapIfContextContainsValidServiceYaml() { + void parseOperationsCustomHttpRules_shouldReturnMapIfContextContainsValidServiceYaml() { List httpRuleList = ImmutableList.of( HttpRule.newBuilder() @@ -152,7 +150,7 @@ public void parseOperationsCustomHttpRules_shouldReturnMapIfContextContainsValid } @Test - public void parseOperationsCustomHttpRules_shouldReturnEmptyMapIfContextHasInvalidServiceYaml() { + void parseOperationsCustomHttpRules_shouldReturnEmptyMapIfContextHasInvalidServiceYaml() { GapicContext contextNullServiceYaml = RestTestProtoLoader.instance().parseCompliance(); contextNullServiceYaml = contextNullServiceYaml.toBuilder().setServiceYamlProto(null).build(); Map httpRuleMapNull = @@ -171,7 +169,7 @@ public void parseOperationsCustomHttpRules_shouldReturnEmptyMapIfContextHasInval } @Test - public void testGetOperationsURIValueFromHttpRule() { + void testGetOperationsURIValueFromHttpRule() { HttpRule getHttpRule = HttpRule.newBuilder().setGet("Get").build(); Truth.assertThat(composer.getOperationsURIValueFromHttpRule(getHttpRule)).isEqualTo("Get"); HttpRule postHttpRule = HttpRule.newBuilder().setPost("Post").build(); @@ -198,7 +196,7 @@ public void testGetOperationsURIValueFromHttpRule() { } @Test - public void generateGrpcServiceStubClass_routingHeaders() { + void generateGrpcServiceStubClass_routingHeaders() { GapicContext context = RestTestProtoLoader.instance().parseExplicitDynamicRoutingHeaderTesting(); Service service = context.services().get(0); @@ -209,7 +207,7 @@ public void generateGrpcServiceStubClass_routingHeaders() { } @Test - public void generateHttpJsonServiceStubClass_autopopulateField() { + void generateHttpJsonServiceStubClass_autopopulateField() { GapicContext context = RestTestProtoLoader.instance().parseAutoPopulateFieldTesting(); Service service = context.services().get(0); GapicClass clazz = HttpJsonServiceStubClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java index 43e26e1f6e..5e9b2e0df1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java @@ -24,11 +24,11 @@ import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientTestClassComposerTest { +class ServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java index 4304e80f7c..45d428bacc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java @@ -23,11 +23,11 @@ import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceSettingsClassComposerTest { +class ServiceSettingsClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, echoProtoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java index d2ac3b813a..d10a2555d1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java @@ -23,34 +23,25 @@ import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(Parameterized.class) -public class ServiceStubSettingsClassComposerTest { - - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"ComplianceStubSettings.golden", RestTestProtoLoader.instance().parseCompliance()}, - { +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class ServiceStubSettingsClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of( + "ComplianceStubSettings.golden", RestTestProtoLoader.instance().parseCompliance()), + Arguments.of( "HttpJsonApiVersionTestingStubSettings.golden", - RestTestProtoLoader.instance().parseApiVersionTesting() - } - }); + RestTestProtoLoader.instance().parseApiVersionTesting())); } - @Parameterized.Parameter public String goldenFileName; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Test - public void generateServiceClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceClasses(String goldenFileName, GapicContext context) { Service protoService = context.services().get(0); GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, protoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java index af58e7a30c..bdeda049c3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java @@ -18,12 +18,12 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.test.utils.LineFormatter; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleBodyJavaFormatterTest { +class SampleBodyJavaFormatterTest { @Test - public void validFormatSampleCode_tryCatchStatement() { + void validFormatSampleCode_tryCatchStatement() { String samplecode = LineFormatter.lines("try(boolean condition = false){", "int x = 3;", "}"); String result = SampleBodyJavaFormatter.format(samplecode); String expected = @@ -32,7 +32,7 @@ public void validFormatSampleCode_tryCatchStatement() { } @Test - public void validFormatSampleCode_longLineStatement() { + void validFormatSampleCode_longLineStatement() { String sampleCode = "SubscriptionAdminSettings subscriptionAdminSettings = " + "SubscriptionAdminSettings.newBuilder().setEndpoint(myEndpoint).build();"; @@ -45,7 +45,7 @@ public void validFormatSampleCode_longLineStatement() { } @Test - public void validFormatSampleCode_longChainMethod() { + void validFormatSampleCode_longChainMethod() { String sampleCode = "echoSettingsBuilder.echoSettings().setRetrySettings(" + "echoSettingsBuilder.echoSettings().getRetrySettings().toBuilder()" @@ -66,7 +66,7 @@ public void validFormatSampleCode_longChainMethod() { } @Test - public void invalidFormatSampleCode_nonStatement() { + void invalidFormatSampleCode_nonStatement() { assertThrows( SampleBodyJavaFormatter.FormatException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java index d11d414816..820fa739a1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java @@ -34,17 +34,17 @@ import java.util.Arrays; import java.util.List; import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -public class SampleCodeWriterTest { +class SampleCodeWriterTest { private static String packageName = "com.google.samples"; private static List testingSampleStatements; private static Sample testingSample; private static RegionTag regionTag; - @BeforeClass - public static void setUp() { + @BeforeAll + static void setUp() { TypeNode settingType = TypeNode.withReference(ConcreteReference.withClazz(ClientSettings.class)); Variable aVar = Variable.builder().setName("clientSettings").setType(settingType).build(); @@ -92,7 +92,7 @@ public static void setUp() { } @Test - public void writeSampleCodeStatements() { + void writeSampleCodeStatements() { String result = SampleCodeWriter.write(testingSampleStatements); String expected = "ClientSettings clientSettings = ClientSettings.newBuilder().build();\n" @@ -103,7 +103,7 @@ public void writeSampleCodeStatements() { } @Test - public void writeInlineSample() { + void writeInlineSample() { String result = SampleCodeWriter.writeInlineSample(testingSampleStatements); String expected = LineFormatter.lines( @@ -120,7 +120,7 @@ public void writeInlineSample() { } @Test - public void writeExecutableSample() { + void writeExecutableSample() { Sample sample = testingSample.withRegionTag(regionTag.withOverloadDisambiguation("ExecutableSample")); String result = SampleCodeWriter.writeExecutableSample(sample, packageName); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java index 35d636cd32..94e381dca8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java @@ -36,15 +36,15 @@ import com.google.common.collect.ImmutableList; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleComposerTest { +class SampleComposerTest { private final String packageName = "com.google.example"; private final RegionTag.Builder regionTag = RegionTag.builder().setApiShortName("apiName").setServiceName("echo"); @Test - public void createInlineSample() { + void createInlineSample() { List sampleBody = Arrays.asList(ExprStatement.withExpr(systemOutPrint("testing"))); String sampleResult = writeSample(SampleComposer.composeInlineSample(sampleBody)); String expected = @@ -60,7 +60,7 @@ public void createInlineSample() { } @Test - public void createExecutableSampleEmptyStatementSample() { + void createExecutableSampleEmptyStatementSample() { Sample sample = Sample.builder() .setRegionTag( @@ -96,7 +96,7 @@ public void createExecutableSampleEmptyStatementSample() { } @Test - public void createExecutableSampleMethodArgsNoVar() { + void createExecutableSampleMethodArgsNoVar() { Statement sampleBody = ExprStatement.withExpr(systemOutPrint("Testing CreateExecutableSampleMethodArgsNoVar")); Sample sample = @@ -136,7 +136,7 @@ public void createExecutableSampleMethodArgsNoVar() { } @Test - public void createExecutableSampleMethod() { + void createExecutableSampleMethod() { VariableExpr variableExpr = VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.STRING).setName("content").build()) @@ -185,7 +185,7 @@ public void createExecutableSampleMethod() { } @Test - public void createExecutableSampleMethodMultipleStatements() { + void createExecutableSampleMethodMultipleStatements() { VariableExpr strVariableExpr = VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.STRING).setName("content").build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java index 05b86ddf1b..b020da6184 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java @@ -28,9 +28,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleComposerUtilTest { +class SampleComposerUtilTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; TypeNode clientType = TypeNode.withReference( @@ -55,7 +55,7 @@ public class SampleComposerUtilTest { .build(); @Test - public void assignClientVariableWithCreateMethodExpr() { + void assignClientVariableWithCreateMethodExpr() { String result = SampleCodeWriter.write( SampleComposerUtil.assignClientVariableWithCreateMethodExpr(echoClientVariableExpr)); @@ -65,14 +65,14 @@ public void assignClientVariableWithCreateMethodExpr() { } @Test - public void createOverloadDisambiguation_noargs() { + void createOverloadDisambiguation_noargs() { String result = SampleComposerUtil.createOverloadDisambiguation(new ArrayList<>()); String expected = "Noargs"; assertEquals(expected, result); } @Test - public void createOverloadDisambiguation_sameargs() { + void createOverloadDisambiguation_sameargs() { List methodArgVarExprs = Collections.nCopies(5, stringVariableExpr); String result = SampleComposerUtil.createOverloadDisambiguation(methodArgVarExprs); @@ -81,7 +81,7 @@ public void createOverloadDisambiguation_sameargs() { } @Test - public void createOverloadDisambiguation_containsInt() { + void createOverloadDisambiguation_containsInt() { List methodArgVarExprs = Arrays.asList(echoClientVariableExpr, stringVariableExpr, intVariableExpr); @@ -91,7 +91,7 @@ public void createOverloadDisambiguation_containsInt() { } @Test - public void handleDuplicateSamples_actualDuplicates() { + void handleDuplicateSamples_actualDuplicates() { List samples = Collections.nCopies(5, echoClientSample); assertEquals(samples.size(), 5); @@ -101,7 +101,7 @@ public void handleDuplicateSamples_actualDuplicates() { } @Test - public void handleDuplicateSamples_distinctDuplicates() { + void handleDuplicateSamples_distinctDuplicates() { VariableExpr echoClientVariableExprDiffVarName = VariableExpr.withVariable( Variable.builder().setName("echoClient2").setType(clientType).build()); @@ -128,7 +128,7 @@ public void handleDuplicateSamples_distinctDuplicates() { } @Test - public void handleDuplicateSamples_notDuplicateName() { + void handleDuplicateSamples_notDuplicateName() { Sample echoClientSampleDiffRpcName = echoClientSample.withRegionTag( echoClientSample.regionTag().toBuilder().setRpcName("createB").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java index f063c50903..2b058aca7c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java @@ -31,9 +31,9 @@ import java.util.Collections; import java.util.Map; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientCallableMethodSampleComposerTest { +class ServiceClientCallableMethodSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; @@ -51,7 +51,7 @@ public class ServiceClientCallableMethodSampleComposerTest { /*Testing composeLroCallableMethod*/ @Test - public void valid_composeLroCallableMethod_withReturnResponse() { + void valid_composeLroCallableMethod_withReturnResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -122,7 +122,7 @@ public void valid_composeLroCallableMethod_withReturnResponse() { } @Test - public void valid_composeLroCallableMethod_withReturnVoid() { + void valid_composeLroCallableMethod_withReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -191,7 +191,7 @@ public void valid_composeLroCallableMethod_withReturnVoid() { /*Testing composePagedCallableMethod*/ @Test - public void valid_composePagedCallableMethod() { + void valid_composePagedCallableMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -255,7 +255,7 @@ public void valid_composePagedCallableMethod() { } @Test - public void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { + void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -303,7 +303,7 @@ public void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { } @Test - public void invalid_composePagedCallableMethod_noExistMethodResponse() { + void invalid_composePagedCallableMethod_noExistMethodResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -351,7 +351,7 @@ public void invalid_composePagedCallableMethod_noExistMethodResponse() { } @Test - public void invalid_composePagedCallableMethod_noRepeatedResponse() { + void invalid_composePagedCallableMethod_noRepeatedResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -414,7 +414,7 @@ public void invalid_composePagedCallableMethod_noRepeatedResponse() { /*Testing composeStreamCallableMethod*/ @Test - public void valid_composeStreamCallableMethod_serverStream() { + void valid_composeStreamCallableMethod_serverStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -472,7 +472,7 @@ public void valid_composeStreamCallableMethod_serverStream() { } @Test - public void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -520,7 +520,7 @@ public void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { } @Test - public void valid_composeStreamCallableMethod_bidiStream() { + void valid_composeStreamCallableMethod_bidiStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -587,7 +587,7 @@ public void valid_composeStreamCallableMethod_bidiStream() { } @Test - public void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -635,7 +635,7 @@ public void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { } @Test - public void valid_composeStreamCallableMethod_clientStream() { + void valid_composeStreamCallableMethod_clientStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -716,7 +716,7 @@ public void valid_composeStreamCallableMethod_clientStream() { } @Test - public void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -765,7 +765,7 @@ public void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { /*Testing composeRegularCallableMethod*/ @Test - public void valid_composeRegularCallableMethod_unaryRpc() { + void valid_composeRegularCallableMethod_unaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -824,7 +824,7 @@ public void valid_composeRegularCallableMethod_unaryRpc() { } @Test - public void valid_composeRegularCallableMethod_lroRpc() { + void valid_composeRegularCallableMethod_lroRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -894,7 +894,7 @@ public void valid_composeRegularCallableMethod_lroRpc() { } @Test - public void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { + void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -961,7 +961,7 @@ public void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { } @Test - public void valid_composeRegularCallableMethod_pageRpc() { + void valid_composeRegularCallableMethod_pageRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1032,7 +1032,7 @@ public void valid_composeRegularCallableMethod_pageRpc() { } @Test - public void invalid_composeRegularCallableMethod_noExistMethodRequest() { + void invalid_composeRegularCallableMethod_noExistMethodRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1075,7 +1075,7 @@ public void invalid_composeRegularCallableMethod_noExistMethodRequest() { } @Test - public void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() { + void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1123,7 +1123,7 @@ public void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() } @Test - public void invalid_composeRegularCallableMethod_noRepeatedResponsePagedRpc() { + void invalid_composeRegularCallableMethod_noRepeatedResponsePagedRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java index bf33f30e26..fc551eb571 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java @@ -38,9 +38,9 @@ import java.util.Optional; import java.util.Set; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientHeaderSampleComposerTest { +class ServiceClientHeaderSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; @@ -58,7 +58,7 @@ public class ServiceClientHeaderSampleComposerTest { /*Testing composeClassHeaderSample*/ @Test - public void composeClassHeaderSample_unaryRpc() { + void composeClassHeaderSample_unaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -86,7 +86,7 @@ public void composeClassHeaderSample_unaryRpc() { } @Test - public void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { + void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -170,7 +170,7 @@ public void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { } @Test - public void composeClassHeaderSample_firstMethodHasNoSignatures() { + void composeClassHeaderSample_firstMethodHasNoSignatures() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -232,7 +232,7 @@ public void composeClassHeaderSample_firstMethodHasNoSignatures() { } @Test - public void composeClassHeaderSample_firstMethodIsStream() { + void composeClassHeaderSample_firstMethodIsStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -291,7 +291,7 @@ public void composeClassHeaderSample_firstMethodIsStream() { /*Testing composeSetCredentialsSample*/ @Test - public void composeSetCredentialsSample() { + void composeSetCredentialsSample() { TypeNode clientType = TypeNode.withReference( VaporReference.builder() @@ -320,7 +320,7 @@ public void composeSetCredentialsSample() { /*Testing composeSetEndpointSample*/ @Test - public void composeSetEndpointSample() { + void composeSetEndpointSample() { TypeNode clientType = TypeNode.withReference( VaporReference.builder() @@ -347,7 +347,7 @@ public void composeSetEndpointSample() { /*Testing composeShowcaseMethodSample*/ @Test - public void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArguments() { + void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArguments() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -455,7 +455,7 @@ public void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArgument } @Test - public void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { + void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -537,7 +537,7 @@ public void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { } @Test - public void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInPagedMethod() { + void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInPagedMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -587,7 +587,7 @@ public void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInP } @Test - public void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMethod() { + void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -659,7 +659,7 @@ public void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMet } @Test - public void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() { + void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -727,7 +727,7 @@ public void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() } @Test - public void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { + void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -813,7 +813,7 @@ public void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { } @Test - public void valid_composeShowcaseMethodSample_lroRpcWithReturnVoid() { + void valid_composeShowcaseMethodSample_lroRpcWithReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java index 6ba7985b5d..d1b93a932a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java @@ -30,16 +30,16 @@ import java.util.Collections; import java.util.Map; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientMethodSampleComposerTest { +class ServiceClientMethodSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; private static final String PAGINATED_FIELD_NAME = "page_size"; @Test - public void valid_composeDefaultSample_isPagedMethod() { + void valid_composeDefaultSample_isPagedMethod() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -101,7 +101,7 @@ public void valid_composeDefaultSample_isPagedMethod() { } @Test - public void invalid_composeDefaultSample_isPagedMethod() { + void invalid_composeDefaultSample_isPagedMethod() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -150,7 +150,7 @@ public void invalid_composeDefaultSample_isPagedMethod() { } @Test - public void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { + void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -216,7 +216,7 @@ public void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { } @Test - public void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { + void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -285,7 +285,7 @@ public void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { } @Test - public void valid_composeDefaultSample_pureUnaryReturnVoid() { + void valid_composeDefaultSample_pureUnaryReturnVoid() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -344,7 +344,7 @@ public void valid_composeDefaultSample_pureUnaryReturnVoid() { } @Test - public void valid_composeDefaultSample_pureUnaryReturnResponse() { + void valid_composeDefaultSample_pureUnaryReturnResponse() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 00f319b0ce..6aa6d1f583 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -21,11 +21,11 @@ import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.test.utils.LineFormatter; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SettingsSampleComposerTest { +class SettingsSampleComposerTest { @Test - public void composeSettingsSample_noMethods() { + void composeSettingsSample_noMethods() { TypeNode classType = TypeNode.withReference( VaporReference.builder() @@ -40,7 +40,7 @@ public void composeSettingsSample_noMethods() { } @Test - public void composeSettingsSample_serviceSettingsClass() { + void composeSettingsSample_serviceSettingsClass() { TypeNode classType = TypeNode.withReference( VaporReference.builder() @@ -68,7 +68,7 @@ public void composeSettingsSample_serviceSettingsClass() { } @Test - public void composeSettingsSample_serviceStubClass() { + void composeSettingsSample_serviceStubClass() { TypeNode classType = TypeNode.withReference( VaporReference.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java index 2b82963899..0ec26d26cf 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java @@ -17,13 +17,13 @@ import static org.junit.Assert.assertEquals; import com.google.api.generator.test.utils.LineFormatter; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CommentFormatterTest { +class CommentFormatterTest { private static final String SERVICE_DESCRIPTION_HEADER_PATTERN = "Service Description: %s"; @Test - public void parseCommentWithItemizedList_paragraphContainsList() { + void parseCommentWithItemizedList_paragraphContainsList() { String protobufComment = LineFormatter.lines( "Service Name\n\n", @@ -43,7 +43,7 @@ public void parseCommentWithItemizedList_paragraphContainsList() { } @Test - public void parseCommentWithItemizedList_paragraphStartsWithList() { + void parseCommentWithItemizedList_paragraphStartsWithList() { String protobufComment = LineFormatter.lines( "Paragraphs starting with list items should still be parsed as list:\n\n", @@ -61,7 +61,7 @@ public void parseCommentWithItemizedList_paragraphStartsWithList() { } @Test - public void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { + void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { String protobufComment = LineFormatter.lines( "Service Name\n\n", @@ -83,7 +83,7 @@ public void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { } @Test - public void parseCommentWithPrefixPattern_ignoreIfStartsWithList() { + void parseCommentWithPrefixPattern_ignoreIfStartsWithList() { String protobufComment = LineFormatter.lines(" * This is item one\n", " * This is item two"); String result = CommentFormatter.formatAsJavaDocComment( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java index c8f220f65e..9636ca0ea6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java @@ -17,11 +17,11 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PackageCheckerTest { +class PackageCheckerTest { @Test - public void isGaApi_gaVersionPresent() { + void isGaApi_gaVersionPresent() { assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v1.services")); assertTrue(PackageChecker.isGaApi("com.google.cloud.v1.foobar.services")); assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v1")); @@ -34,7 +34,7 @@ public void isGaApi_gaVersionPresent() { } @Test - public void isGaApi_alphaBetaVersionPresent() { + void isGaApi_alphaBetaVersionPresent() { assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta1")); assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1alpha1")); assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta")); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java index 89ba60eabd..44069555a8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java @@ -18,12 +18,12 @@ import com.google.api.FieldInfo.Format; import com.google.api.generator.engine.ast.TypeNode; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class FieldTest { +class FieldTest { @Test - public void shouldAutoPopulate() { + void shouldAutoPopulate() { Field FIELD = Field.builder() .setName("SampleField") @@ -36,7 +36,7 @@ public void shouldAutoPopulate() { } @Test - public void isRequired_shouldNotAutoPopulate() { + void isRequired_shouldNotAutoPopulate() { Field FIELD = Field.builder() .setName("SampleField") @@ -49,7 +49,7 @@ public void isRequired_shouldNotAutoPopulate() { } @Test - public void fieldInfoFormatNotUUID4_shouldNotAutoPopulate() { + void fieldInfoFormatNotUUID4_shouldNotAutoPopulate() { Field FIELD = Field.builder() .setName("SampleField") @@ -62,7 +62,7 @@ public void fieldInfoFormatNotUUID4_shouldNotAutoPopulate() { } @Test - public void typeNotString_shouldNotAutoPopulate() { + void typeNotString_shouldNotAutoPopulate() { Field FIELD = Field.builder() .setName("SampleField") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java index ca4cd84418..b42e7e9134 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java @@ -34,15 +34,15 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicServiceConfigTest { +class GapicServiceConfigTest { private static final double EPSILON = 1e-4; private static final String TESTDATA_DIRECTORY = "src/test/resources/"; @Test - public void serviceConfig_noConfigsFound() { + void serviceConfig_noConfigsFound() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -70,7 +70,7 @@ public void serviceConfig_noConfigsFound() { } @Test - public void serviceConfig_basic() { + void serviceConfig_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -124,7 +124,7 @@ public void serviceConfig_basic() { } @Test - public void serviceConfig_withBatchingSettings() { + void serviceConfig_withBatchingSettings() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -197,7 +197,7 @@ public void serviceConfig_withBatchingSettings() { } @Test - public void serviceConfig_withLroRetrySettings() { + void serviceConfig_withLroRetrySettings() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java index f8713e0564..7ca27d167c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java @@ -17,28 +17,28 @@ import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.common.truth.Truth; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpBindingsTest { +class HttpBindingsTest { - public Field.Builder fieldBuilder; - public HttpBinding.Builder httpBindingBuilder; + private Field.Builder fieldBuilder; + private HttpBinding.Builder httpBindingBuilder; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { fieldBuilder = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT); httpBindingBuilder = HttpBinding.builder().setName("doesNotMatter"); } @Test - public void isOptional_shouldReturnFalseIfFieldIsNull() { + void isOptional_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isOptional()).isFalse(); } @Test - public void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { + void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsProto3Optional(false).build()).build(); @@ -46,7 +46,7 @@ public void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { } @Test - public void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { + void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsProto3Optional(true).build()).build(); @@ -54,13 +54,13 @@ public void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { } @Test - public void isRepeated_shouldReturnFalseIfFieldIsNull() { + void isRepeated_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isRepeated()).isFalse(); } @Test - public void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { + void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsRepeated(false).build()).build(); @@ -68,7 +68,7 @@ public void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { } @Test - public void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { + void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsRepeated(true).build()).build(); @@ -76,13 +76,13 @@ public void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { } @Test - public void isEnum_shouldReturnFalseIfFieldIsNull() { + void isEnum_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isEnum()).isFalse(); } @Test - public void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { + void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsEnum(false).build()).build(); @@ -90,7 +90,7 @@ public void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { } @Test - public void isEnum_shouldReturnTrueIfFieldExistsAndIsEnumIsTue() { + void isEnum_shouldReturnTrueIfFieldExistsAndIsEnumIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsEnum(true).build()).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java index 469c86c212..60d7dda9a7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java @@ -21,14 +21,14 @@ import com.google.api.generator.engine.ast.VaporReference; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MessageTest { +class MessageTest { private static final String SUB_FIELD_NAME = "table"; private static final String LEAF_FIELD_NAME = "size"; private static final String SUB_FIELD_TYPE = "TableFieldType"; - public static final VaporReference FIELD_TYPE = + private static final VaporReference FIELD_TYPE = VaporReference.builder().setPakkage("com.google").setName(SUB_FIELD_TYPE).build(); private static final String MESSAGE_NAME = "TestMessage"; private static final Message.Builder testMessageBuilder = @@ -38,7 +38,7 @@ public class MessageTest { .setType(TypeNode.OBJECT); @Test - public void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { + void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { Message message = testMessageBuilder.build(); IllegalStateException illegalStateException = assertThrows( @@ -50,7 +50,7 @@ public void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { } @Test - public void validateField_shouldThrowExceptionIfFieldDoesNotExist() { + void validateField_shouldThrowExceptionIfFieldDoesNotExist() { Message message = testMessageBuilder.build(); String fieldName = "doesNotExist"; NullPointerException nullPointerException = @@ -65,7 +65,7 @@ public void validateField_shouldThrowExceptionIfFieldDoesNotExist() { } @Test - public void validateField_shouldThrowExceptionIfMessageDoesNotExist() { + void validateField_shouldThrowExceptionIfMessageDoesNotExist() { Field subField = Field.builder() .setName(SUB_FIELD_NAME) @@ -92,7 +92,7 @@ public void validateField_shouldThrowExceptionIfMessageDoesNotExist() { } @Test - public void validateField_shouldThrowExceptionIfFieldIsRepeated() { + void validateField_shouldThrowExceptionIfFieldIsRepeated() { Field leafField = Field.builder() .setType(TypeNode.STRING) @@ -103,7 +103,7 @@ public void validateField_shouldThrowExceptionIfFieldIsRepeated() { } @Test - public void validateField_shouldThrowExceptionIfFieldIsOfWrongType() { + void validateField_shouldThrowExceptionIfFieldIsOfWrongType() { Field leafField = Field.builder().setType(TypeNode.BOOLEAN).setName(LEAF_FIELD_NAME).build(); testLeafField(leafField); } @@ -126,7 +126,7 @@ private void testLeafField(Field leafField) { } @Test - public void validateField_shouldNotThrowExceptionIfFieldExist() { + void validateField_shouldNotThrowExceptionIfFieldExist() { Field leafField = Field.builder().setType(TypeNode.STRING).setName(LEAF_FIELD_NAME).build(); Message subMessage = createSubMessage(leafField); Map messageTypes = ImmutableMap.of(FIELD_TYPE.fullName(), subMessage); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java index 691700cb3e..f0f4824c31 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java @@ -19,11 +19,11 @@ import com.google.api.generator.engine.ast.TypeNode; import java.util.function.BiFunction; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodArgumentTest { +class MethodArgumentTest { @Test - public void compareMethodArguments() { + void compareMethodArguments() { BiFunction methodArgFn = (name, type) -> MethodArgument.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java index 65c4f6039d..238df29fd7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java @@ -27,9 +27,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodTest { +class MethodTest { private static final Method METHOD = Method.builder() @@ -47,7 +47,7 @@ public class MethodTest { .build(); @Test - public void toStream() { + void toStream() { // Argument order: isClientStreaming, isServerStreaming. assertThat(Method.toStream(false, false)).isEqualTo(Method.Stream.NONE); assertThat(Method.toStream(true, false)).isEqualTo(Method.Stream.CLIENT); @@ -56,19 +56,19 @@ public void toStream() { } @Test - public void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsNull() { + void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsNull() { assertThat(METHOD.hasRoutingHeaderParams()).isFalse(); } @Test - public void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsEmpty() { + void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsEmpty() { Method method = METHOD.toBuilder().setRoutingHeaderRule(RoutingHeaderRule.builder().build()).build(); assertThat(method.hasRoutingHeaderParams()).isFalse(); } @Test - public void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { + void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { Method method = METHOD .toBuilder() @@ -81,7 +81,7 @@ public void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { } @Test - public void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { + void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { Method method = METHOD .toBuilder() @@ -94,15 +94,14 @@ public void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { } @Test - public void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRoutingHeadersIsNull() { + void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRoutingHeadersIsNull() { Method method = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setRoutingHeaderRule(null).build(); assertThat(method.shouldSetParamsExtractor()).isTrue(); } @Test - public void - shouldSetParamsExtractor_shouldReturnFalseIfHasHttpBindingsAndRoutingHeadersIsEmpty() { + void shouldSetParamsExtractor_shouldReturnFalseIfHasHttpBindingsAndRoutingHeadersIsEmpty() { Method method = METHOD .toBuilder() @@ -113,13 +112,13 @@ public void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRouting } @Test - public void shouldSetParamsExtractor_shouldReturnFalseIfHasNoHttpBindingsAndNoRoutingHeaders() { + void shouldSetParamsExtractor_shouldReturnFalseIfHasNoHttpBindingsAndNoRoutingHeaders() { Method method = METHOD.toBuilder().setHttpBindings(null).setRoutingHeaderRule(null).build(); assertThat(method.shouldSetParamsExtractor()).isFalse(); } @Test - public void hasAutoPopulatedFields_shouldReturnTrueIfMethodIsUnary() { + void hasAutoPopulatedFields_shouldReturnTrueIfMethodIsUnary() { List autoPopulatedFields = Arrays.asList("field1", "field2"); Method method = METHOD.toBuilder().setAutoPopulatedFields(autoPopulatedFields).build(); method.toStream(false, false); @@ -127,7 +126,7 @@ public void hasAutoPopulatedFields_shouldReturnTrueIfMethodIsUnary() { } @Test - public void hasAutoPopulatedFields_shouldReturnFalseIfMethodIsStreaming() { + void hasAutoPopulatedFields_shouldReturnFalseIfMethodIsStreaming() { List autoPopulatedFields = Arrays.asList("field1", "field2"); Method method = METHOD @@ -155,7 +154,7 @@ public void hasAutoPopulatedFields_shouldReturnFalseIfMethodIsStreaming() { } @Test - public void hasAutoPopulatedFields_shouldReturnFalseIfAutoPopulatedFieldsIsEmpty() { + void hasAutoPopulatedFields_shouldReturnFalseIfAutoPopulatedFieldsIsEmpty() { List autoPopulatedFields = new ArrayList<>(); Method method = METHOD @@ -168,8 +167,7 @@ public void hasAutoPopulatedFields_shouldReturnFalseIfAutoPopulatedFieldsIsEmpty } @Test - public void - isSupportedByTransport_shouldReturnTrueIfHasHttpBindingsAndIsRESTEligibleForRESTTransport() { + void isSupportedByTransport_shouldReturnTrueIfHasHttpBindingsAndIsRESTEligibleForRESTTransport() { Method methodNoStreaming = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.NONE).build(); assertThat(methodNoStreaming.isSupportedByTransport(Transport.REST)).isTrue(); @@ -179,7 +177,7 @@ public void hasAutoPopulatedFields_shouldReturnFalseIfAutoPopulatedFieldsIsEmpty } @Test - public void isSupportedByTransport_shouldReturnFalseIfNoHttpBindingsForRESTTransport() { + void isSupportedByTransport_shouldReturnFalseIfNoHttpBindingsForRESTTransport() { Method methodNoStreaming = METHOD.toBuilder().setHttpBindings(null).setStream(Method.Stream.NONE).build(); assertThat(methodNoStreaming.isSupportedByTransport(Transport.REST)).isFalse(); @@ -189,7 +187,7 @@ public void isSupportedByTransport_shouldReturnFalseIfNoHttpBindingsForRESTTrans } @Test - public void + void isSupportedByTransport_shouldReturnFalseIfHasHttpBindingsAndIsNotRESTEligibleForRESTTransport() { Method methodClientSideStreaming = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.CLIENT).build(); @@ -200,7 +198,7 @@ public void isSupportedByTransport_shouldReturnFalseIfNoHttpBindingsForRESTTrans } @Test - public void isSupportedByTransport_shouldReturnTrueForGRPCTransport() { + void isSupportedByTransport_shouldReturnTrueForGRPCTransport() { Method methodNoStreaming = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.NONE).build(); assertThat(methodNoStreaming.isSupportedByTransport(Transport.GRPC)).isTrue(); @@ -216,7 +214,7 @@ public void isSupportedByTransport_shouldReturnTrueForGRPCTransport() { } @Test - public void isSupportedByTransport_shouldThrowExceptionIfPassedGRPCRESTTransport() { + void isSupportedByTransport_shouldThrowExceptionIfPassedGRPCRESTTransport() { Method methodClientStreaming = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.CLIENT).build(); assertThrows( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java index 47667ae2ff..f0bdfe79e2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java @@ -18,9 +18,9 @@ import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RegionTagTest { +class RegionTagTest { private final String serviceName = "serviceName"; private final String apiVersion = "v1"; private final String apiShortName = "shortName"; @@ -28,7 +28,7 @@ public class RegionTagTest { private final String disambiguation = "disambiguation"; @Test - public void regionTagNoRpcName() { + void regionTagNoRpcName() { Assert.assertThrows( IllegalStateException.class, () -> @@ -42,7 +42,7 @@ public void regionTagNoRpcName() { } @Test - public void regionTagNoServiceName() { + void regionTagNoServiceName() { Assert.assertThrows( IllegalStateException.class, () -> @@ -56,7 +56,7 @@ public void regionTagNoServiceName() { } @Test - public void regionTagValidMissingFields() { + void regionTagValidMissingFields() { RegionTag regionTag = RegionTag.builder().setServiceName(serviceName).setRpcName(rpcName).build(); @@ -67,7 +67,7 @@ public void regionTagValidMissingFields() { } @Test - public void regionTagSanitizeAttributes() { + void regionTagSanitizeAttributes() { String apiVersion = "1.4.0-"; String serviceName = "service_Na@m*.e!{}"; String rpcName = "rpc _Nam^#,e [String]10"; @@ -84,7 +84,7 @@ public void regionTagSanitizeAttributes() { } @Test - public void generateRegionTagsMissingRequiredFields() { + void generateRegionTagsMissingRequiredFields() { RegionTag rtMissingShortName = RegionTag.builder() .setApiVersion(apiVersion) @@ -95,7 +95,7 @@ public void generateRegionTagsMissingRequiredFields() { } @Test - public void generateRegionTagsValidMissingFields() { + void generateRegionTagsValidMissingFields() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) @@ -109,7 +109,7 @@ public void generateRegionTagsValidMissingFields() { } @Test - public void generateRegionTagsAllFields() { + void generateRegionTagsAllFields() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) @@ -126,7 +126,7 @@ public void generateRegionTagsAllFields() { } @Test - public void generateRegionTagTag() { + void generateRegionTagTag() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java index 0cd6620c51..e48c504539 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java @@ -18,9 +18,9 @@ import com.google.common.truth.Truth; import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ResourceNameTest { +class ResourceNameTest { private final ResourceName resName = ResourceName.builder() .setVariableName("topic") @@ -31,7 +31,7 @@ public class ResourceNameTest { .build(); @Test - public void getMatchingPattern() { + void getMatchingPattern() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) @@ -45,7 +45,7 @@ public void getMatchingPattern() { } @Test - public void getMatchingPatternFromAdditionalPattern() { + void getMatchingPatternFromAdditionalPattern() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) @@ -59,7 +59,7 @@ public void getMatchingPatternFromAdditionalPattern() { } @Test - public void getMatchingPatternNoMatch() { + void getMatchingPatternNoMatch() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java index 8c2d1d361e..9311de8342 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java @@ -18,12 +18,12 @@ import com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoutingHeaderParamTest { +class RoutingHeaderParamTest { @Test - public void getDescendantFieldNames_shouldSplitFieldNameByDot() { + void getDescendantFieldNames_shouldSplitFieldNameByDot() { RoutingHeaderParam routingHeaderParam = RoutingHeaderParam.create("table.name", "name", "/abc/dec"); List descendantFieldNames = routingHeaderParam.getDescendantFieldNames(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java index 7b880ba394..9f13646d9a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java @@ -22,9 +22,9 @@ import java.util.Arrays; import java.util.List; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleTest { +class SampleTest { private final RegionTag regionTag = RegionTag.builder().setServiceName("serviceName").setRpcName("rpcName").build(); private final List sampleBody = @@ -33,14 +33,14 @@ public class SampleTest { Arrays.asList(CommentStatement.withComment(BlockComment.withComment("apache license"))); @Test - public void sampleNoRegionTag() { + void sampleNoRegionTag() { Assert.assertThrows( IllegalStateException.class, () -> Sample.builder().setBody(sampleBody).setFileHeader(header).build()); } @Test - public void sampleValidMissingFields() { + void sampleValidMissingFields() { Sample sample = Sample.builder().setRegionTag(regionTag).build(); Assert.assertEquals(ImmutableList.of(), sample.fileHeader()); @@ -50,7 +50,7 @@ public void sampleValidMissingFields() { } @Test - public void sampleWithHeader() { + void sampleWithHeader() { Sample sample = Sample.builder().setRegionTag(regionTag).setBody(sampleBody).build(); Assert.assertEquals(ImmutableList.of(), sample.fileHeader()); @@ -59,7 +59,7 @@ public void sampleWithHeader() { } @Test - public void sampleNameWithRegionTag() { + void sampleNameWithRegionTag() { Sample sample = Sample.builder().setRegionTag(regionTag).build(); Assert.assertEquals("SyncRpcName", sample.name()); @@ -73,7 +73,7 @@ public void sampleNameWithRegionTag() { } @Test - public void sampleNameWithRegionTagCanonical() { + void sampleNameWithRegionTagCanonical() { String disambig = "Disambiguation"; Sample sample = Sample.builder().setRegionTag(regionTag.withOverloadDisambiguation(disambig)).build(); @@ -86,7 +86,7 @@ public void sampleNameWithRegionTagCanonical() { } @Test - public void sampleCanonicalOverload() { + void sampleCanonicalOverload() { String disambig = "Disambiguation"; Sample sample = Sample.builder().setRegionTag(regionTag.withOverloadDisambiguation(disambig)).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java index 10b82ec585..624431fdd8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java @@ -18,16 +18,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import com.google.api.generator.engine.ast.TypeNode; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ServiceTest { +class ServiceTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private Service.Builder testServiceBuilder; @@ -46,8 +47,8 @@ public class ServiceTest { .setIsAsteriskBody(false) .setHttpVerb(HttpBindings.HttpVerb.GET); - @Before - public void init() { + @BeforeEach + void init() { testServiceBuilder = Service.builder() .setName("Echo") @@ -60,49 +61,49 @@ public void init() { } @Test - public void apiShortName_shouldReturnApiShortNameIfHostContainsRegionalEndpoint() { + void apiShortName_shouldReturnApiShortNameIfHostContainsRegionalEndpoint() { String defaultHost = "us-east1-pubsub.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("pubsub", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnApiShortName() { + void apiShortName_shouldReturnApiShortName() { String defaultHost = "logging.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("logging", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnApiShortNameForIam() { + void apiShortName_shouldReturnApiShortNameForIam() { String defaultHost = "iam-meta-api.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("iam", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnHostIfNoPeriods() { + void apiShortName_shouldReturnHostIfNoPeriods() { String defaultHost = "logging:7469"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("logging:7469", testService.apiShortName()); } @Test - public void packageVersion_shouldReturnVersionIfMatch() { + void packageVersion_shouldReturnVersionIfMatch() { String protoPackage = "com.google.showcase.v1"; Service testService = testServiceBuilder.setProtoPakkage(protoPackage).build(); assertEquals("v1", testService.packageVersion()); } @Test - public void packageVersion_shouldReturnEmptyIfNoMatch() { + void packageVersion_shouldReturnEmptyIfNoMatch() { String protoPackage = "com.google.showcase"; Service testService = testServiceBuilder.setProtoPakkage(protoPackage).build(); assertEquals("", testService.packageVersion()); } @Test - public void apiVersion_shouldReturnApiVersion() { + void apiVersion_shouldReturnApiVersion() { String apiVersion = "v1_20230601"; Service testService = testServiceBuilder.setApiVersion(apiVersion).build(); assertTrue(testService.hasApiVersion()); @@ -110,14 +111,14 @@ public void apiVersion_shouldReturnApiVersion() { } @Test - public void apiVersion_shouldReturnNoApiVersionWhenNull() { + void apiVersion_shouldReturnNoApiVersionWhenNull() { Service testService = testServiceBuilder.build(); assertNull(testService.apiVersion()); assertFalse(testService.hasApiVersion()); } @Test - public void apiVersion_shouldReturnNoApiVersionWhenEmpty() { + void apiVersion_shouldReturnNoApiVersionWhenEmpty() { String apiVersion = ""; Service testService = testServiceBuilder.setApiVersion(apiVersion).build(); assertEquals("", testService.apiVersion()); @@ -125,16 +126,14 @@ public void apiVersion_shouldReturnNoApiVersionWhenEmpty() { } @Test - public void - hasAnyEnabledMethodsForTransport_shouldReturnFalseForEmptyMethodListForBothTransports() { + void hasAnyEnabledMethodsForTransport_shouldReturnFalseForEmptyMethodListForBothTransports() { Service testService = testServiceBuilder.setMethods(ImmutableList.of()).build(); assertThat(testService.hasAnyEnabledMethodsForTransport(Transport.GRPC)).isFalse(); assertThat(testService.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); } @Test - public void - hasAnyEnabledMethodsForTransport_shouldReturnTrueForAnyNonEmptyMethodListGRPCTransport() { + void hasAnyEnabledMethodsForTransport_shouldReturnTrueForAnyNonEmptyMethodListGRPCTransport() { Method testMethod1 = testMethodBuilder .setStream(Method.Stream.NONE) @@ -157,7 +156,7 @@ public void apiVersion_shouldReturnNoApiVersionWhenEmpty() { } @Test - public void + void hasAnyEnabledMethodsForTransport_shouldReturnTrueForAnyNonEmptyAndValidMethodListRESTTransport() { Method testMethod1 = testMethodBuilder @@ -181,7 +180,7 @@ public void apiVersion_shouldReturnNoApiVersionWhenEmpty() { } @Test - public void + void hasAnyEnabledMethodsForTransport_shouldReturnFalseForAnyNonEmptyButInvalidMethodListRESTTransport() { Method testMethod1 = testMethodBuilder @@ -204,20 +203,22 @@ public void apiVersion_shouldReturnNoApiVersionWhenEmpty() { assertThat(testService3.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); } - @Test(expected = IllegalArgumentException.class) - public void hasAnyEnabledMethodsForTransport_shouldThrowExceptionForGRPCRESTTransport() { + @Test + void hasAnyEnabledMethodsForTransport_shouldThrowExceptionForGRPCRESTTransport() { Service testService = testServiceBuilder.build(); - testService.hasAnyEnabledMethodsForTransport(Transport.GRPC_REST); + assertThrows( + IllegalArgumentException.class, + () -> testService.hasAnyEnabledMethodsForTransport(Transport.GRPC_REST)); } @Test - public void hostServiceName_googleApisDefaultHost() { + void hostServiceName_googleApisDefaultHost() { Service service = testServiceBuilder.setDefaultHost("test.googleapis.com").build(); assertThat(service.hostServiceName()).isEqualTo("test"); } @Test - public void hostServiceName_nonGoogleApisDefaultHost() { + void hostServiceName_nonGoogleApisDefaultHost() { // Default Host is localhost:7469 Service service = testServiceBuilder.build(); assertThat(service.hostServiceName()).isEqualTo(""); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java index f83c2e16a8..f5f4b1ca8a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java @@ -3,46 +3,35 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(Parameterized.class) -public class TransportTest { - - private final String input; - private final Transport expected; - - @Parameterized.Parameters - public static Collection primeNumbers() { - return Arrays.asList( - new Object[][] { - {"grpc", Transport.GRPC}, - {"Grpc", Transport.GRPC}, - {"gRPC", Transport.GRPC}, - {"rest", Transport.REST}, - {"REST", Transport.REST}, - {"rESt", Transport.REST}, - {"grpc+rest", Transport.GRPC_REST}, - {"gRPC+REST", Transport.GRPC_REST}, - {"grPc+rEst", Transport.GRPC_REST} - }); +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class TransportTest { + + static Stream data() { + return Stream.of( + Arguments.of("grpc", Transport.GRPC), + Arguments.of("Grpc", Transport.GRPC), + Arguments.of("gRPC", Transport.GRPC), + Arguments.of("rest", Transport.REST), + Arguments.of("REST", Transport.REST), + Arguments.of("rESt", Transport.REST), + Arguments.of("grpc+rest", Transport.GRPC_REST), + Arguments.of("gRPC+REST", Transport.GRPC_REST), + Arguments.of("grPc+rEst", Transport.GRPC_REST)); } - public TransportTest(String input, Transport expected) { - this.input = input; - this.expected = expected; - } - - @Test - public void testParse_returnsValidTransport() { + @ParameterizedTest + @MethodSource("data") + void testParse_returnsValidTransport(String input, Transport expected) { assertThat(expected).isEqualTo(Transport.parse(input)); } @Test - public void testParse_throwsException() { + void testParse_throwsException() { assertThrows(IllegalArgumentException.class, () -> Transport.parse("invalid transport")); assertThrows(IllegalArgumentException.class, () -> Transport.parse("grHttpc")); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java index 3430c2585d..244346766a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java @@ -24,14 +24,14 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BatchingSettingsConfigParserTest { +class BatchingSettingsConfigParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseGapicSettings_plain() { + void parseGapicSettings_plain() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -40,7 +40,7 @@ public void parseGapicSettings_plain() { } @Test - public void parseGapicSettings_noMethodSettings() { + void parseGapicSettings_noMethodSettings() { String filename = "showcase_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -49,7 +49,7 @@ public void parseGapicSettings_noMethodSettings() { } @Test - public void parseBatchingSettings_logging() { + void parseBatchingSettings_logging() { String filename = "logging_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -82,7 +82,7 @@ public void parseBatchingSettings_logging() { } @Test - public void parseBatchingSettings_pubsub() { + void parseBatchingSettings_pubsub() { String filename = "pubsub_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java index 868231d516..c41b770bdd 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java @@ -21,14 +21,14 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicLanguageSettingsParserTest { +class GapicLanguageSettingsParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseLanguageSettings_onlyInterfacePresent() { + void parseLanguageSettings_onlyInterfacePresent() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional settingsOpt = @@ -40,7 +40,7 @@ public void parseLanguageSettings_onlyInterfacePresent() { } @Test - public void parseLanguageSettings_methodNameOverridesPresent() { + void parseLanguageSettings_methodNameOverridesPresent() { String filename = "logging_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java index 0c7f8e7d82..0ecdc78fbe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java @@ -22,15 +22,15 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicLroRetrySettingsParserTest { +class GapicLroRetrySettingsParserTest { private static final double DELTA = 0.0001; private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { + void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -39,7 +39,7 @@ public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { } @Test - public void parseGapicSettings_noMethodSettings() { + void parseGapicSettings_noMethodSettings() { String filename = "showcase_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -48,7 +48,7 @@ public void parseGapicSettings_noMethodSettings() { } @Test - public void parseLroRetrySettings_lroRetrySettingsPresent() { + void parseLroRetrySettings_lroRetrySettingsPresent() { String filename = "dataproc_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java index 30cf4d4b77..77a0440319 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java @@ -31,12 +31,12 @@ import java.util.HashSet; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -public class HttpRuleParserTest { +class HttpRuleParserTest { @Test - public void parseHttpAnnotation_basic() { + void parseHttpAnnotation_basic() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -61,7 +61,7 @@ public void parseHttpAnnotation_basic() { } @Test - public void parseHttpAnnotation_multipleBindings() { + void parseHttpAnnotation_multipleBindings() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -81,7 +81,7 @@ public void parseHttpAnnotation_multipleBindings() { } @Test - public void parseHttpAnnotation_missingFieldFromMessage() { + void parseHttpAnnotation_missingFieldFromMessage() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -97,8 +97,7 @@ public void parseHttpAnnotation_missingFieldFromMessage() { } @Test - public void - parseHttpAnnotation_shouldPutAllFieldsIntoQueryParamsIfPathParamAndBodyAreNotConfigured() { + void parseHttpAnnotation_shouldPutAllFieldsIntoQueryParamsIfPathParamAndBodyAreNotConfigured() { FileDescriptor fileDescriptor = HttpRuleParserTestingOuterClass.getDescriptor(); ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); assertEquals("HttpRuleParserTesting", serviceDescriptor.getName()); @@ -124,7 +123,7 @@ public void parseHttpAnnotation_missingFieldFromMessage() { Truth.assertThat(new HashSet<>(actual.queryParameters())).containsExactly(expected1, expected2); } - @Ignore + @Disabled @Test // request // / \ @@ -138,7 +137,7 @@ public void parseHttpAnnotation_missingFieldFromMessage() { // We need to either traverse all the leaf level fields and exclude field in the generator or pass // the excluded fields to gax-java. Re-enable this test once // https://github.com/googleapis/sdk-platform-java/issues/1041 is fixed - public void parseHttpAnnotation_shouldExcludeFieldsFromQueryParamsIfPathParamsAreConfigured() { + void parseHttpAnnotation_shouldExcludeFieldsFromQueryParamsIfPathParamsAreConfigured() { FileDescriptor fileDescriptor = HttpRuleParserTestingOuterClass.getDescriptor(); ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); assertEquals("HttpRuleParserTesting", serviceDescriptor.getName()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java index 68a2bbc66b..10bb943c6c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java @@ -28,12 +28,12 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodSignatureParserTest { +class MethodSignatureParserTest { @Test - public void flattenMethodSignatures_basic() { + void flattenMethodSignatures_basic() { String fooName = "fooName"; TypeNode fooTypeOne = TypeNode.withReference( @@ -70,7 +70,7 @@ public void flattenMethodSignatures_basic() { } @Test - public void flattenMethodSignatures_oneToMany() { + void flattenMethodSignatures_oneToMany() { String fooName = "fooName"; String anInt = "anInt"; @@ -110,7 +110,7 @@ public void flattenMethodSignatures_oneToMany() { } @Test - public void flattenMethodSignatures_manyToOne() { + void flattenMethodSignatures_manyToOne() { String fooName = "fooName"; String anInt = "anInt"; @@ -150,7 +150,7 @@ public void flattenMethodSignatures_manyToOne() { } @Test - public void flattenMethodSignatures_manyToMany() { + void flattenMethodSignatures_manyToMany() { String fooName = "fooName"; String barName = "barName"; String anInt = "anInt"; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java index f06c464055..66f2bf49a9 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java @@ -56,10 +56,10 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ParserTest { +class ParserTest { private static final String ECHO_PACKAGE = "com.google.showcase.v1beta1"; // TODO(miraleung): Backfill with more tests (e.g. field, message, methods) for Parser.java. private ServiceDescriptor echoService; @@ -69,8 +69,8 @@ public class ParserTest { private Optional serviceYamlProtoOpt; - @Before - public void setUp() { + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); String yamlFilename = "echo_v1beta1.yaml"; @@ -80,7 +80,7 @@ public void setUp() { } @Test - public void parseMessages_basic() { + void parseMessages_basic() { // TODO(miraleung): Add more tests for oneofs and other message-parsing edge cases. Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -116,7 +116,7 @@ public void parseMessages_basic() { } @Test - public void parseMessages_fieldNameConflicts() { + void parseMessages_fieldNameConflicts() { FileDescriptor bookshopFileDescriptor = BookshopProto.getDescriptor(); Map messageTypes = Parser.parseMessages(bookshopFileDescriptor); Message requestMessage = messageTypes.get("com.google.bookshop.v1beta1.GetBookRequest"); @@ -127,7 +127,7 @@ public void parseMessages_fieldNameConflicts() { } @Test - public void parseMethods_basic() { + void parseMethods_basic() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -190,7 +190,7 @@ public void parseMethods_basic() { } @Test - public void parseMethods_basicLro() { + void parseMethods_basicLro() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -218,7 +218,7 @@ public void parseMethods_basicLro() { } @Test - public void parseLro_missingResponseType() { + void parseLro_missingResponseType() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); MethodDescriptor waitMethodDescriptor = echoService.getMethods().get(7); assertEquals("Wait", waitMethodDescriptor.getName()); @@ -228,7 +228,7 @@ public void parseLro_missingResponseType() { } @Test - public void parseLro_missingMetadataType() { + void parseLro_missingMetadataType() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); MethodDescriptor waitMethodDescriptor = echoService.getMethods().get(7); assertEquals("Wait", waitMethodDescriptor.getName()); @@ -238,7 +238,7 @@ public void parseLro_missingMetadataType() { } @Test - public void parseMethodSignatures_empty() { + void parseMethodSignatures_empty() { // TODO(miraleung): Move this to MethodSignatureParserTest. MethodDescriptor methodDescriptor = echoService.getMethods().get(5); assertEquals("PagedExpand", methodDescriptor.getName()); @@ -259,7 +259,7 @@ public void parseMethodSignatures_empty() { } @Test - public void parseMethodSignatures_validArgstAndEmptyString() { + void parseMethodSignatures_validArgstAndEmptyString() { // TODO(miraleung): Move this to MethodSignatureParserTest. MethodDescriptor methodDescriptor = echoService.getMethods().get(0); assertEquals("Echo", methodDescriptor.getName()); @@ -282,7 +282,7 @@ public void parseMethodSignatures_validArgstAndEmptyString() { } @Test - public void parseMethodSignatures_basic() { + void parseMethodSignatures_basic() { MethodDescriptor echoMethodDescriptor = echoService.getMethods().get(0); TypeNode inputType = TypeParser.parseType(echoMethodDescriptor.getInputType()); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -361,7 +361,7 @@ public void parseMethodSignatures_basic() { } @Test - public void parseMessagesAndResourceNames_update() { + void parseMessagesAndResourceNames_update() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map messageTypes = Parser.parseMessages(lockerServiceFileDescriptor); @@ -381,7 +381,7 @@ public void parseMessagesAndResourceNames_update() { } @Test - public void parseMessages_fieldsHaveResourceReferences() { + void parseMessages_fieldsHaveResourceReferences() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map messageTypes = Parser.parseMessages(lockerServiceFileDescriptor); @@ -423,7 +423,7 @@ public void parseMessages_fieldsHaveResourceReferences() { } @Test - public void parseFields_mapType() { + void parseFields_mapType() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -442,7 +442,7 @@ public void parseFields_mapType() { } @Test - public void parseFields_autoPopulated() { + void parseFields_autoPopulated() { Map messageTypes = Parser.parseMessages(AutoPopulateFieldTestingOuterClass.getDescriptor()); Message message = @@ -474,7 +474,7 @@ public void parseFields_autoPopulated() { } @Test - public void parseAutoPopulatedMethodsAndFields_exists() { + void parseAutoPopulatedMethodsAndFields_exists() { String yamlFilename = "auto_populate_field_testing.yaml"; Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); Map> autoPopulatedMethodsWithFields = @@ -496,7 +496,7 @@ public void parseAutoPopulatedMethodsAndFields_exists() { } @Test - public void parseAutoPopulatedMethodsAndFields_doesNotExist() { + void parseAutoPopulatedMethodsAndFields_doesNotExist() { String yamlFilename = "logging.yaml"; Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); Optional serviceYamlProtoOpt_Null = ServiceYamlParser.parse(yamlPath.toString()); @@ -507,12 +507,12 @@ public void parseAutoPopulatedMethodsAndFields_doesNotExist() { } @Test - public void parseAutoPopulatedMethodsAndFields_returnsEmptyMapIfServiceYamlIsNull() { + void parseAutoPopulatedMethodsAndFields_returnsEmptyMapIfServiceYamlIsNull() { assertEquals(true, Parser.parseAutoPopulatedMethodsAndFields(Optional.empty()).isEmpty()); } @Test - public void parseAutoPopulatedMethodsAndFields_returnsMapOfMethodsAndAutoPopulatedFields() { + void parseAutoPopulatedMethodsAndFields_returnsMapOfMethodsAndAutoPopulatedFields() { MethodSettings testMethodSettings = MethodSettings.newBuilder() .setSelector("test_method") @@ -546,17 +546,17 @@ public void parseAutoPopulatedMethodsAndFields_returnsMapOfMethodsAndAutoPopulat } @Test - public void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotExist() { + void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotExist() { assertEquals(false, Parser.hasMethodSettings(Optional.empty())); } @Test - public void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotHavePublishing() { + void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotHavePublishing() { assertEquals(false, Parser.hasMethodSettings(Optional.of(Service.newBuilder().build()))); } @Test - public void hasMethodSettings_shouldReturnTrueIfServiceYamlHasNonEmptyMethodSettings() { + void hasMethodSettings_shouldReturnTrueIfServiceYamlHasNonEmptyMethodSettings() { MethodSettings testMethodSettings = MethodSettings.newBuilder().setSelector("test_method").build(); Publishing testPublishing = @@ -568,7 +568,7 @@ public void hasMethodSettings_shouldReturnTrueIfServiceYamlHasNonEmptyMethodSett } @Test - public void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { + void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -589,7 +589,7 @@ public void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { } @Test - public void sanitizeDefaultHost_basic() { + void sanitizeDefaultHost_basic() { String defaultHost = "localhost:1234"; assertEquals(defaultHost, Parser.sanitizeDefaultHost(defaultHost)); @@ -598,7 +598,7 @@ public void sanitizeDefaultHost_basic() { } @Test - public void parseNestedProtoTypeName() { + void parseNestedProtoTypeName() { assertEquals("MutateJobMetadata", Parser.parseNestedProtoTypeName("MutateJobMetadata")); assertEquals( "MutateJob.MutateJobMetadata", @@ -610,7 +610,7 @@ public void parseNestedProtoTypeName() { } @Test - public void parseServiceApiVersionTest() { + void parseServiceApiVersionTest() { FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); @@ -629,7 +629,7 @@ public void parseServiceApiVersionTest() { } @Test - public void parseServiceWithoutApiVersionTest() { + void parseServiceWithoutApiVersionTest() { FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); @@ -648,7 +648,7 @@ public void parseServiceWithoutApiVersionTest() { } @Test - public void parseServiceWithEmptyApiVersionTest() { + void parseServiceWithEmptyApiVersionTest() { FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); @@ -668,7 +668,7 @@ public void parseServiceWithEmptyApiVersionTest() { } @Test - public void testServiceWithoutApiVersionParsed() { + void testServiceWithoutApiVersionParsed() { FileDescriptor bookshopFileDescriptor = BookshopProto.getDescriptor(); Map messageTypes = Parser.parseMessages(bookshopFileDescriptor); Map resourceNames = Parser.parseResourceNames(bookshopFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java index 764c719af7..1ba2dd7d95 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java @@ -17,22 +17,22 @@ import static com.google.common.truth.Truth.assertThat; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PatternParserTest { +class PatternParserTest { @Test - public void getPattenBindings_shouldReturnEmptySetIfPatternIsEmpty() { + void getPattenBindings_shouldReturnEmptySetIfPatternIsEmpty() { assertThat(PatternParser.getPatternBindings("")).isEmpty(); } @Test - public void getPattenBindings_shouldFilterOutUnboundVariables() { + void getPattenBindings_shouldFilterOutUnboundVariables() { Set actual = PatternParser.getPatternBindings("{routing_id=projects/*}/**"); assertThat(actual).hasSize(1); } @Test - public void getPattenBindings_shouldReturnBindingsInNatualOrder() { + void getPattenBindings_shouldReturnBindingsInNatualOrder() { Set actual = PatternParser.getPatternBindings("{routing_id=projects/*}/{name=instance/*}"); assertThat(actual).containsExactly("name", "routing_id").inOrder(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java index bebe828f71..83e75f87f5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java @@ -22,11 +22,11 @@ import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PluginArgumentParserTest { +class PluginArgumentParserTest { @Test - public void parseJsonPath_onlyOnePresent() { + void parseJsonPath_onlyOnePresent() { String jsonPath = "/tmp/grpc_service_config.json"; assertEquals( jsonPath, @@ -34,7 +34,7 @@ public void parseJsonPath_onlyOnePresent() { } @Test - public void parseJsonPath_returnsFirstOneFound() { + void parseJsonPath_returnsFirstOneFound() { String jsonPathOne = "/tmp/foobar_grpc_service_config.json"; String jsonPathTwo = "/tmp/some_other_grpc_service_config.json"; assertEquals( @@ -49,7 +49,7 @@ public void parseJsonPath_returnsFirstOneFound() { } @Test - public void parseJsonPath_similarFileAppearsFirst() { + void parseJsonPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -65,7 +65,7 @@ public void parseJsonPath_similarFileAppearsFirst() { } @Test - public void parseJsonPath_argumentHasSpaces() { + void parseJsonPath_argumentHasSpaces() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -81,7 +81,7 @@ public void parseJsonPath_argumentHasSpaces() { } @Test - public void parseJsonPath_restAreEmpty() { + void parseJsonPath_restAreEmpty() { String jsonPath = "/tmp/foobar_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -90,14 +90,14 @@ public void parseJsonPath_restAreEmpty() { } @Test - public void parseJsonPath_noneFound() { + void parseJsonPath_noneFound() { String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = String.join(",", Arrays.asList(gapicPath)); assertFalse(PluginArgumentParser.parseJsonConfigPath(rawArgument).isPresent()); } @Test - public void parseGapicYamlPath_onlyOnePresent() { + void parseGapicYamlPath_onlyOnePresent() { String gapicPath = "/tmp/something_gapic.yaml"; assertEquals( gapicPath, @@ -105,7 +105,7 @@ public void parseGapicYamlPath_onlyOnePresent() { } @Test - public void parseGapicYamlPath_returnsFirstOneFound() { + void parseGapicYamlPath_returnsFirstOneFound() { String gapicPathOne = "/tmp/something_gapic.yaml"; String gapicPathTwo = "/tmp/other_gapic.yaml"; assertEquals( @@ -119,7 +119,7 @@ public void parseGapicYamlPath_returnsFirstOneFound() { } @Test - public void parseGapicYamlPath_similarFileAppearsFirst() { + void parseGapicYamlPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -134,7 +134,7 @@ public void parseGapicYamlPath_similarFileAppearsFirst() { } @Test - public void parseGapicYamlPath_restAreEmpty() { + void parseGapicYamlPath_restAreEmpty() { String jsonPath = ""; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -143,7 +143,7 @@ public void parseGapicYamlPath_restAreEmpty() { } @Test - public void parseGapicYamlPath_noneFound() { + void parseGapicYamlPath_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -152,7 +152,7 @@ public void parseGapicYamlPath_noneFound() { } @Test - public void parseServiceYamlPath_onlyOnePresent() { + void parseServiceYamlPath_onlyOnePresent() { String servicePath = "/tmp/something.yaml"; assertEquals( servicePath, @@ -160,7 +160,7 @@ public void parseServiceYamlPath_onlyOnePresent() { } @Test - public void parseServiceYamlPath_returnsFirstOneFound() { + void parseServiceYamlPath_returnsFirstOneFound() { String servicePathOne = "/tmp/something.yaml"; String servicePathTwo = "/tmp/other.yaml"; assertEquals( @@ -174,7 +174,7 @@ public void parseServiceYamlPath_returnsFirstOneFound() { } @Test - public void parseServiceYamlPath_gapicFilePresent() { + void parseServiceYamlPath_gapicFilePresent() { String gapicPath = "/tmp/something_gapic.yaml"; String servicePath = "/tmp/something.yaml"; // Both passed under the service yaml flag. @@ -203,7 +203,7 @@ public void parseServiceYamlPath_gapicFilePresent() { } @Test - public void parseServiceYamlPath_similarFileAppearsFirst() { + void parseServiceYamlPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String servicePath = "/tmp/something.yaml"; @@ -220,7 +220,7 @@ public void parseServiceYamlPath_similarFileAppearsFirst() { } @Test - public void parseServiceYamlPath_noneFound() { + void parseServiceYamlPath_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -229,7 +229,7 @@ public void parseServiceYamlPath_noneFound() { } @Test - public void hasMetadataFlag() { + void hasMetadataFlag() { CodeGeneratorRequest request = CodeGeneratorRequest.newBuilder() .setParameter(String.join(",", KEY_METADATA, "does-not-matter")) @@ -238,7 +238,7 @@ public void hasMetadataFlag() { } @Test - public void hasNumericEnumFlag() { + void hasNumericEnumFlag() { CodeGeneratorRequest request = CodeGeneratorRequest.newBuilder() .setParameter(String.join(",", KEY_NUMERIC_ENUM, "does-not-matter")) @@ -247,7 +247,7 @@ public void hasNumericEnumFlag() { } @Test - public void hasFlag_noneFound() { + void hasFlag_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -261,7 +261,7 @@ public void hasFlag_noneFound() { } @Test - public void hasFlag_flagFound() { + void hasFlag_flagFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java index 04b6622b5a..d10cf818b3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java @@ -31,21 +31,21 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceNameParserTest { +class ResourceNameParserTest { private static final String MAIN_PACKAGE = "com.google.testgapic.v1beta1"; private FileDescriptor lockerServiceFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { lockerServiceFileDescriptor = LockerProto.getDescriptor(); } @Test - public void parseResourceNames_basicOnePattern() { + void parseResourceNames_basicOnePattern() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -63,7 +63,7 @@ public void parseResourceNames_basicOnePattern() { } @Test - public void parseResourceNames_basicTwoPatterns() { + void parseResourceNames_basicTwoPatterns() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -81,7 +81,7 @@ public void parseResourceNames_basicTwoPatterns() { } @Test - public void parseResourceNames_wildcard() { + void parseResourceNames_wildcard() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -101,7 +101,7 @@ public void parseResourceNames_wildcard() { } @Test - public void parseResourceNames_deletedTopic() { + void parseResourceNames_deletedTopic() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -117,7 +117,7 @@ public void parseResourceNames_deletedTopic() { } @Test - public void parseResourceNames_messageResourceDefinition() { + void parseResourceNames_messageResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Map typeStringsToResourceNames = @@ -137,7 +137,7 @@ public void parseResourceNames_messageResourceDefinition() { } @Test - public void parseResourceNames_badMessageResourceNameDefinitionMissingNameField() { + void parseResourceNames_badMessageResourceNameDefinitionMissingNameField() { FileDescriptor protoFileDescriptor = BadMessageResnameDefProto.getDescriptor(); List messageDescriptors = protoFileDescriptor.getMessageTypes(); Descriptor messageDescriptor = messageDescriptors.get(0); @@ -149,7 +149,7 @@ public void parseResourceNames_badMessageResourceNameDefinitionMissingNameField( } @Test - public void parseResourceNameFromMessage_basicResourceDefinition() { + void parseResourceNameFromMessage_basicResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor documentMessageDescriptor = messageDescriptors.get(0); @@ -161,7 +161,7 @@ public void parseResourceNameFromMessage_basicResourceDefinition() { } @Test - public void parseResourceNamesFromMessage_noResourceDefinition() { + void parseResourceNamesFromMessage_noResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor folderMessageDescriptor = messageDescriptors.get(1); @@ -172,7 +172,7 @@ public void parseResourceNamesFromMessage_noResourceDefinition() { } @Test - public void parseResourceNameFromMessage_nonNameResourceReferenceField() { + void parseResourceNameFromMessage_nonNameResourceReferenceField() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor binderMessageDescriptor = messageDescriptors.get(2); @@ -184,7 +184,7 @@ public void parseResourceNameFromMessage_nonNameResourceReferenceField() { } @Test - public void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { + void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { FileDescriptor protoFileDescriptor = BadMessageResnameDefProto.getDescriptor(); String pakkage = TypeParser.getPackage(protoFileDescriptor); List messageDescriptors = protoFileDescriptor.getMessageTypes(); @@ -197,14 +197,14 @@ public void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { } @Test - public void getVariableName_basicPattern() { + void getVariableName_basicPattern() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/{project}"); assertTrue(nameOpt.isPresent()); assertEquals("project", nameOpt.get()); } @Test - public void getVariableName_basicPatternLonger() { + void getVariableName_basicPatternLonger() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern( "projects/{project}/billingAccounts/{billing_account}"); @@ -213,7 +213,7 @@ public void getVariableName_basicPatternLonger() { } @Test - public void getVariableName_differentCasedName() { + void getVariableName_differentCasedName() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern( "projects/{project}/billingAccounts/{billingAccOunt}"); @@ -222,7 +222,7 @@ public void getVariableName_differentCasedName() { } @Test - public void getVariableName_singletonEnding() { + void getVariableName_singletonEnding() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/{project}/cmekSettings"); assertTrue(nameOpt.isPresent()); @@ -230,7 +230,7 @@ public void getVariableName_singletonEnding() { } @Test - public void getVariableName_onlyLiterals() { + void getVariableName_onlyLiterals() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/project/locations/location"); assertTrue(nameOpt.isPresent()); @@ -238,7 +238,7 @@ public void getVariableName_onlyLiterals() { } @Test - public void getVariableName_deletedTopic() { + void getVariableName_deletedTopic() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern(ResourceNameConstants.DELETED_TOPIC_LITERAL); assertTrue(nameOpt.isPresent()); @@ -246,7 +246,7 @@ public void getVariableName_deletedTopic() { } @Test - public void getVariableName_wildcard() { + void getVariableName_wildcard() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern(ResourceNameConstants.WILDCARD_PATTERN); assertFalse(nameOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java index b5f1725d4c..950a555587 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java @@ -26,21 +26,21 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceReferenceParserTest { +class ResourceReferenceParserTest { private static final String MAIN_PACKAGE = "com.google.testgapic.v1beta1"; private FileDescriptor lockerServiceFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { lockerServiceFileDescriptor = LockerProto.getDescriptor(); } @Test - public void parseParentResourceName_createFromPattern() { + void parseParentResourceName_createFromPattern() { String resourceNamePackage = String.format("%s.common", MAIN_PACKAGE); String domainName = "cloudbilling.googleapis.com"; String description = "This is the resource name description"; @@ -76,7 +76,7 @@ public void parseParentResourceName_createFromPattern() { } @Test - public void parseParentResourceName_parentResourceNameExists() { + void parseParentResourceName_parentResourceNameExists() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); @@ -103,7 +103,7 @@ public void parseParentResourceName_parentResourceNameExists() { } @Test - public void parseParentResourceName_badPattern() { + void parseParentResourceName_badPattern() { Optional parentResourceNameOpt = ResourceReferenceParser.parseParentResourceName( "projects/{project}/billingAccounts", @@ -117,19 +117,19 @@ public void parseParentResourceName_badPattern() { } @Test - public void resolvePackages_resourcePackageIsSubpackageOfService() { + void resolvePackages_resourcePackageIsSubpackageOfService() { String resourcePackage = "com.google.testgapic.v1beta1.common"; assertEquals( resourcePackage, ResourceReferenceParser.resolvePackages(resourcePackage, MAIN_PACKAGE)); } @Test - public void resolvePackages_resourcePackageIsSameAsService() { + void resolvePackages_resourcePackageIsSameAsService() { assertEquals(MAIN_PACKAGE, ResourceReferenceParser.resolvePackages(MAIN_PACKAGE, MAIN_PACKAGE)); } @Test - public void resolvePackages_resourcePackageIsNotSubpackageOfService() { + void resolvePackages_resourcePackageIsNotSubpackageOfService() { assertEquals( MAIN_PACKAGE, ResourceReferenceParser.resolvePackages("com.google.cloud", MAIN_PACKAGE)); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java index 0908d79080..02e8bf1902 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java @@ -25,9 +25,9 @@ import com.google.protobuf.Descriptors.MethodDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoutingRuleParserTest { +class RoutingRuleParserTest { private static final FileDescriptor TESTING_FILE_DESCRIPTOR = RoutingRuleParserTestingOuterClass.getDescriptor(); @@ -35,13 +35,13 @@ public class RoutingRuleParserTest { TESTING_FILE_DESCRIPTOR.getServices().get(0); @Test - public void parse_shouldReturnNullRoutingHeadersIfMethodHasNoRoutingRules() { + void parse_shouldReturnNullRoutingHeadersIfMethodHasNoRoutingRules() { RoutingHeaderRule actual = getRoutingHeaders(0); assertThat(actual).isNull(); } @Test - public void parse_shouldSetPathTemplateToWildcardIfNotDefined() { + void parse_shouldSetPathTemplateToWildcardIfNotDefined() { RoutingHeaderRule actual = getRoutingHeaders(1); RoutingHeaderParam expected = RoutingHeaderParam.create("name", "name", String.format("{%s=**}", "name")); @@ -49,7 +49,7 @@ public void parse_shouldSetPathTemplateToWildcardIfNotDefined() { } @Test - public void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { + void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { IllegalArgumentException illegalArgumentException = assertThrows(IllegalArgumentException.class, () -> getRoutingHeaders(2)); assertThat(illegalArgumentException.getMessage()) @@ -60,7 +60,7 @@ public void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { } @Test - public void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() { + void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() { IllegalArgumentException illegalArgumentException = assertThrows(IllegalArgumentException.class, () -> getRoutingHeaders(3)); assertThat(illegalArgumentException.getMessage()) @@ -71,7 +71,7 @@ public void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() } @Test - public void parse_shouldParseRoutingRulesWithOneParameter() { + void parse_shouldParseRoutingRulesWithOneParameter() { RoutingHeaderRule actual = getRoutingHeaders(4); RoutingHeaderParam expected = RoutingHeaderParam.create("name", "rename", "/v1beta1/{rename=tests/*}"); @@ -79,7 +79,7 @@ public void parse_shouldParseRoutingRulesWithOneParameter() { } @Test - public void parse_shouldParseRoutingRulesWithMultipleParameter() { + void parse_shouldParseRoutingRulesWithMultipleParameter() { RoutingHeaderRule actual = getRoutingHeaders(5); RoutingHeaderParam expectedHeader1 = RoutingHeaderParam.create("name", "rename", "/v1beta1/{rename=tests/*}"); @@ -91,7 +91,7 @@ public void parse_shouldParseRoutingRulesWithMultipleParameter() { } @Test - public void parse_shouldParseRoutingRulesWithNestedFields() { + void parse_shouldParseRoutingRulesWithNestedFields() { RoutingHeaderRule actual = getRoutingHeaders(6); RoutingHeaderParam expectedHeader1 = RoutingHeaderParam.create("account.name", "rename", "/v1beta1/{rename=tests/*}"); @@ -99,7 +99,7 @@ public void parse_shouldParseRoutingRulesWithNestedFields() { } @Test - public void parse_shouldThrowExceptionIfFieldValidationFailed() { + void parse_shouldThrowExceptionIfFieldValidationFailed() { assertThrows(Exception.class, () -> getRoutingHeaders(7)); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java index 8a27f7fd4f..80b28ed12c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java @@ -25,15 +25,15 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceConfigParserTest { +class ServiceConfigParserTest { private static final String JSON_DIRECTORY = "src/test/resources/"; private static final double EPSILON = 1e-4; @Test - public void parseServiceConfig_basic() { + void parseServiceConfig_basic() { String jsonFilename = "retrying_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -60,7 +60,7 @@ public void parseServiceConfig_basic() { } @Test - public void parseServiceConfig_showcase() { + void parseServiceConfig_showcase() { String jsonFilename = "showcase_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -79,7 +79,7 @@ public void parseServiceConfig_showcase() { } @Test - public void parseBadServiceConfig_missingFile() { + void parseBadServiceConfig_missingFile() { String jsonFilename = "does_not_exist_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -87,7 +87,7 @@ public void parseBadServiceConfig_missingFile() { } @Test - public void parseBadServiceConfig_malformedJson() { + void parseBadServiceConfig_malformedJson() { String jsonFilename = "malformed_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -95,7 +95,7 @@ public void parseBadServiceConfig_malformedJson() { } @Test - public void parseBadServiceConfig_badProtoFields() { + void parseBadServiceConfig_badProtoFields() { String jsonFilename = "bad_proto_fields_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -103,7 +103,7 @@ public void parseBadServiceConfig_badProtoFields() { } @Test - public void parseBadServiceConfig_nullOrEmptyPath() { + void parseBadServiceConfig_nullOrEmptyPath() { Optional configOpt = ServiceConfigParser.parseFile(null); assertFalse(configOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java index 213b0abab8..a9270e2113 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java @@ -24,14 +24,14 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceYamlParserTest { +class ServiceYamlParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseServiceYaml_basic() { + void parseServiceYaml_basic() { String yamlFilename = "logging.yaml"; Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); Optional serviceYamlProtoOpt = @@ -45,7 +45,7 @@ public void parseServiceYaml_basic() { // TODO: Add more scenarios (e.g. null MethodSettings, null PublishingSettings, incorrect // FieldNames, etc.) @Test - public void parseServiceYaml_autoPopulatedFields() { + void parseServiceYaml_autoPopulatedFields() { String yamlFilename = "auto_populate_field_testing.yaml"; Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); Optional serviceYamlProtoOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index 40b9eb12f0..c9e40a8274 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -32,10 +32,10 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class SourceCodeInfoParserTest { +class SourceCodeInfoParserTest { private static final String BASIC_PROTO = "basic.proto"; private static final String PROTO_DESCRIPTOR_SET = "test-proto.descriptorset"; @@ -43,14 +43,14 @@ public class SourceCodeInfoParserTest { private SourceCodeInfoParser parser; private FileDescriptor protoFile; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { parser = new SourceCodeInfoParser(); protoFile = buildFileDescriptor(); } @Test - public void getServiceInfo() { + void getServiceInfo() { SourceCodeInfoLocation location = parser.getLocation(protoFile.findServiceByName("FooService")); assertEquals( "This is a service description.\n It takes up multiple lines, like so.", @@ -61,7 +61,7 @@ public void getServiceInfo() { } @Test - public void getMethodInfo() { + void getMethodInfo() { ServiceDescriptor service = protoFile.findServiceByName("FooService"); SourceCodeInfoLocation location = parser.getLocation(service.findMethodByName("FooMethod")); assertEquals( @@ -74,7 +74,7 @@ public void getMethodInfo() { } @Test - public void getOuterMessageInfo() { + void getOuterMessageInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); SourceCodeInfoLocation location = parser.getLocation(message); assertEquals( @@ -95,7 +95,7 @@ public void getOuterMessageInfo() { } @Test - public void getInnerMessageInfo() { + void getInnerMessageInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); assertThat(message).isNotNull(); message = message.findNestedTypeByName("BarMessage"); @@ -113,7 +113,7 @@ public void getInnerMessageInfo() { } @Test - public void getOuterEnumInfo() { + void getOuterEnumInfo() { EnumDescriptor protoEnum = protoFile.findEnumTypeByName("OuterEnum"); SourceCodeInfoLocation location = parser.getLocation(protoEnum); assertEquals("This is an outer enum.", location.getLeadingComments()); @@ -124,7 +124,7 @@ public void getOuterEnumInfo() { } @Test - public void getInnerEnumInfo() { + void getInnerEnumInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); EnumDescriptor protoEnum = message.findEnumTypeByName("FoodEnum"); SourceCodeInfoLocation location = parser.getLocation(protoEnum); @@ -138,7 +138,7 @@ public void getInnerEnumInfo() { } @Test - public void getOnoeofInfo() { + void getOnoeofInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); OneofDescriptor protoOneof = message.getOneofs().get(0); SourceCodeInfoLocation location = parser.getLocation(protoOneof); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java index 455f04bcae..aea2c9cfc1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java @@ -31,9 +31,9 @@ import com.google.test.collisions.CollisionsOuterClass; import com.google.testgapic.v1beta1.NestedMessageProto; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TypeParserTest { +class TypeParserTest { // TODO(miraleung): Backfill with more tests (e.g. field, message, methods) for Parser.java. private static final FileDescriptor COLLISIONS_FILE_DESCRIPTOR = @@ -46,7 +46,7 @@ public class TypeParserTest { COLLISIONS_FILE_DESCRIPTOR.getServices().get(0); @Test - public void parseMessageType_basic() { + void parseMessageType_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); ServiceDescriptor echoService = echoFileDescriptor.getServices().get(0); assertEquals("Echo", echoService.getName()); @@ -57,7 +57,7 @@ public void parseMessageType_basic() { } @Test - public void parseMessageType_nested() { + void parseMessageType_nested() { FileDescriptor fileDescriptor = NestedMessageProto.getDescriptor(); Descriptor messageDescriptor = fileDescriptor.getMessageTypes().get(0); assertEquals("Outer", messageDescriptor.getName()); @@ -71,7 +71,7 @@ public void parseMessageType_nested() { } @Test - public void parseLroResponseMetadataType_shortName_shouldMatchSamePackage() { + void parseLroResponseMetadataType_shortName_shouldMatchSamePackage() { Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); messageTypes.putAll(Parser.parseMessages(LOCATION_PROTO_FILE_DESCRIPTOR)); @@ -97,7 +97,7 @@ public void parseLroResponseMetadataType_shortName_shouldMatchSamePackage() { } @Test - public void parseLroResponseMetadataType_shortName_shouldNotMatch() { + void parseLroResponseMetadataType_shortName_shouldNotMatch() { Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); MethodDescriptor shortNameMatchShouldThrowLro = COLLISIONS_SERVICE.getMethods().get(1); @@ -116,7 +116,7 @@ public void parseLroResponseMetadataType_shortName_shouldNotMatch() { } @Test - public void parseLroResponseMetadataType_shortName_withFullyQualifiedCollision() { + void parseLroResponseMetadataType_shortName_withFullyQualifiedCollision() { Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); messageTypes.putAll(Parser.parseMessages(LOCATION_PROTO_FILE_DESCRIPTOR)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java index bd7f475107..04d0dfa7de 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java @@ -12,42 +12,41 @@ import java.io.InputStreamReader; import java.io.Reader; import java.nio.file.Files; +import java.nio.file.Path; import java.util.Collections; import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.JarOutputStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; -public class WriterTest { +class WriterTest { private static final TypeToken> REFLECT_CONFIG_JSON_FORMAT = new TypeToken>() {}; - @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); - + @TempDir Path tempDir; private JarOutputStream jarOutputStream; - private File file; - @Before - public void createJarOutputStream() throws IOException { - file = tempFolder.newFile("test.jar"); - jarOutputStream = new JarOutputStream(Files.newOutputStream(file.toPath())); + @BeforeEach + void createJarOutputStream() throws IOException { + Path path = tempDir.resolve("test.jar"); + jarOutputStream = new JarOutputStream(Files.newOutputStream(path)); + file = path.toFile(); } - @After - public void assertJarOutputStream_isClosed() { + @AfterEach + void assertJarOutputStream_isClosed() { assertThrows( IOException.class, () -> jarOutputStream.putNextEntry(new JarEntry("should.fail"))); } @Test - public void reflectConfig_notWritten_ifEmptyInput() throws IOException { + void reflectConfig_notWritten_ifEmptyInput() throws IOException { Writer.writeReflectConfigFile("com.google", Collections.emptyList(), jarOutputStream); jarOutputStream.finish(); @@ -60,7 +59,7 @@ public void reflectConfig_notWritten_ifEmptyInput() throws IOException { } @Test - public void reflectConfig_isWritten() throws IOException { + void reflectConfig_isWritten() throws IOException { Writer.writeReflectConfigFile( "com.google", Collections.singletonList(new ReflectConfig("com.google.Class")), diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java index fec084555c..30b55801f7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java @@ -17,11 +17,11 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaStyleTest { +class JavaStyleTest { @Test - public void emptyOrNull() { + void emptyOrNull() { String value = ""; assertEquals("", JavaStyle.toLowerCamelCase(value)); assertEquals("", JavaStyle.toUpperCamelCase(value)); @@ -32,42 +32,42 @@ public void emptyOrNull() { } @Test - public void singleWord() { + void singleWord() { String value = "dog"; assertEquals("dog", JavaStyle.toLowerCamelCase(value)); assertEquals("Dog", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromLowerSnake() { + void fromLowerSnake() { String value = "factory_decorator_delegate_impl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromUpperSnake() { + void fromUpperSnake() { String value = "FACTORY_DECORATOR_DELEGATE_IMPL"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromLowerCamelCase() { + void fromLowerCamelCase() { String value = "factoryDecoratorDelegateImpl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromUpperCamelCase() { + void fromUpperCamelCase() { String value = "FactoryDecoratorDelegateImpl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void wordAndNumber() { + void wordAndNumber() { String value = "dog2"; assertEquals("dog2", JavaStyle.toLowerCamelCase(value)); assertEquals("Dog2", JavaStyle.toUpperCamelCase(value)); @@ -77,14 +77,14 @@ public void wordAndNumber() { } @Test - public void upperWordAndNumber() { + void upperWordAndNumber() { String value = "Dog_v2"; assertEquals("dogV2", JavaStyle.toLowerCamelCase(value)); assertEquals("DogV2", JavaStyle.toUpperCamelCase(value)); } @Test - public void upperWordAndCharsAfterDigit() { + void upperWordAndCharsAfterDigit() { String value = "dogV2cc"; assertEquals("dogV2Cc", JavaStyle.toLowerCamelCase(value)); assertEquals("DogV2Cc", JavaStyle.toUpperCamelCase(value)); @@ -103,7 +103,7 @@ public void upperWordAndCharsAfterDigit() { } @Test - public void acronyms() { + void acronyms() { String value = "iam_http_xml_dog"; assertEquals("iamHttpXmlDog", JavaStyle.toLowerCamelCase(value)); assertEquals("IamHttpXmlDog", JavaStyle.toUpperCamelCase(value)); @@ -113,7 +113,7 @@ public void acronyms() { } @Test - public void keyword() { + void keyword() { String value = "import"; assertEquals("import_", JavaStyle.toLowerCamelCase(value)); assertEquals("Import", JavaStyle.toUpperCamelCase(value)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java index 82147dcbf5..f640f6306b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java @@ -19,47 +19,47 @@ import static org.junit.Assert.assertTrue; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ResourceReferenceUtilsTest { +class ResourceReferenceUtilsTest { @Test - public void parseParentPattern_basic() { + void parseParentPattern_basic() { String parentPattern = "projects/{project}"; String pattern = String.format("%s/folders/{folder}", parentPattern); assertEquals(parentPattern, ResourceReferenceUtils.parseParentPattern(pattern).get()); } @Test - public void parseParentPattern_wildcard() { + void parseParentPattern_wildcard() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern(ResourceNameConstants.WILDCARD_PATTERN); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_deletedTopicLiteral() { + void parseParentPattern_deletedTopicLiteral() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern(ResourceNameConstants.DELETED_TOPIC_LITERAL); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_noParents() { + void parseParentPattern_noParents() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/{project}"); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_insufficientPathComponents() { + void parseParentPattern_insufficientPathComponents() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/foobars/{foobar}"); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_lastComponentIsNotAVariable() { + void parseParentPattern_lastComponentIsNotAVariable() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/{project}/foobars"); assertTrue(parentPatternOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java index eea5c7b937..4de2eff275 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java @@ -23,10 +23,10 @@ import java.util.Arrays; import java.util.List; -public class Differ { +class Differ { private static final String LINE_SPLITTER = "\\r?\\n"; - public static List diff(Path goldenFilePath, String codegen) { + static List diff(Path goldenFilePath, String codegen) { List revised = Arrays.asList(codegen.split(LINE_SPLITTER)); List original = null; try { @@ -38,7 +38,7 @@ public static List diff(Path goldenFilePath, String codegen) { return diffTwoStringLists(original, revised); } - public static List diff(String expectedStr, String actualStr) { + static List diff(String expectedStr, String actualStr) { List revised = Arrays.asList(actualStr.split(LINE_SPLITTER)); List original = Arrays.asList(expectedStr.split(LINE_SPLITTER)); return diffTwoStringLists(original, revised); @@ -60,7 +60,7 @@ private static class GoldenFileReadException extends RuntimeException { private static final long serialVersionUID = 7423787084310530945L; - public GoldenFileReadException(String errorMessage, Throwable cause) { + GoldenFileReadException(String errorMessage, Throwable cause) { super(errorMessage, cause); } } @@ -69,7 +69,7 @@ private static class ComputeDiffException extends RuntimeException { private static final long serialVersionUID = -7480557222244987342L; - public ComputeDiffException(String errorMessage, Throwable cause) { + ComputeDiffException(String errorMessage, Throwable cause) { super(errorMessage, cause); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java index d5d3fb35fc..cfae012866 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java @@ -18,10 +18,10 @@ import org.junit.runner.Request; import org.junit.runner.Result; -public class SingleJUnitTestRunner { +class SingleJUnitTestRunner { // SingleJUnitTestRunner runs single JUnit test whose class name is passed through `args`. // This is used to prepare codegen for updating goldens files. - public static void main(String... args) { + static void main(String... args) { // Check whether the test class name is passed correctly e.g. // `com.google.api.generator.gapic.composer.ComposerTest` if (args.length < 1) { @@ -41,14 +41,14 @@ public static void main(String... args) { } } - public static class JUnitClassNotFoundException extends RuntimeException { - public JUnitClassNotFoundException(String errorMessage) { + static class JUnitClassNotFoundException extends RuntimeException { + JUnitClassNotFoundException(String errorMessage) { super(errorMessage); } } - public static class MissingRequiredArgException extends RuntimeException { - public MissingRequiredArgException(String errorMessage) { + static class MissingRequiredArgException extends RuntimeException { + MissingRequiredArgException(String errorMessage) { super(errorMessage); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java index 874195d5f3..726c9a1d64 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java @@ -23,11 +23,11 @@ import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TrieTest { +class TrieTest { @Test - public void insertAndSearch_stringTrie() { + void insertAndSearch_stringTrie() { Trie trie = new Trie<>(); Function> wordToCharListFn = w -> Arrays.asList(w.split("(?!^)")); @@ -46,7 +46,7 @@ public void insertAndSearch_stringTrie() { } @Test - public void insertAndSearch_multiStringTrie() { + void insertAndSearch_multiStringTrie() { Trie trie = new Trie<>(); assertFalse(trie.search(Arrays.asList("user", "identity", "name"))); @@ -67,7 +67,7 @@ public void insertAndSearch_multiStringTrie() { } @Test - public void dfsTraverseAndReduce_emptyTrie() { + void dfsTraverseAndReduce_emptyTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. Function parentPreprocFn = nodeVal -> new Integer(0); BiFunction leafReduceFn = @@ -81,7 +81,7 @@ public void dfsTraverseAndReduce_emptyTrie() { } @Test - public void dfsTraverseAndReduce_singleNodeTrie() { + void dfsTraverseAndReduce_singleNodeTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. Function parentPreprocFn = nodeVal -> new Integer(0); BiFunction leafReduceFn = @@ -96,7 +96,7 @@ public void dfsTraverseAndReduce_singleNodeTrie() { } @Test - public void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { + void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { Function toUpperCaseFn = s -> s.substring(0, 1).toUpperCase() + s.substring(1); Function parentPreprocFn = nodeVal -> @@ -137,7 +137,7 @@ public void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { } @Test - public void dfsTraverseAndReduce_oneDeepBranchTrie() { + void dfsTraverseAndReduce_oneDeepBranchTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. int simpleBaseValue = 0; Function simpleParentPreprocFn = nodeVal -> new Integer(0); @@ -195,7 +195,7 @@ public void dfsTraverseAndReduce_oneDeepBranchTrie() { } @Test - public void dfsTraverseAndReduce_depthAndBreathTrie() { + void dfsTraverseAndReduce_depthAndBreathTrie() { Function toUpperCaseFn = s -> s.substring(0, 1).toUpperCase() + s.substring(1); Function parentPreprocFn = nodeVal -> From 38ebcc3b7949f3bab8faaa96ca605e0fe597086d Mon Sep 17 00:00:00 2001 From: Blake Li Date: Fri, 17 May 2024 17:21:13 -0400 Subject: [PATCH 25/29] test: Migrate gax unit tests to Junit 5 (#2724) This PR migrate all unit tests in Gax to Junit 5. Other than standard direct replacements, some tests need to be rewritten due to the following scenarios: - `@Rule` does not exist anymore and there is no direct replacement. We mostly use it to initialize a Mockito stub, replaced with `@ExtendWith(MockitoExtension.class)`. - Some tests were relying on try-catch to assert exceptions, replaced with `assertThrows`. e.g. [OperationsClientTest](https://github.com/googleapis/sdk-platform-java/pull/2724/files#diff-4530df761eff0854357165d951e1667d3810a5448ec2aa4b853a6331516cbde0) - Parameterized tests in [AbstractRetryingExecutorTest](https://github.com/googleapis/sdk-platform-java/pull/2724/files#diff-9c5f5c1d2fcef6c4164fc0171d01e7020aa7ebb7aa49615cf3743dc89c9b3d1d) There are a few environment variable tests can be re-written with Junit 5, so we don't need to configure a [profile](https://github.com/googleapis/sdk-platform-java/blob/main/gax-java/gax/pom.xml#L115-L128) for it anymore, but they are not in the scope of this PR. fixes: #1611. --- gax-java/dependencies.properties | 5 +- gax-java/gax-grpc/BUILD.bazel | 3 +- .../api/gax/grpc/CallOptionsUtilTest.java | 23 +-- .../google/api/gax/grpc/ChannelPoolTest.java | 45 +++-- .../api/gax/grpc/GaxGrpcPropertiesTest.java | 17 +- .../gax/grpc/GrpcApiExceptionFactoryTest.java | 23 ++- .../api/gax/grpc/GrpcCallContextTest.java | 79 +++++---- .../api/gax/grpc/GrpcCallableFactoryTest.java | 27 ++- .../api/gax/grpc/GrpcClientCallsTest.java | 28 ++-- ...GrpcDirectServerStreamingCallableTest.java | 39 ++--- .../grpc/GrpcDirectStreamControllerTest.java | 13 +- .../grpc/GrpcDirectStreamingCallableTest.java | 27 ++- .../gax/grpc/GrpcHeaderInterceptorTest.java | 17 +- .../gax/grpc/GrpcLongRunningClientTest.java | 13 +- .../api/gax/grpc/GrpcLongRunningTest.java | 17 +- .../GrpcMetadataHandlerInterceptorTest.java | 19 +-- .../gax/grpc/GrpcResponseMetadataTest.java | 58 +++---- .../api/gax/grpc/GrpcStatusCodeTest.java | 9 +- .../gax/grpc/GrpcTransportDescriptorTest.java | 25 ++- .../InstantiatingGrpcChannelProviderTest.java | 78 ++++----- .../grpc/ProtoOperationTransformersTest.java | 19 +-- .../com/google/api/gax/grpc/SettingsTest.java | 21 +-- .../com/google/api/gax/grpc/TimeoutTest.java | 35 ++-- .../grpc/testing/MockServiceHelperTest.java | 30 ++-- .../longrunning/OperationsClientTest.java | 158 +++++++++--------- gax-java/gax-httpjson/BUILD.bazel | 3 +- .../httpjson/GaxHttpJsonPropertiesTest.java | 8 +- .../gax/httpjson/HttpHeadersUtilsTest.java | 14 +- .../gax/httpjson/HttpJsonCallContextTest.java | 71 ++++---- .../httpjson/HttpJsonCallableFactoryTest.java | 11 +- .../httpjson/HttpJsonClientCallImplTest.java | 15 +- .../gax/httpjson/HttpJsonClientCallsTest.java | 21 +-- .../HttpJsonClientInterceptorTest.java | 29 ++-- .../httpjson/HttpJsonDirectCallableTest.java | 50 +++--- ...JsonDirectServerStreamingCallableTest.java | 43 +++-- .../HttpJsonLongRunningClientTest.java | 24 +-- ...HttpJsonOperationSnapshotCallableTest.java | 18 +- .../HttpJsonOperationSnapshotTest.java | 16 +- .../gax/httpjson/HttpJsonStatusCodeTest.java | 10 +- .../gax/httpjson/HttpRequestRunnableTest.java | 20 +-- ...tantiatingHttpJsonChannelProviderTest.java | 15 +- .../ProtoMessageJsonStreamIteratorTest.java | 14 +- .../ProtoMessageRequestFormatterTest.java | 26 +-- .../ProtoMessageResponseParserTest.java | 22 +-- .../ProtoOperationTransformersTest.java | 20 +-- .../gax/httpjson/ProtoRestSerializerTest.java | 48 +++--- .../google/api/gax/httpjson/RetryingTest.java | 41 +++-- .../longrunning/OperationsClientTest.java | 66 ++++---- .../stub/HttpJsonOperationsStubTest.java | 8 +- gax-java/gax/BUILD.bazel | 4 +- .../api/gax/batching/AssertByPolling.java | 2 +- .../api/gax/batching/AssertByPollingTest.java | 16 +- .../api/gax/batching/BatcherImplTest.java | 151 +++++++---------- .../api/gax/batching/BatcherStatsTest.java | 15 +- .../batching/BatchingCallSettingsTest.java | 17 +- .../DynamicFlowControlSettingsTest.java | 27 ++- .../batching/FlowControlEventStatsTest.java | 19 +-- .../api/gax/batching/FlowControllerTest.java | 134 +++++++-------- .../api/gax/batching/Semaphore64Test.java | 143 ++++++---------- .../gax/batching/ThresholdBatcherTest.java | 68 ++++---- .../google/api/gax/core/DistributionTest.java | 22 +-- .../api/gax/core/GaxPropertiesTest.java | 33 ++-- .../core/GoogleCredentialsProviderTest.java | 15 +- .../gax/longrunning/OperationFuturesTest.java | 32 ++-- .../OperationTimedPollAlgorithmTest.java | 26 +-- .../com/google/api/gax/paging/PagesTest.java | 6 +- .../AbstractRetryingExecutorTest.java | 140 +++++++++------- .../gax/retrying/BasicRetryingFutureTest.java | 23 ++- .../retrying/DirectRetryingExecutorTest.java | 5 +- .../ExponentialRetryAlgorithmTest.java | 31 ++-- .../api/gax/retrying/FailingCallable.java | 2 +- .../gax/retrying/NoopRetryingContextTest.java | 17 +- .../api/gax/retrying/RetryAlgorithmTest.java | 33 ++-- .../api/gax/retrying/RetrySettingsTest.java | 8 +- .../ScheduledRetryingExecutorTest.java | 41 ++--- .../gax/rpc/ApiClientHeaderProviderTest.java | 25 ++- .../api/gax/rpc/ApiExceptionFactoryTest.java | 41 +++-- .../google/api/gax/rpc/ApiExceptionTest.java | 21 +-- .../google/api/gax/rpc/ApiExceptionsTest.java | 74 ++++---- .../gax/rpc/ApiResultRetryAlgorithmTest.java | 19 +-- .../api/gax/rpc/AttemptCallableTest.java | 20 +-- .../google/api/gax/rpc/AuthCallableTest.java | 15 +- .../google/api/gax/rpc/BatchExecutorTest.java | 17 +- .../com/google/api/gax/rpc/BatchTest.java | 19 +-- .../google/api/gax/rpc/BatchedFutureTest.java | 11 +- .../api/gax/rpc/BatchedRequestIssuerTest.java | 97 ++++++----- .../api/gax/rpc/BatcherFactoryTest.java | 21 +-- .../api/gax/rpc/BatchingCallSettingsTest.java | 17 +- .../api/gax/rpc/BatchingCallableTest.java | 23 ++- .../com/google/api/gax/rpc/BatchingTest.java | 45 ++--- .../gax/rpc/BidiStreamingCallableTest.java | 8 +- .../com/google/api/gax/rpc/CallableTest.java | 24 ++- .../api/gax/rpc/CancellationHelpers.java | 19 +-- .../google/api/gax/rpc/CancellationTest.java | 31 ++-- .../gax/rpc/CheckingAttemptCallableTest.java | 18 +- .../google/api/gax/rpc/ClientContextTest.java | 81 +++++---- .../api/gax/rpc/ClientSettingsTest.java | 41 ++--- .../api/gax/rpc/EndpointContextTest.java | 73 ++++---- .../google/api/gax/rpc/ErrorDetailsTest.java | 43 +++-- .../api/gax/rpc/FirstElementCallableTest.java | 21 +-- .../api/gax/rpc/FixedHeaderProviderTest.java | 33 ++-- .../FixedTransportChannelProviderTest.java | 9 +- .../gax/rpc/FixedWatchdogProviderTest.java | 13 +- .../InstantiatingWatchdogProviderTest.java | 18 +- .../gax/rpc/OperationCallSettingsTest.java | 13 +- .../gax/rpc/OperationCallableImplTest.java | 77 ++++----- .../api/gax/rpc/PagedCallSettingsTest.java | 13 +- .../google/api/gax/rpc/PagedCallableTest.java | 11 +- .../com/google/api/gax/rpc/PagingTest.java | 65 +++---- .../api/gax/rpc/RequestParamsBuilderTest.java | 41 +++-- .../gax/rpc/RequestUrlParamsEncoderTest.java | 16 +- .../api/gax/rpc/RetryingCallableTest.java | 6 +- .../com/google/api/gax/rpc/RetryingTest.java | 134 ++++++--------- .../google/api/gax/rpc/ServerStreamTest.java | 91 ++++------ .../ServerStreamingAttemptCallableTest.java | 31 ++-- .../rpc/ServerStreamingCallSettingsTest.java | 21 +-- .../gax/rpc/ServerStreamingCallableTest.java | 37 ++-- .../api/gax/rpc/SpoolingCallableTest.java | 23 ++- .../api/gax/rpc/StreamingCallableTest.java | 21 +-- .../gax/rpc/StreamingRetryAlgorithmTest.java | 21 +-- .../gax/rpc/TranslatingUnaryCallableTest.java | 9 +- .../api/gax/rpc/UnaryCallSettingsTest.java | 23 ++- .../google/api/gax/rpc/UnaryCallableTest.java | 21 +-- .../com/google/api/gax/rpc/WatchdogTest.java | 35 ++-- .../internal/ApiCallContextOptionsTest.java | 15 +- .../api/gax/rpc/internal/HeadersTest.java | 11 +- .../QuotaProjectIdHidingCredentialsTest.java | 31 ++-- .../AbstractMtlsTransportChannelTest.java | 29 ++-- .../api/gax/rpc/mtls/MtlsProviderTest.java | 78 +++++---- .../gax/tracing/MetricsTracerFactoryTest.java | 14 +- .../api/gax/tracing/MetricsTracerTest.java | 51 +++--- .../OpenTelemetryMetricsRecorderTest.java | 37 ++-- .../tracing/OpencensusTracerFactoryTest.java | 30 ++-- .../api/gax/tracing/OpencensusTracerTest.java | 46 +++-- .../api/gax/tracing/TraceFinisherTest.java | 21 +-- .../tracing/TracedBatchingCallableTest.java | 30 ++-- .../gax/tracing/TracedBidiCallableTest.java | 39 ++--- .../api/gax/tracing/TracedCallableTest.java | 25 +-- .../TracedClientStreamingCallableTest.java | 36 ++-- .../tracing/TracedOperationCallableTest.java | 35 ++-- .../TracedServerStreamingCallableTest.java | 35 ++-- .../gax/tracing/TracedUnaryCallableTest.java | 33 ++-- gax-java/pom.xml | 33 ++-- 143 files changed, 2143 insertions(+), 2563 deletions(-) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index a41774c6a9..5173381139 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -79,9 +79,12 @@ maven.org_graalvm_sdk=org.graalvm.sdk:graal-sdk:22.3.5 # Testing maven artifacts maven.junit_junit=junit:junit:4.13.2 -maven.org_mockito_mockito_core=org.mockito:mockito-core:2.28.2 +maven.org_mockito_mockito_core=org.mockito:mockito-core:4.11.0 +maven.org_mockito_mockito_junit_jupiter=org.mockito:mockito-junit-jupiter:4.11.0 maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3 maven.com_google_truth_truth=com.google.truth:truth:1.4.2 maven.com_googlecode_java_diff_utils_diffutils=com.googlecode.java-diff-utils:diffutils:1.3.0 maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.14.15 maven.org_objenesis_objenesis=org.objenesis:objenesis:2.6 +maven.org_junit_jupiter_junit_jupiter_api=org.junit.jupiter:junit-jupiter-api:5.10.2 +maven.org_junit_jupiter_junit_jupiter_params=org.junit.jupiter:junit-jupiter-params:5.10.2 diff --git a/gax-java/gax-grpc/BUILD.bazel b/gax-java/gax-grpc/BUILD.bazel index f1dfe02fc6..be224ff3f8 100644 --- a/gax-java/gax-grpc/BUILD.bazel +++ b/gax-java/gax-grpc/BUILD.bazel @@ -35,8 +35,9 @@ _COMPILE_DEPS = [ ] _TEST_COMPILE_DEPS = [ - "@junit_junit//jar", + "@org_junit_jupiter_junit_jupiter_api//jar", "@org_mockito_mockito_core//jar", + "@org_mockito_mockito_junit_jupiter//jar", "@com_google_truth_truth//jar", "@io_grpc_grpc_java//core:inprocess", "@com_google_api_grpc_grpc_google_common_protos//jar", diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java index 26a6b925f8..e9bba5d63d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java @@ -29,19 +29,20 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableMap; import io.grpc.CallOptions; import io.grpc.Metadata.Key; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CallOptionsUtilTest { +class CallOptionsUtilTest { @Test - public void testPutAndGetDynamicHeaderOption() { + void testPutAndGetDynamicHeaderOption() { String encodedRequestParams = "param1=value¶m2.param3=value23"; CallOptions options = CallOptionsUtil.putRequestParamsDynamicHeaderOption( @@ -54,7 +55,7 @@ public void testPutAndGetDynamicHeaderOption() { } @Test - public void testPutAndGetDynamicHeaderOptionEmpty() { + void testPutAndGetDynamicHeaderOptionEmpty() { CallOptions options = CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, ""); assertSame(CallOptions.DEFAULT, options); @@ -62,8 +63,10 @@ public void testPutAndGetDynamicHeaderOptionEmpty() { assertTrue(headers.isEmpty()); } - @Test(expected = NullPointerException.class) - public void testPutAndGetHeaderOptionNull() { - CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, null); + @Test + void testPutAndGetHeaderOptionNull() { + assertThrows( + NullPointerException.class, + () -> CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, null)); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java index ebc941ec0a..b9d6ae6c6d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java @@ -69,29 +69,26 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.mockito.stubbing.Answer; -@RunWith(JUnit4.class) -public class ChannelPoolTest { +class ChannelPoolTest { private static final int DEFAULT_AWAIT_TERMINATION_SEC = 10; private ChannelPool pool; - @After - public void cleanup() throws InterruptedException { + @AfterEach + void cleanup() throws InterruptedException { Preconditions.checkNotNull(pool, "Channel pool was never created"); pool.shutdown(); pool.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); } @Test - public void testAuthority() throws IOException { + void testAuthority() throws IOException { ManagedChannel sub1 = Mockito.mock(ManagedChannel.class); ManagedChannel sub2 = Mockito.mock(ManagedChannel.class); @@ -105,7 +102,7 @@ public void testAuthority() throws IOException { } @Test - public void testRoundRobin() throws IOException { + void testRoundRobin() throws IOException { ManagedChannel sub1 = Mockito.mock(ManagedChannel.class); ManagedChannel sub2 = Mockito.mock(ManagedChannel.class); @@ -144,7 +141,7 @@ private void verifyTargetChannel( } @Test - public void ensureEvenDistribution() throws InterruptedException, IOException { + void ensureEvenDistribution() throws InterruptedException, IOException { int numChannels = 10; final ManagedChannel[] channels = new ManagedChannel[numChannels]; final AtomicInteger[] counts = new AtomicInteger[numChannels]; @@ -197,7 +194,7 @@ public void ensureEvenDistribution() throws InterruptedException, IOException { // Test channelPrimer is called same number of times as poolSize if executorService is set to null @Test - public void channelPrimerShouldCallPoolConstruction() throws IOException { + void channelPrimerShouldCallPoolConstruction() throws IOException { ChannelPrimer mockChannelPrimer = Mockito.mock(ChannelPrimer.class); ManagedChannel channel1 = Mockito.mock(ManagedChannel.class); ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); @@ -215,7 +212,7 @@ public void channelPrimerShouldCallPoolConstruction() throws IOException { // Test channelPrimer is called periodically, if there's an executorService @Test - public void channelPrimerIsCalledPeriodically() throws IOException { + void channelPrimerIsCalledPeriodically() throws IOException { ChannelPrimer mockChannelPrimer = Mockito.mock(ChannelPrimer.class); ManagedChannel channel1 = Mockito.mock(ManagedChannel.class); ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); @@ -266,7 +263,7 @@ public void channelPrimerIsCalledPeriodically() throws IOException { // ---- // call should be allowed to complete and the channel should not be shutdown @Test - public void callShouldCompleteAfterCreation() throws IOException { + void callShouldCompleteAfterCreation() throws IOException { ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); FakeChannelFactory channelFactory = @@ -314,7 +311,7 @@ public void callShouldCompleteAfterCreation() throws IOException { // call should be allowed to complete and the channel should not be shutdown @Test - public void callShouldCompleteAfterStarted() throws IOException { + void callShouldCompleteAfterStarted() throws IOException { final ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); @@ -359,7 +356,7 @@ public void callShouldCompleteAfterStarted() throws IOException { // Channel should be shutdown after a refresh all the calls have completed @Test - public void channelShouldShutdown() throws IOException { + void channelShouldShutdown() throws IOException { ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); @@ -402,7 +399,7 @@ public void channelShouldShutdown() throws IOException { } @Test - public void channelRefreshShouldSwapChannels() throws IOException { + void channelRefreshShouldSwapChannels() throws IOException { ManagedChannel underlyingChannel1 = Mockito.mock(ManagedChannel.class); ManagedChannel underlyingChannel2 = Mockito.mock(ManagedChannel.class); @@ -442,7 +439,7 @@ public void channelRefreshShouldSwapChannels() throws IOException { } @Test - public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() throws Exception { + void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); List channels = new ArrayList<>(); @@ -521,7 +518,7 @@ public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() thro } @Test - public void removedIdleChannelsAreShutdown() throws Exception { + void removedIdleChannelsAreShutdown() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); List channels = new ArrayList<>(); @@ -561,7 +558,7 @@ public void removedIdleChannelsAreShutdown() throws Exception { } @Test - public void removedActiveChannelsAreShutdown() throws Exception { + void removedActiveChannelsAreShutdown() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); List channels = new ArrayList<>(); @@ -622,7 +619,7 @@ public void removedActiveChannelsAreShutdown() throws Exception { } @Test - public void testReleasingClientCallCancelEarly() throws IOException { + void testReleasingClientCallCancelEarly() throws IOException { ClientCall mockClientCall = Mockito.mock(ClientCall.class); Mockito.doAnswer(invocation -> null).when(mockClientCall).cancel(Mockito.any(), Mockito.any()); ManagedChannel fakeChannel = Mockito.mock(ManagedChannel.class); @@ -650,7 +647,7 @@ public void testReleasingClientCallCancelEarly() throws IOException { Color request = Color.newBuilder().setRed(0.5f).build(); IllegalStateException e = - Assert.assertThrows( + Assertions.assertThrows( IllegalStateException.class, () -> streamingCallable.call( @@ -675,7 +672,7 @@ public void onComplete() {} } @Test - public void testDoubleRelease() throws Exception { + void testDoubleRelease() throws Exception { FakeLogHandler logHandler = new FakeLogHandler(); ChannelPool.LOG.addHandler(logHandler); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java index 4174312272..651b17e712 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java @@ -29,31 +29,28 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.regex.Pattern; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GaxGrpcPropertiesTest { +class GaxGrpcPropertiesTest { @Test - public void testGrpcVersion() { + void testGrpcVersion() { String grpcVersion = GaxGrpcProperties.getGrpcVersion(); assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(grpcVersion).find()); } @Test - public void testGaxGrpcVersion() { + void testGaxGrpcVersion() { String gaxGrpcVersion = GaxGrpcProperties.getGaxGrpcVersion(); assertNotNull(gaxGrpcVersion); } @Test - public void testDefaultHeaderPattern() { + void testDefaultHeaderPattern() { assertTrue( GaxGrpcProperties.getDefaultApiClientHeaderPattern() .matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 grpc/1.7.0") diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java index bb8febef54..e4e86d589d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java @@ -44,13 +44,10 @@ import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcApiExceptionFactoryTest { +class GrpcApiExceptionFactoryTest { private static final ErrorInfo ERROR_INFO = ErrorInfo.newBuilder() @@ -72,13 +69,13 @@ public class GrpcApiExceptionFactoryTest { private GrpcApiExceptionFactory factory; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { factory = new GrpcApiExceptionFactory(Collections.emptySet()); } @Test - public void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() { + void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addAllDetails(RAW_ERROR_MESSAGES).build(); trailers.put( @@ -91,7 +88,7 @@ public void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() } @Test - public void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeException() { + void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeException() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addAllDetails(RAW_ERROR_MESSAGES).build(); trailers.put( @@ -104,7 +101,7 @@ public void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeExcep } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() { StatusRuntimeException statusException = new StatusRuntimeException(GRPC_STATUS, null); ApiException actual = factory.create(statusException); @@ -113,7 +110,7 @@ public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHaveErrorDetails() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHaveErrorDetails() { StatusRuntimeException statusException = new StatusRuntimeException(GRPC_STATUS, new Metadata()); @@ -123,7 +120,7 @@ public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHa } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfStatusIsMalformed() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfStatusIsMalformed() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addDetails(Any.pack(ERROR_INFO)).build(); byte[] bytes = status.toByteArray(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java index e67c4c13c2..02d922c635 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java @@ -29,9 +29,9 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; @@ -53,21 +53,18 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcCallContextTest { +class GrpcCallContextTest { @Test - public void testNullToSelfWrongType() { + void testNullToSelfWrongType() { try { GrpcCallContext.createDefault().nullToSelf(FakeCallContext.createDefault()); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -76,7 +73,7 @@ public void testNullToSelfWrongType() { } @Test - public void testWithCredentials() { + void testWithCredentials() { Credentials credentials = Mockito.mock(Credentials.class); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getCallOptions().getCredentials()); @@ -85,7 +82,7 @@ public void testWithCredentials() { } @Test - public void testWithTransportChannel() { + void testWithTransportChannel() { ManagedChannel channel = Mockito.mock(ManagedChannel.class); GrpcCallContext context = GrpcCallContext.createDefault().withTransportChannel(GrpcTransportChannel.create(channel)); @@ -93,21 +90,21 @@ public void testWithTransportChannel() { } @Test - public void testWithTransportChannelWrongType() { + void testWithTransportChannelWrongType() { FakeChannel channel = new FakeChannel(); try { GrpcCallContext.createDefault().withTransportChannel(FakeTransportChannel.create(channel)); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected).hasMessageThat().contains("Expected GrpcTransportChannel"); } } @Test - public void testMergeWrongType() { + void testMergeWrongType() { try { GrpcCallContext.createDefault().merge(FakeCallContext.createDefault()); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -116,7 +113,7 @@ public void testMergeWrongType() { } @Test - public void testWithRequestParamsDynamicHeaderOption() { + void testWithRequestParamsDynamicHeaderOption() { String encodedRequestParams = "param1=value¶m2.param3=value23"; GrpcCallContext context = GrpcCallContext.createDefault().withRequestParamsDynamicHeaderOption(encodedRequestParams); @@ -129,22 +126,22 @@ public void testWithRequestParamsDynamicHeaderOption() { } @Test - public void testWithTimeout() { + void testWithTimeout() { assertNull(GrpcCallContext.createDefault().withTimeout(null).getTimeout()); } @Test - public void testWithNegativeTimeout() { + void testWithNegativeTimeout() { assertNull(GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(-1L)).getTimeout()); } @Test - public void testWithZeroTimeout() { + void testWithZeroTimeout() { assertNull(GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(0L)).getTimeout()); } @Test - public void testWithShorterTimeout() { + void testWithShorterTimeout() { GrpcCallContext ctxWithLongTimeout = GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)); @@ -157,7 +154,7 @@ public void testWithShorterTimeout() { } @Test - public void testWithLongerTimeout() { + void testWithLongerTimeout() { GrpcCallContext ctxWithShortTimeout = GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(5)); @@ -171,7 +168,7 @@ public void testWithLongerTimeout() { } @Test - public void testMergeWithNullTimeout() { + void testMergeWithNullTimeout() { Duration timeout = Duration.ofSeconds(10); GrpcCallContext baseContext = GrpcCallContext.createDefault().withTimeout(timeout); @@ -183,7 +180,7 @@ public void testMergeWithNullTimeout() { } @Test - public void testMergeWithTimeout() { + void testMergeWithTimeout() { Duration timeout = Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); GrpcCallContext ctx2 = GrpcCallContext.createDefault().withTimeout(timeout); @@ -192,14 +189,14 @@ public void testMergeWithTimeout() { } @Test - public void testWithStreamingWaitTimeout() { + void testWithStreamingWaitTimeout() { Duration timeout = Duration.ofSeconds(15); GrpcCallContext context = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); Truth.assertThat(context.getStreamWaitTimeout()).isEqualTo(timeout); } @Test - public void testMergeWithNullStreamingWaitTimeout() { + void testMergeWithNullStreamingWaitTimeout() { Duration timeout = Duration.ofSeconds(10); GrpcCallContext baseContext = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); @@ -213,7 +210,7 @@ public void testMergeWithNullStreamingWaitTimeout() { } @Test - public void testWithZeroStreamingWaitTimeout() { + void testWithZeroStreamingWaitTimeout() { Duration timeout = Duration.ZERO; Truth.assertThat( GrpcCallContext.createDefault().withStreamWaitTimeout(timeout).getStreamWaitTimeout()) @@ -221,7 +218,7 @@ public void testWithZeroStreamingWaitTimeout() { } @Test - public void testMergeWithStreamingWaitTimeout() { + void testMergeWithStreamingWaitTimeout() { Duration timeout = Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); @@ -230,14 +227,14 @@ public void testMergeWithStreamingWaitTimeout() { } @Test - public void testWithStreamingIdleTimeout() { + void testWithStreamingIdleTimeout() { Duration timeout = Duration.ofSeconds(15); GrpcCallContext context = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); Truth.assertThat(context.getStreamIdleTimeout()).isEqualTo(timeout); } @Test - public void testMergeWithNullStreamingIdleTimeout() { + void testMergeWithNullStreamingIdleTimeout() { Duration timeout = Duration.ofSeconds(10); GrpcCallContext baseContext = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); @@ -251,7 +248,7 @@ public void testMergeWithNullStreamingIdleTimeout() { } @Test - public void testWithZeroStreamingIdleTimeout() { + void testWithZeroStreamingIdleTimeout() { Duration timeout = Duration.ZERO; Truth.assertThat( GrpcCallContext.createDefault().withStreamIdleTimeout(timeout).getStreamIdleTimeout()) @@ -259,7 +256,7 @@ public void testWithZeroStreamingIdleTimeout() { } @Test - public void testMergeWithStreamingIdleTimeout() { + void testMergeWithStreamingIdleTimeout() { Duration timeout = Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); @@ -268,7 +265,7 @@ public void testMergeWithStreamingIdleTimeout() { } @Test - public void testMergeWithCustomCallOptions() { + void testMergeWithCustomCallOptions() { CallOptions.Key key = CallOptions.Key.createWithDefault("somekey", "somedefault"); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); GrpcCallContext ctx2 = @@ -283,7 +280,7 @@ public void testMergeWithCustomCallOptions() { } @Test - public void testWithExtraHeaders() { + void testWithExtraHeaders() { Map> extraHeaders = createTestExtraHeaders("key1", "value1", "key1", "value2"); GrpcCallContext ctx = GrpcCallContext.createDefault().withExtraHeaders(extraHeaders); @@ -298,7 +295,7 @@ public void testWithExtraHeaders() { } @Test - public void testMergeWithExtraHeaders() { + void testMergeWithExtraHeaders() { Map> extraHeaders1 = createTestExtraHeaders("key1", "value1", "key1", "value2"); GrpcCallContext ctx1 = GrpcCallContext.createDefault().withExtraHeaders(extraHeaders1); @@ -316,7 +313,7 @@ public void testMergeWithExtraHeaders() { } @Test - public void testMergeWithTracer() { + void testMergeWithTracer() { ApiTracer explicitTracer = Mockito.mock(ApiTracer.class); GrpcCallContext ctxWithExplicitTracer = GrpcCallContext.createDefault().withTracer(explicitTracer); @@ -338,7 +335,7 @@ public void testMergeWithTracer() { } @Test - public void testWithRetrySettings() { + void testWithRetrySettings() { RetrySettings retrySettings = Mockito.mock(RetrySettings.class); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getRetrySettings()); @@ -347,7 +344,7 @@ public void testWithRetrySettings() { } @Test - public void testWithRetryableCodes() { + void testWithRetryableCodes() { Set codes = Collections.singleton(StatusCode.Code.UNAVAILABLE); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getRetryableCodes()); @@ -356,7 +353,7 @@ public void testWithRetryableCodes() { } @Test - public void testWithOptions() { + void testWithOptions() { GrpcCallContext emptyCallContext = GrpcCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); @@ -374,7 +371,7 @@ public void testWithOptions() { } @Test - public void testMergeOptions() throws IOException { + void testMergeOptions() throws IOException { GrpcCallContext emptyCallContext = GrpcCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java index a274512e14..a24e777774 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java @@ -55,22 +55,19 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.inprocess.InProcessChannelBuilder; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcCallableFactoryTest { +class GrpcCallableFactoryTest { private InProcessServer inprocessServer; private ManagedChannel channel; private ClientContext clientContext; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { String serverName = "fakeservice"; FakeServiceImpl serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); @@ -90,14 +87,14 @@ public void setUp() throws Exception { .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void createServerStreamingCallableRetryableExceptions() { + void createServerStreamingCallableRetryableExceptions() { GrpcCallSettings grpcCallSettings = GrpcCallSettings.create(FakeServiceGrpc.METHOD_STREAMING_RECOGNIZE_ERROR); @@ -151,7 +148,7 @@ public void createServerStreamingCallableRetryableExceptions() { } @Test - public void testGetSpanName() { + void testGetSpanName() { @SuppressWarnings("unchecked") MethodDescriptor descriptor = MethodDescriptor.newBuilder() @@ -166,7 +163,7 @@ public void testGetSpanName() { } @Test - public void testGetSpanNameUnqualified() { + void testGetSpanNameUnqualified() { @SuppressWarnings("unchecked") MethodDescriptor descriptor = MethodDescriptor.newBuilder() @@ -181,7 +178,7 @@ public void testGetSpanNameUnqualified() { } @Test - public void testGetSpanNameInvalid() { + void testGetSpanNameInvalid() { List invalidNames = ImmutableList.of("BareMethod", "/MethodWithoutService"); for (String invalidName : invalidNames) { diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java index eb9277b2e1..a22b5fa747 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java @@ -30,7 +30,7 @@ package com.google.api.gax.grpc; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.verify; import com.google.api.gax.grpc.testing.FakeChannelFactory; @@ -58,13 +58,13 @@ import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.threeten.bp.Duration; -public class GrpcClientCallsTest { +class GrpcClientCallsTest { // Auth Library's GoogleAuthException is package-private. Copy basic functionality for tests private static class GoogleAuthException extends IOException implements Retryable { @@ -91,8 +91,8 @@ public int getRetryCount() { private Credentials credentials; private Channel mockChannel; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { credentials = Mockito.mock(Credentials.class); endpointContext = Mockito.mock(EndpointContext.class); mockChannel = Mockito.mock(Channel.class); @@ -104,7 +104,7 @@ public void setUp() throws IOException { } @Test - public void testAffinity() throws IOException { + void testAffinity() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -138,7 +138,7 @@ public void testAffinity() throws IOException { } @Test - public void testExtraHeaders() throws IOException { + void testExtraHeaders() throws IOException { Metadata emptyHeaders = new Metadata(); final Map> extraHeaders = new HashMap<>(); extraHeaders.put( @@ -179,7 +179,7 @@ public void testExtraHeaders() throws IOException { } @Test - public void testTimeoutToDeadlineConversion() throws IOException { + void testTimeoutToDeadlineConversion() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -209,7 +209,7 @@ public void testTimeoutToDeadlineConversion() throws IOException { } @Test - public void testTimeoutAfterDeadline() throws IOException { + void testTimeoutAfterDeadline() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public void testTimeoutAfterDeadline() throws IOException { } @Test - public void testTimeoutBeforeDeadline() throws IOException { + void testTimeoutBeforeDeadline() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -279,7 +279,7 @@ public void testTimeoutBeforeDeadline() throws IOException { } @Test - public void testValidUniverseDomain() throws IOException { + void testValidUniverseDomain() throws IOException { GrpcCallContext context = GrpcCallContext.createDefault() .withChannel(mockChannel) @@ -295,7 +295,7 @@ public void testValidUniverseDomain() throws IOException { // This test is when the universe domain does not match @Test - public void testInvalidUniverseDomain() throws IOException { + void testInvalidUniverseDomain() throws IOException { Mockito.doThrow( new UnauthenticatedException( null, GrpcStatusCode.of(Status.Code.UNAUTHENTICATED), false)) @@ -319,7 +319,7 @@ public void testInvalidUniverseDomain() throws IOException { // This test is when the MDS is unable to return a valid universe domain @Test - public void testUniverseDomainNotReady_shouldRetry() throws IOException { + void testUniverseDomainNotReady_shouldRetry() throws IOException { Mockito.doThrow(new GoogleAuthException(true)) .when(endpointContext) .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java index 5935d1d786..843ae84331 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java @@ -59,16 +59,13 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class GrpcDirectServerStreamingCallableTest { +class GrpcDirectServerStreamingCallableTest { private static final Color DEFAULT_REQUEST = Color.newBuilder().setRed(0.5f).build(); private static final Color ASYNC_REQUEST = DEFAULT_REQUEST.toBuilder().setGreen(1000).build(); private static final Color ERROR_REQUEST = Color.newBuilder().setRed(-1).build(); @@ -81,8 +78,8 @@ public class GrpcDirectServerStreamingCallableTest { private ServerStreamingCallSettings streamingCallSettings; private ServerStreamingCallable streamingCallable; - @Before - public void setUp() throws InstantiationException, IllegalAccessException, IOException { + @BeforeEach + void setUp() throws InstantiationException, IllegalAccessException, IOException { String serverName = "fakeservice"; FakeServiceImpl serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); @@ -109,14 +106,14 @@ public void setUp() throws InstantiationException, IllegalAccessException, IOExc clientContext); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testBadContext() { + void testBadContext() { streamingCallable = GrpcCallableFactory.createServerStreamingCallable( GrpcCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), @@ -130,7 +127,7 @@ public void testBadContext() { MoneyObserver observer = new MoneyObserver(true, latch); try { streamingCallable.call(DEFAULT_REQUEST, observer); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -139,7 +136,7 @@ public void testBadContext() { } @Test - public void testServerStreamingStart() { + void testServerStreamingStart() { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -149,7 +146,7 @@ public void testServerStreamingStart() { } @Test - public void testServerStreaming() throws Exception { + void testServerStreaming() throws Exception { CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -161,7 +158,7 @@ public void testServerStreaming() throws Exception { } @Test - public void testManualFlowControl() throws Exception { + void testManualFlowControl() throws Exception { CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -180,7 +177,7 @@ public void testManualFlowControl() throws Exception { } @Test - public void testCancelClientCall() throws Exception { + void testCancelClientCall() throws Exception { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -195,7 +192,7 @@ public void testCancelClientCall() throws Exception { } @Test - public void testOnResponseError() throws Throwable { + void testOnResponseError() throws Throwable { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -211,7 +208,7 @@ public void testOnResponseError() throws Throwable { } @Test - public void testObserverErrorCancelsCall() throws Throwable { + void testObserverErrorCancelsCall() throws Throwable { final RuntimeException expectedCause = new RuntimeException("some error"); final SettableApiFuture actualErrorF = SettableApiFuture.create(); @@ -250,7 +247,7 @@ protected void onCompleteImpl() { } @Test - public void testBlockingServerStreaming() { + void testBlockingServerStreaming() { Color request = Color.newBuilder().setRed(0.5f).build(); ServerStream response = streamingCallable.call(request); List responseData = Lists.newArrayList(response); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java index 96d7cf1063..64d908de28 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java @@ -54,17 +54,16 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcDirectStreamControllerTest { +class GrpcDirectStreamControllerTest { private static final int DEFAULT_AWAIT_TERMINATION_SEC = 10; - @Test(timeout = 180_000) // ms - public void testRetryNoRaceCondition() throws Exception { + @Test + @Timeout(180) + void testRetryNoRaceCondition() throws Exception { Server server = ServerBuilder.forPort(1234).addService(new FakeService()).build().start(); ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 1234).usePlaintext().build(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java index 0d39f8704d..ec040efdf7 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java @@ -55,22 +55,19 @@ import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class GrpcDirectStreamingCallableTest { +class GrpcDirectStreamingCallableTest { private InProcessServer inprocessServer; private ManagedChannel channel; private FakeServiceImpl serviceImpl; private ClientContext clientContext; - @Before - public void setUp() throws InstantiationException, IllegalAccessException, IOException { + @BeforeEach + void setUp() throws InstantiationException, IllegalAccessException, IOException { String serverName = "fakeservice"; serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); @@ -89,14 +86,14 @@ public void setUp() throws InstantiationException, IllegalAccessException, IOExc .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testBidiStreaming() throws Exception { + void testBidiStreaming() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE), null, clientContext); @@ -118,7 +115,7 @@ public void testBidiStreaming() throws Exception { } @Test - public void testBidiStreamingServerError() throws Exception { + void testBidiStreamingServerError() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE_ERROR), null, clientContext); @@ -141,7 +138,7 @@ public void testBidiStreamingServerError() throws Exception { } @Test - public void testBidiStreamingClientError() throws Exception { + void testBidiStreamingClientError() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE_ERROR), null, clientContext); @@ -168,7 +165,7 @@ public void testBidiStreamingClientError() throws Exception { } @Test - public void testClientStreaming() throws Exception { + void testClientStreaming() throws Exception { ClientStreamingCallable streamingCallable = GrpcCallableFactory.createClientStreamingCallable( GrpcCallSettings.create(METHOD_CLIENT_STREAMING_RECOGNIZE), null, clientContext); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java index cf49ddbcb6..0f2fcab003 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.same; import static org.mockito.Mockito.mock; @@ -45,18 +45,15 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import java.util.Map; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; /** Tests for {@link GrpcHeaderInterceptor}. */ -@RunWith(JUnit4.class) -public class GrpcHeaderInterceptorTest { +class GrpcHeaderInterceptorTest { @Mock private Channel channel; @@ -65,15 +62,15 @@ public class GrpcHeaderInterceptorTest { private static final MethodDescriptor method = FakeMethodDescriptor.create(); /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(channel.newCall(Mockito.>any(), any(CallOptions.class))) .thenReturn(call); } @Test - public void testInterceptor() { + void testInterceptor() { Map data = ImmutableMap.of("x-goog-api-client", "abcd", "user-agent", "defg"); GrpcHeaderInterceptor interceptor = new GrpcHeaderInterceptor(data); Channel intercepted = ClientInterceptors.intercept(channel, interceptor); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java index dc38795054..27af7de75c 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java @@ -44,15 +44,12 @@ import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcLongRunningClientTest { +class GrpcLongRunningClientTest { @Test - public void get() { + void get() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.getOperationCallable()) .thenReturn( @@ -75,7 +72,7 @@ public ApiFuture futureCall( } @Test - public void cancel() { + void cancel() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.cancelOperationCallable()) .thenReturn( @@ -96,7 +93,7 @@ public ApiFuture futureCall( } @Test - public void delete() { + void delete() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.deleteOperationCallable()) .thenReturn( diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java index 20bceeae2c..ad45b53a21 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java @@ -66,15 +66,12 @@ import io.grpc.Status.Code; import java.io.IOException; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcLongRunningTest { +class GrpcLongRunningTest { private static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() @@ -98,8 +95,8 @@ public class GrpcLongRunningTest { private FakeApiClock clock; private OperationTimedPollAlgorithm pollingAlgorithm; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { channel = mock(ManagedChannel.class); TransportChannelProvider operationsChannelProvider = mock(TransportChannelProvider.class); TransportChannel transportChannel = @@ -154,7 +151,7 @@ public void setUp() throws IOException { } @Test - public void testCall() throws IOException { + void testCall() throws IOException { Color resp = getColor(1.0f); Money meta = getMoney("UAH"); Operation resultOperation = getOperation("testCall", resp, meta, true); @@ -176,7 +173,7 @@ public void testCall() throws IOException { } @Test - public void testFutureCallPollDoneOnFirst() throws Exception { + void testFutureCallPollDoneOnFirst() throws Exception { String opName = "testFutureCallPollDoneOnFirst"; Color resp = getColor(0.5f); Money meta = getMoney("UAH"); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java index f8306fddfa..bfcfaad960 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java @@ -29,8 +29,8 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -44,18 +44,15 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; /** Tests for {@link GrpcHeaderInterceptor}. */ -@RunWith(JUnit4.class) -public class GrpcMetadataHandlerInterceptorTest { +class GrpcMetadataHandlerInterceptorTest { private static class MutableBoolean { private volatile boolean value = false; @@ -67,15 +64,15 @@ private static class MutableBoolean { private static final MethodDescriptor method = FakeMethodDescriptor.create(); /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(channel.newCall(Mockito.>any(), any(CallOptions.class))) .thenReturn(call); } @Test - public void testInterceptor() { + void testInterceptor() { final MutableBoolean metadataHandlerCalled = new MutableBoolean(); final MutableBoolean trailingMetadataHandlerCalled = new MutableBoolean(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java index fba3f3f61e..bc294ef50e 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java @@ -51,18 +51,14 @@ import io.grpc.Status; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.stub.StreamObserver; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -@RunWith(JUnit4.class) -public class GrpcResponseMetadataTest { +class GrpcResponseMetadataTest { private static final String HEADER_KEY = "inprocessheaderkey"; private static final String HEADER_VALUE = "inprocessheadervalue"; @@ -75,25 +71,23 @@ public class GrpcResponseMetadataTest { private Metadata requestHeaders = null; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { String serverName = "fakeservice"; FakeServiceImplBase serviceImpl = Mockito.mock(FakeServiceImplBase.class); Mockito.doAnswer( - new Answer() { - @Override - public Void answer(InvocationOnMock invocation) { - Color color = invocation.getArgument(0); - StreamObserver observer = invocation.getArgument(1); - observer.onNext( - Money.newBuilder() - .setCurrencyCode("USD") - .setUnits((long) (color.getRed() * 255)) - .build()); - observer.onCompleted(); - return null; - } - }) + (Answer) + invocation -> { + Color color = invocation.getArgument(0); + StreamObserver observer = invocation.getArgument(1); + observer.onNext( + Money.newBuilder() + .setCurrencyCode("USD") + .setUnits((long) (color.getRed() * 255)) + .build()); + observer.onCompleted(); + return null; + }) .when(serviceImpl) .recognize(Mockito.any(), Mockito.>any()); requestHeaders = null; @@ -150,14 +144,14 @@ public void close(Status status, Metadata trailers) { .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testResponseMetadataUnaryCall() { + void testResponseMetadataUnaryCall() { GrpcCallSettings grpcCallSettings = GrpcCallSettings.create(FakeServiceGrpc.METHOD_RECOGNIZE); @@ -167,19 +161,19 @@ public void testResponseMetadataUnaryCall() { UnaryCallable callable = GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - Assert.assertNull(requestHeaders); + Assertions.assertNull(requestHeaders); GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); callable.call(Color.getDefaultInstance(), responseMetadata.createContextWithHandlers()); - Assert.assertNotNull(requestHeaders); + Assertions.assertNotNull(requestHeaders); Metadata metadata = responseMetadata.getMetadata(); Metadata trailingMetadata = responseMetadata.getTrailingMetadata(); - Assert.assertEquals( + Assertions.assertEquals( metadata.get(Key.of(HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER)), HEADER_VALUE); - Assert.assertEquals( + Assertions.assertEquals( trailingMetadata.get(Key.of(TRAILER_KEY, Metadata.ASCII_STRING_MARSHALLER)), TRAILER_VALUE); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java index f078a4a927..d93b9730c4 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java @@ -32,14 +32,11 @@ import com.google.api.gax.rpc.StatusCode; import com.google.common.truth.Truth; import io.grpc.Status; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcStatusCodeTest { +class GrpcStatusCodeTest { @Test - public void testGrpcCodeToStatusCode() { + void testGrpcCodeToStatusCode() { testCodes(StatusCode.Code.OK, Status.Code.OK); testCodes(StatusCode.Code.CANCELLED, Status.Code.CANCELLED); testCodes(StatusCode.Code.UNKNOWN, Status.Code.UNKNOWN); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java index 456d4e73b9..51a2cd0eaf 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; @@ -48,17 +48,14 @@ import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import java.util.Collections; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcTransportDescriptorTest { +class GrpcTransportDescriptorTest { private static boolean NOT_RETRYABLE = false; private static boolean IS_RETRYABLE = true; @Test - public void translateException_StatusException_noRetry() { + void translateException_StatusException_noRetry() { Throwable originalException = new StatusException(Status.INVALID_ARGUMENT); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -73,7 +70,7 @@ public void translateException_StatusException_noRetry() { } @Test - public void translateException_StatusException_withRetry() { + void translateException_StatusException_withRetry() { Throwable originalException = new StatusException(Status.UNAVAILABLE); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -88,7 +85,7 @@ public void translateException_StatusException_withRetry() { } @Test - public void translateException_StatusRuntimeException_noRetry() { + void translateException_StatusRuntimeException_noRetry() { Throwable originalException = new StatusRuntimeException(Status.INVALID_ARGUMENT); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -103,7 +100,7 @@ public void translateException_StatusRuntimeException_noRetry() { } @Test - public void translateException_StatusRuntimeException_withRetry() { + void translateException_StatusRuntimeException_withRetry() { Throwable originalException = new StatusRuntimeException(Status.UNAVAILABLE); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -118,7 +115,7 @@ public void translateException_StatusRuntimeException_withRetry() { } @Test - public void translateException_cancelled() { + void translateException_cancelled() { GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>(inactiveCallable(), Collections.emptySet()); ApiFuture result = exceptionCallable.futureCall(0); @@ -129,7 +126,7 @@ public void translateException_cancelled() { } @Test - public void translateException_ApiException() { + void translateException_ApiException() { Throwable originalException = new RuntimeException("stuff went wrong"); Throwable apiException = new DataLossException( @@ -147,7 +144,7 @@ public void translateException_ApiException() { } @Test - public void translateException_RuntimeException() { + void translateException_RuntimeException() { Throwable originalException = new RuntimeException("stuff went wrong"); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -179,7 +176,7 @@ public ApiFuture futureCall(Integer request, ApiCallContext context) { }; } - public void assertInnerExceptionIsInstanceOf( + void assertInnerExceptionIsInstanceOf( Throwable thrownException, Class clazz, boolean retryable, Throwable originalException) { Truth.assertThat(thrownException).isInstanceOf(clazz); ApiException apiException = (ApiException) thrownException; diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java index a58d10ffc6..2647ac6d13 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java @@ -31,7 +31,8 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiFunction; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder; @@ -60,18 +61,15 @@ import java.util.logging.LogRecord; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest { +class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest { @Test - public void testEndpoint() { + void testEndpoint() { String endpoint = "localhost:8080"; InstantiatingGrpcChannelProvider.Builder builder = InstantiatingGrpcChannelProvider.newBuilder(); @@ -82,18 +80,22 @@ public void testEndpoint() { assertEquals(provider.getEndpoint(), endpoint); } - @Test(expected = IllegalArgumentException.class) - public void testEndpointNoPort() { - InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost"); + @Test + void testEndpointNoPort() { + assertThrows( + IllegalArgumentException.class, + () -> InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost")); } - @Test(expected = IllegalArgumentException.class) - public void testEndpointBadPort() { - InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:abcd"); + @Test + void testEndpointBadPort() { + assertThrows( + IllegalArgumentException.class, + () -> InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:abcd")); } @Test - public void testKeepAlive() { + void testKeepAlive() { Duration keepaliveTime = Duration.ofSeconds(1); Duration keepaliveTimeout = Duration.ofSeconds(2); boolean keepaliveWithoutCalls = true; @@ -111,14 +113,14 @@ public void testKeepAlive() { } @Test - public void testMaxInboundMetadataSize() { + void testMaxInboundMetadataSize() { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder().setMaxInboundMetadataSize(4096).build(); assertThat(provider.getMaxInboundMetadataSize()).isEqualTo(4096); } @Test - public void testCpuPoolSize() { + void testCpuPoolSize() { // happy path Builder builder = InstantiatingGrpcChannelProvider.newBuilder().setProcessorCount(2); builder.setChannelsPerCpu(2.5); @@ -135,7 +137,7 @@ public void testCpuPoolSize() { } @Test - public void testWithPoolSize() throws IOException { + void testWithPoolSize() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -155,7 +157,7 @@ public void testWithPoolSize() throws IOException { } @Test - public void testToBuilder() { + void testToBuilder() { Duration keepaliveTime = Duration.ofSeconds(1); Duration keepaliveTimeout = Duration.ofSeconds(2); ApiFunction channelConfigurator = @@ -191,12 +193,12 @@ public void testToBuilder() { } @Test - public void testWithInterceptors() throws Exception { + void testWithInterceptors() throws Exception { testWithInterceptors(1); } @Test - public void testWithInterceptorsAndMultipleChannels() throws Exception { + void testWithInterceptorsAndMultipleChannels() throws Exception { testWithInterceptors(5); } @@ -218,7 +220,7 @@ private void testWithInterceptors(int numChannels) throws Exception { } @Test - public void testChannelConfigurator() throws IOException { + void testChannelConfigurator() throws IOException { final int numChannels = 5; // Create a mock configurator that will insert mock channels @@ -253,7 +255,7 @@ public void testChannelConfigurator() throws IOException { } @Test - public void testWithGCECredentials() throws IOException { + void testWithGCECredentials() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -277,7 +279,7 @@ public void testWithGCECredentials() throws IOException { } @Test - public void testDirectPathXdsDisableByDefault() throws IOException { + void testDirectPathXdsDisableByDefault() throws IOException { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder().setAttemptDirectPath(true).build(); @@ -285,7 +287,7 @@ public void testDirectPathXdsDisableByDefault() throws IOException { } @Test - public void testDirectPathDisallowNullCredentials() throws IOException { + void testDirectPathDisallowNullCredentials() throws IOException { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder().build(); @@ -293,7 +295,7 @@ public void testDirectPathDisallowNullCredentials() throws IOException { } @Test - public void testDirectPathWithGDUEndpoint() { + void testDirectPathWithGDUEndpoint() { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() .setAttemptDirectPath(true) @@ -304,7 +306,7 @@ public void testDirectPathWithGDUEndpoint() { } @Test - public void testDirectPathWithNonGDUEndpoint() { + void testDirectPathWithNonGDUEndpoint() { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() .setAttemptDirectPath(true) @@ -315,7 +317,7 @@ public void testDirectPathWithNonGDUEndpoint() { } @Test - public void testDirectPathXdsEnabled() throws IOException { + void testDirectPathXdsEnabled() throws IOException { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() .setAttemptDirectPath(true) @@ -327,7 +329,7 @@ public void testDirectPathXdsEnabled() throws IOException { } @Test - public void testWithNonGCECredentials() throws IOException { + void testWithNonGCECredentials() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -355,7 +357,7 @@ public void testWithNonGCECredentials() throws IOException { } @Test - public void testWithDirectPathDisabled() throws IOException { + void testWithDirectPathDisabled() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -383,7 +385,7 @@ public void testWithDirectPathDisabled() throws IOException { } @Test - public void testWithNoDirectPathFlagSet() throws IOException { + void testWithNoDirectPathFlagSet() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -410,7 +412,7 @@ public void testWithNoDirectPathFlagSet() throws IOException { } @Test - public void testWithIPv6Address() throws IOException { + void testWithIPv6Address() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -428,7 +430,7 @@ public void testWithIPv6Address() throws IOException { // Test that if ChannelPrimer is provided, it is called during creation @Test - public void testWithPrimeChannel() throws IOException { + void testWithPrimeChannel() throws IOException { // create channelProvider with different pool sizes to verify ChannelPrimer is called the // correct number of times for (int poolSize = 1; poolSize < 5; poolSize++) { @@ -452,7 +454,7 @@ public void testWithPrimeChannel() throws IOException { } @Test - public void testWithDefaultDirectPathServiceConfig() { + void testWithDefaultDirectPathServiceConfig() { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder().build(); @@ -505,7 +507,7 @@ public void testWithDefaultDirectPathServiceConfig() { } @Test - public void testWithCustomDirectPathServiceConfig() { + void testWithCustomDirectPathServiceConfig() { ImmutableMap pickFirstStrategy = ImmutableMap.of("round_robin", ImmutableMap.of()); ImmutableMap childPolicy = @@ -539,7 +541,7 @@ protected Object getMtlsObjectFromTransportChannel(MtlsProvider provider) } @Test - public void testLogDirectPathMisconfigAttrempDirectPathNotSet() throws Exception { + void testLogDirectPathMisconfigAttrempDirectPathNotSet() throws Exception { FakeLogHandler logHandler = new FakeLogHandler(); InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); InstantiatingGrpcChannelProvider provider = @@ -560,7 +562,7 @@ public void testLogDirectPathMisconfigAttrempDirectPathNotSet() throws Exception } @Test - public void testLogDirectPathMisconfig_shouldNotLogInTheBuilder() { + void testLogDirectPathMisconfig_shouldNotLogInTheBuilder() { FakeLogHandler logHandler = new FakeLogHandler(); InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); InstantiatingGrpcChannelProvider.newBuilder() @@ -573,7 +575,7 @@ public void testLogDirectPathMisconfig_shouldNotLogInTheBuilder() { } @Test - public void testLogDirectPathMisconfigWrongCredential() throws Exception { + void testLogDirectPathMisconfigWrongCredential() throws Exception { FakeLogHandler logHandler = new FakeLogHandler(); InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); InstantiatingGrpcChannelProvider provider = @@ -595,7 +597,7 @@ public void testLogDirectPathMisconfigWrongCredential() throws Exception { } @Test - public void testLogDirectPathMisconfigNotOnGCE() throws Exception { + void testLogDirectPathMisconfigNotOnGCE() throws Exception { FakeLogHandler logHandler = new FakeLogHandler(); InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); InstantiatingGrpcChannelProvider provider = diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java index 5ac43f1417..19122ff653 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.gax.grpc.ProtoOperationTransformers.MetadataTransformer; import com.google.api.gax.grpc.ProtoOperationTransformers.ResponseTransformer; @@ -43,14 +43,11 @@ import com.google.type.Color; import com.google.type.Money; import io.grpc.Status.Code; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ProtoOperationTransformersTest { +class ProtoOperationTransformersTest { @Test - public void testAnyResponseTransformer() { + void testAnyResponseTransformer() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); OperationSnapshot operationSnapshot = @@ -60,7 +57,7 @@ public void testAnyResponseTransformer() { } @Test - public void testAnyResponseTransformer_exception() { + void testAnyResponseTransformer_exception() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); Status status = Status.newBuilder().setCode(Code.UNAVAILABLE.value()).build(); @@ -75,7 +72,7 @@ public void testAnyResponseTransformer_exception() { } @Test - public void testAnyResponseTransformer_mismatchedTypes() { + void testAnyResponseTransformer_mismatchedTypes() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Status status = Status.newBuilder().setCode(Code.OK.value()).build(); OperationSnapshot operationSnapshot = @@ -90,7 +87,7 @@ public void testAnyResponseTransformer_mismatchedTypes() { } @Test - public void testAnyMetadataTransformer() { + void testAnyMetadataTransformer() { MetadataTransformer transformer = MetadataTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); OperationSnapshot operationSnapshot = @@ -100,7 +97,7 @@ public void testAnyMetadataTransformer() { } @Test - public void testAnyMetadataTransformer_mismatchedTypes() { + void testAnyMetadataTransformer_mismatchedTypes() { MetadataTransformer transformer = MetadataTransformer.create(Money.class); Status status = Status.newBuilder().setCode(Code.OK.value()).build(); OperationSnapshot operationSnapshot = diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java index e24e36c686..6672f4c958 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.gax.batching.BatchingSettings; import com.google.api.gax.core.CredentialsProvider; @@ -58,14 +58,11 @@ import com.google.common.collect.Lists; import com.google.common.truth.Truth; import java.io.IOException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class SettingsTest { +class SettingsTest { interface FakePagedListResponse extends PagedListResponse {} @@ -265,7 +262,7 @@ public BatchingCallSettings.Builder fakeMethodBatching() { // ==== @Test - public void customCredentials() throws IOException { + void customCredentials() throws IOException { Credentials credentials = Mockito.mock(Credentials.class); FakeStubSettings settings = @@ -287,7 +284,7 @@ public void customCredentials() throws IOException { } @Test - public void channelCustomCredentialScopes() throws IOException { + void channelCustomCredentialScopes() throws IOException { ImmutableList inputScopes = ImmutableList.builder().add("https://www.googleapis.com/auth/fakeservice").build(); @@ -319,7 +316,7 @@ public void channelCustomCredentialScopes() throws IOException { // ==== @Test - public void callSettingsToBuilder() { + void callSettingsToBuilder() { UnaryCallSettings.Builder builderA = UnaryCallSettings.newUnaryCallSettingsBuilder(); UnaryCallSettings settingsA = builderA.build(); UnaryCallSettings.Builder builderB = settingsA.toBuilder(); @@ -329,14 +326,14 @@ public void callSettingsToBuilder() { } @Test - public void unaryCallSettingsBuilderBuildDoesNotFailUnsetProperties() { + void unaryCallSettingsBuilderBuildDoesNotFailUnsetProperties() { UnaryCallSettings.Builder builder = UnaryCallSettings.newUnaryCallSettingsBuilder(); builder.build(); } @Test - public void callSettingsBuildFromTimeoutNoRetries() { + void callSettingsBuildFromTimeoutNoRetries() { Duration timeout = Duration.ofMillis(60000); UnaryCallSettings.Builder builderA = @@ -361,6 +358,6 @@ public void callSettingsBuildFromTimeoutNoRetries() { .build()); UnaryCallSettings settingsB = builderB.build(); - assertEquals("UnaryCallSettings", settingsA, settingsB); + assertEquals(settingsA, settingsB, "UnaryCallSettings"); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java index ce5f04d786..7945c23f8b 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java @@ -55,22 +55,18 @@ import io.grpc.MethodDescriptor.MethodType; import java.io.IOException; import java.util.concurrent.TimeUnit; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class TimeoutTest { +@ExtendWith(MockitoExtension.class) +class TimeoutTest { private static final String CALL_OPTIONS_AUTHORITY = "RETRYING_TEST"; private static final int DEADLINE_IN_DAYS = 7; private static final int DEADLINE_IN_MINUTES = 10; @@ -83,12 +79,11 @@ public class TimeoutTest { private static final Duration initialRpcTimeout = Duration.ofSeconds(DEADLINE_IN_SECONDS); private static GrpcCallContext defaultCallContext; - @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); @Mock private Marshaller stringMarshaller; @Mock private RequestParamsExtractor paramsExtractor; @Mock private ManagedChannel managedChannel; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { EndpointContext endpointContext = Mockito.mock(EndpointContext.class); Mockito.doNothing() @@ -98,7 +93,7 @@ public static void setUp() throws IOException { } @Test - public void testNonRetryUnarySettings() { + void testNonRetryUnarySettings() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -124,7 +119,7 @@ public void testNonRetryUnarySettings() { } @Test - public void testNonRetryUnarySettingsContextWithRetry() { + void testNonRetryUnarySettingsContextWithRetry() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -164,7 +159,7 @@ public void testNonRetryUnarySettingsContextWithRetry() { } @Test - public void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { + void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -189,7 +184,7 @@ public void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { } @Test - public void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { + void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -213,7 +208,7 @@ public void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { } @Test - public void testNonRetryServerStreamingSettings() { + void testNonRetryServerStreamingSettings() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -239,7 +234,7 @@ public void testNonRetryServerStreamingSettings() { } @Test - public void testNonRetryServerStreamingSettingsContextWithRetry() { + void testNonRetryServerStreamingSettingsContextWithRetry() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -279,7 +274,7 @@ public void testNonRetryServerStreamingSettingsContextWithRetry() { } @Test - public void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { + void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) @@ -304,7 +299,7 @@ public void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { } @Test - public void testNonRetryServerStreamingSettingsWithoutIndividualRpcTimeout() { + void testNonRetryServerStreamingSettingsWithoutIndividualRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() .setTotalTimeout(totalTimeout) diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java index 585f8ec65f..c851e93c7b 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java @@ -29,8 +29,9 @@ */ package com.google.api.gax.grpc.testing; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -41,15 +42,12 @@ import io.grpc.ServerServiceDefinition; import java.io.IOException; import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** Tests for {@link MockServiceHelper}. */ -@RunWith(JUnit4.class) public class MockServiceHelperTest { @Mock private MockGrpcService grpcService; @Mock private MockGrpcService grpcService2; @@ -57,8 +55,8 @@ public class MockServiceHelperTest { @Mock private Server server; /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(grpcService.getServiceDefinition()) .thenReturn(ServerServiceDefinition.builder("fake-service").build()); @@ -67,28 +65,28 @@ public void setUp() { } @Test - public void testGetService() { + void testGetService() { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address", grpcService); Truth.assertThat(serviceHelper.getService()).isSameInstanceAs(grpcService); Truth.assertThat(serviceHelper.getServices().size()).isEqualTo(1); } - @Test(expected = IllegalStateException.class) - public void testGetServiceInvalid() { + @Test + void testGetServiceInvalid() { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address2", Arrays.asList(grpcService, grpcService2)); - serviceHelper.getService(); + assertThrows(IllegalStateException.class, serviceHelper::getService); } @Test - public void testStart() throws IOException { + void testStart() throws IOException { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address", grpcService); serviceHelper.start(); verify(server, times(1)).start(); } @Test - public void testReset() { + void testReset() { MockServiceHelper serviceHelper = new MockServiceHelper("fake-address", grpcService); serviceHelper.reset(); verify(grpcService, times(1)).getServiceDefinition(); @@ -96,7 +94,7 @@ public void testReset() { } @Test - public void testCreateChannelProvider() throws Exception { + void testCreateChannelProvider() throws Exception { MockServiceHelper serviceHelper = new MockServiceHelper("fake-address", grpcService); TransportChannel channel = serviceHelper.createChannelProvider().getTransportChannel(); assertNotNull(channel); diff --git a/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java b/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java index 0c5eaa302f..d438a8c4f4 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java @@ -29,6 +29,9 @@ */ package com.google.longrunning; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.testing.LocalChannelProvider; import com.google.api.gax.grpc.testing.MockGrpcService; @@ -44,20 +47,19 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -public class OperationsClientTest { +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class OperationsClientTest { private static MockOperations mockOperations; private static MockServiceHelper serviceHelper; private OperationsClient client; private LocalChannelProvider channelProvider; - @BeforeClass + @BeforeAll public static void startStaticServer() { mockOperations = new MockOperations(); serviceHelper = @@ -65,13 +67,13 @@ public static void startStaticServer() { serviceHelper.start(); } - @AfterClass + @AfterAll public static void stopServer() { serviceHelper.stop(); } - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { serviceHelper.reset(); channelProvider = serviceHelper.createChannelProvider(); OperationsSettings settings = @@ -82,14 +84,14 @@ public void setUp() throws IOException { client = OperationsClient.create(settings); } - @After - public void tearDown() { + @AfterEach + void tearDown() { client.close(); } @Test @SuppressWarnings("all") - public void getOperationTest() { + void getOperationTest() { String name2 = "name2-1052831874"; boolean done = true; Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); @@ -98,34 +100,32 @@ public void getOperationTest() { String name = "name3373707"; Operation actualResponse = client.getOperation(name); - Assert.assertEquals(expectedResponse, actualResponse); + assertEquals(expectedResponse, actualResponse); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); GetOperationRequest actualRequest = (GetOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void getOperationExceptionTest() throws Exception { + void getOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.getOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.getOperation(name); + }); } @Test @SuppressWarnings("all") - public void listOperationsTest() { + void listOperationsTest() { String nextPageToken = ""; Operation operationsElement = Operation.newBuilder().build(); List operations = Arrays.asList(operationsElement); @@ -142,37 +142,35 @@ public void listOperationsTest() { ListOperationsPagedResponse pagedListResponse = client.listOperations(name, filter); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); + assertEquals(1, resources.size()); + assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); ListOperationsRequest actualRequest = (ListOperationsRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(filter, actualRequest.getFilter()); + assertEquals(name, actualRequest.getName()); + assertEquals(filter, actualRequest.getFilter()); } @Test @SuppressWarnings("all") - public void listOperationsExceptionTest() throws Exception { + void listOperationsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - String filter = "filter-1274492040"; - - client.listOperations(name, filter); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + String filter = "filter-1274492040"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.listOperations(name, filter); + }); } @Test @SuppressWarnings("all") - public void cancelOperationTest() { + void cancelOperationTest() { Empty expectedResponse = Empty.newBuilder().build(); mockOperations.addResponse(expectedResponse); @@ -181,31 +179,29 @@ public void cancelOperationTest() { client.cancelOperation(name); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); CancelOperationRequest actualRequest = (CancelOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void cancelOperationExceptionTest() throws Exception { + void cancelOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.cancelOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.cancelOperation(name); + }); } @Test @SuppressWarnings("all") - public void deleteOperationTest() { + void deleteOperationTest() { Empty expectedResponse = Empty.newBuilder().build(); mockOperations.addResponse(expectedResponse); @@ -214,31 +210,29 @@ public void deleteOperationTest() { client.deleteOperation(name); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); DeleteOperationRequest actualRequest = (DeleteOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void deleteOperationExceptionTest() throws Exception { + void deleteOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.deleteOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.deleteOperation(name); + }); } @Test @SuppressWarnings("all") - public void waitOperationTest() { + void waitOperationTest() { String name2 = "name2-1052831874"; boolean done = true; Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); @@ -250,31 +244,29 @@ public void waitOperationTest() { WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); Operation actualResponse = client.waitOperation(request); - Assert.assertEquals(expectedResponse, actualResponse); + assertEquals(expectedResponse, actualResponse); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); WaitOperationRequest actualRequest = (WaitOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void waitOperationExceptionTest() throws Exception { + void waitOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - Duration timeout = Duration.newBuilder().setSeconds(5).build(); - WaitOperationRequest request = - WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); - - client.waitOperation(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + Duration timeout = Duration.newBuilder().setSeconds(5).build(); + WaitOperationRequest request = + WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); + assertThrows( + InvalidArgumentException.class, + () -> { + client.waitOperation(request); + }); } } diff --git a/gax-java/gax-httpjson/BUILD.bazel b/gax-java/gax-httpjson/BUILD.bazel index 15c81e73d4..1e134e6770 100644 --- a/gax-java/gax-httpjson/BUILD.bazel +++ b/gax-java/gax-httpjson/BUILD.bazel @@ -28,8 +28,9 @@ _COMPILE_DEPS = [ ] _TEST_COMPILE_DEPS = [ - "@junit_junit//jar", + "@org_junit_jupiter_junit_jupiter_api//jar", "@org_mockito_mockito_core//jar", + "@org_mockito_mockito_junit_jupiter//jar", "@com_google_truth_truth//jar", "//gax:gax_testlib", "@com_googlecode_java_diff_utils_diffutils//jar", diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/GaxHttpJsonPropertiesTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/GaxHttpJsonPropertiesTest.java index 487605a62a..007b100577 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/GaxHttpJsonPropertiesTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/GaxHttpJsonPropertiesTest.java @@ -30,15 +30,15 @@ package com.google.api.gax.httpjson; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GaxHttpJsonPropertiesTest { +class GaxHttpJsonPropertiesTest { private static final String X_GOOG_API_CLIENT = "x-goog-api-client"; @Test - public void testDefaultHeaderPattern() { + void testDefaultHeaderPattern() { assertTrue( GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() .matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 rest/1.7.0") diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpHeadersUtilsTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpHeadersUtilsTest.java index 9c305977d5..247f2b2907 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpHeadersUtilsTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpHeadersUtilsTest.java @@ -29,19 +29,19 @@ */ package com.google.api.gax.httpjson; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.api.client.http.HttpHeaders; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpHeadersUtilsTest { +class HttpHeadersUtilsTest { @Test - public void testSetHeader() { + void testSetHeader() { HttpHeaders headers = new HttpHeaders(); assertEquals(headers, HttpHeadersUtils.setHeader(headers, "Custom-Header", "CustomHeader")); @@ -105,7 +105,7 @@ public void testSetHeader() { } @Test - public void testSetHeaders() { + void testSetHeaders() { HttpHeaders headers = new HttpHeaders(); Map headersMap = @@ -120,7 +120,7 @@ public void testSetHeaders() { } @Test - public void testGetUserAgentValue() { + void testGetUserAgentValue() { Map headersMap = ImmutableMap.of( "Custom-Header", "CustomHeader", "User-Agent", "this is me", "accept", "Accept"); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java index fc872d3529..1da469cdb2 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java @@ -29,10 +29,11 @@ */ package com.google.api.gax.httpjson; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; @@ -49,30 +50,24 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class HttpJsonCallContextTest { +class HttpJsonCallContextTest { @Test - public void testNullToSelfWrongType() { - try { - HttpJsonCallContext.createDefault().nullToSelf(FakeCallContext.createDefault()); - Assert.fail("HttpJsonCallContext should have thrown an exception"); - } catch (IllegalArgumentException expected) { - Truth.assertThat(expected) - .hasMessageThat() - .contains("context must be an instance of HttpJsonCallContext"); - } + void testNullToSelfWrongType() { + IllegalArgumentException actual = + assertThrows( + IllegalArgumentException.class, + () -> HttpJsonCallContext.createDefault().nullToSelf(FakeCallContext.createDefault())); + assertTrue(actual.getMessage().contains("context must be an instance of HttpJsonCallContext")); } @Test - public void testWithCredentials() { + void testWithCredentials() { Credentials credentials = Mockito.mock(Credentials.class); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getCredentials()); @@ -81,7 +76,7 @@ public void testWithCredentials() { } @Test - public void testWithTransportChannel() { + void testWithTransportChannel() { ManagedHttpJsonChannel channel = Mockito.mock(ManagedHttpJsonChannel.class); HttpJsonCallContext context = @@ -92,22 +87,22 @@ public void testWithTransportChannel() { } @Test - public void testWithTransportChannelWrongType() { + void testWithTransportChannelWrongType() { try { FakeChannel channel = new FakeChannel(); HttpJsonCallContext.createDefault() .withTransportChannel(FakeTransportChannel.create(channel)); - Assert.fail("HttpJsonCallContext should have thrown an exception"); + Assertions.fail("HttpJsonCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected).hasMessageThat().contains("Expected HttpJsonTransportChannel"); } } @Test - public void testMergeWrongType() { + void testMergeWrongType() { try { HttpJsonCallContext.createDefault().merge(FakeCallContext.createDefault()); - Assert.fail("HttpJsonCallContext should have thrown an exception"); + Assertions.fail("HttpJsonCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -116,24 +111,24 @@ public void testMergeWrongType() { } @Test - public void testWithTimeout() { + void testWithTimeout() { assertNull(HttpJsonCallContext.createDefault().withTimeout(null).getTimeout()); } @Test - public void testWithNegativeTimeout() { + void testWithNegativeTimeout() { assertNull( HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(-1L)).getTimeout()); } @Test - public void testWithZeroTimeout() { + void testWithZeroTimeout() { assertNull( HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(0L)).getTimeout()); } @Test - public void testWithShorterTimeout() { + void testWithShorterTimeout() { HttpJsonCallContext ctxWithLongTimeout = HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(10)); @@ -147,7 +142,7 @@ public void testWithShorterTimeout() { } @Test - public void testWithLongerTimeout() { + void testWithLongerTimeout() { HttpJsonCallContext ctxWithShortTimeout = HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(5)); @@ -161,7 +156,7 @@ public void testWithLongerTimeout() { } @Test - public void testMergeWithNullTimeout() { + void testMergeWithNullTimeout() { Duration timeout = Duration.ofSeconds(10); HttpJsonCallContext baseContext = HttpJsonCallContext.createDefault().withTimeout(timeout); @@ -173,7 +168,7 @@ public void testMergeWithNullTimeout() { } @Test - public void testMergeWithTimeout() { + void testMergeWithTimeout() { Duration timeout = Duration.ofSeconds(19); HttpJsonCallContext ctx1 = HttpJsonCallContext.createDefault(); HttpJsonCallContext ctx2 = HttpJsonCallContext.createDefault().withTimeout(timeout); @@ -182,7 +177,7 @@ public void testMergeWithTimeout() { } @Test - public void testMergeWithTracer() { + void testMergeWithTracer() { ApiTracer explicitTracer = Mockito.mock(ApiTracer.class); HttpJsonCallContext ctxWithExplicitTracer = HttpJsonCallContext.createDefault().withTracer(explicitTracer); @@ -204,7 +199,7 @@ public void testMergeWithTracer() { } @Test - public void testWithRetrySettings() { + void testWithRetrySettings() { RetrySettings retrySettings = Mockito.mock(RetrySettings.class); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getRetrySettings()); @@ -213,7 +208,7 @@ public void testWithRetrySettings() { } @Test - public void testWithRetryableCodes() { + void testWithRetryableCodes() { Set codes = Collections.singleton(StatusCode.Code.UNAVAILABLE); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getRetryableCodes()); @@ -222,7 +217,7 @@ public void testWithRetryableCodes() { } @Test - public void testWithExtraHeaders() { + void testWithExtraHeaders() { Map> headers = ImmutableMap.of("k", Arrays.asList("v")); ApiCallContext emptyContext = HttpJsonCallContext.createDefault(); assertTrue(emptyContext.getExtraHeaders().isEmpty()); @@ -231,7 +226,7 @@ public void testWithExtraHeaders() { } @Test - public void testWithOptions() { + void testWithOptions() { ApiCallContext emptyCallContext = HttpJsonCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); @@ -249,7 +244,7 @@ public void testWithOptions() { } @Test - public void testMergeOptions() { + void testMergeOptions() { ApiCallContext emptyCallContext = HttpJsonCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java index 4d0785f242..7f317a60bf 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java @@ -39,15 +39,12 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class HttpJsonCallableFactoryTest { +class HttpJsonCallableFactoryTest { @Test - public void testGetSpanName() { + void testGetSpanName() { Map validNames = ImmutableMap.of( "compute.projects.disableXpnHost", SpanName.of("compute.projects", "disableXpnHost"), @@ -69,7 +66,7 @@ public void testGetSpanName() { } @Test - public void testGetSpanNameInvalid() { + void testGetSpanNameInvalid() { List invalidNames = ImmutableList.of("no_split", ".no_client"); for (String invalidName : invalidNames) { diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java index 0355dd0d4b..e65c9d9758 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java @@ -39,14 +39,14 @@ import java.util.concurrent.Executor; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class HttpJsonClientCallImplTest { +@ExtendWith(MockitoExtension.class) +class HttpJsonClientCallImplTest { @Mock private ApiMethodDescriptor apiMethodDescriptor; @Mock private HttpResponseParser httpResponseParser; @Mock private HttpJsonCallOptions httpJsonCallOptions; @@ -56,7 +56,7 @@ public class HttpJsonClientCallImplTest { @Mock private HttpJsonClientCall.Listener listener; @Test - public void responseReceived_noCancellationTask() { + void responseReceived_noCancellationTask() { ScheduledThreadPoolExecutor deadlineSchedulerExecutor = new ScheduledThreadPoolExecutor(1); // Null timeout means no timeout task created Mockito.when(httpJsonCallOptions.getTimeout()).thenReturn(null); @@ -86,8 +86,7 @@ public void responseReceived_noCancellationTask() { } @Test - public void responseReceived_cancellationTaskExists_isCancelledProperly() - throws InterruptedException { + void responseReceived_cancellationTaskExists_isCancelledProperly() throws InterruptedException { ScheduledThreadPoolExecutor deadlineSchedulerExecutor = new ScheduledThreadPoolExecutor(1); // SetRemoveOnCancelPolicy will immediately remove the task from the work queue // when the task is cancelled diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java index c4cdcf1390..7e2d9cb946 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java @@ -30,7 +30,7 @@ package com.google.api.gax.httpjson; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode; @@ -38,14 +38,11 @@ import com.google.auth.Credentials; import com.google.auth.Retryable; import java.io.IOException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class HttpJsonClientCallsTest { +class HttpJsonClientCallsTest { // Auth Library's GoogleAuthException is package-private. Copy basic functionality for tests private static class GoogleAuthException extends IOException implements Retryable { @@ -74,8 +71,8 @@ public int getRetryCount() { private HttpJsonCallOptions callOptions; private HttpJsonCallContext callContext; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { credentials = Mockito.mock(Credentials.class); endpointContext = Mockito.mock(EndpointContext.class); mockChannel = Mockito.mock(HttpJsonChannel.class); @@ -95,14 +92,14 @@ public void setUp() throws IOException { } @Test - public void testValidUniverseDomain() { + void testValidUniverseDomain() { HttpJsonClientCalls.newCall(descriptor, callContext); Mockito.verify(mockChannel, Mockito.times(1)).newCall(descriptor, callOptions); } // This test is when the universe domain does not match @Test - public void testInvalidUniverseDomain() throws IOException { + void testInvalidUniverseDomain() throws IOException { Mockito.doThrow( new UnauthenticatedException( null, HttpJsonStatusCode.of(StatusCode.Code.UNAUTHENTICATED), false)) @@ -121,7 +118,7 @@ public void testInvalidUniverseDomain() throws IOException { // This test is when the MDS is unable to return a valid universe domain @Test - public void testUniverseDomainNotReady_shouldRetry() throws IOException { + void testUniverseDomainNotReady_shouldRetry() throws IOException { Mockito.doThrow(new GoogleAuthException(true)) .when(endpointContext) .validateUniverseDomain( diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java index 463b76112b..dc5844616d 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java @@ -46,18 +46,15 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class HttpJsonClientInterceptorTest { +class HttpJsonClientInterceptorTest { private static class CapturingClientInterceptor implements HttpJsonClientInterceptor { // Manually capturing arguments instead of using Mockito. This is intentional, as this @@ -143,7 +140,7 @@ public void onClose(int statusCode, HttpJsonMetadata trailers) { private CapturingClientInterceptor interceptor; private ManagedHttpJsonChannel channel; - @BeforeClass + @BeforeAll public static void initialize() { executorService = Executors.newFixedThreadPool( @@ -155,13 +152,13 @@ public static void initialize() { }); } - @AfterClass + @AfterAll public static void destroy() { executorService.shutdownNow(); } - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { interceptor = new CapturingClientInterceptor(); channel = InstantiatingHttpJsonChannelProvider.newBuilder() @@ -175,13 +172,13 @@ public void setUp() throws IOException { .getManagedChannel(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { MOCK_SERVICE.reset(); } @Test - public void testCustomInterceptor() throws ExecutionException, InterruptedException, IOException { + void testCustomInterceptor() throws ExecutionException, InterruptedException, IOException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java index 619052744a..0c14779bc8 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java @@ -49,18 +49,15 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class HttpJsonDirectCallableTest { +class HttpJsonDirectCallableTest { private static final ApiMethodDescriptor FAKE_METHOD_DESCRIPTOR = ApiMethodDescriptor.newBuilder() @@ -111,7 +108,7 @@ public class HttpJsonDirectCallableTest { private static HttpJsonCallContext defaultCallContext; - @BeforeClass + @BeforeAll public static void initialize() throws IOException { executorService = Executors.newFixedThreadPool( @@ -133,18 +130,18 @@ public static void initialize() throws IOException { .withEndpointContext(endpointContext); } - @AfterClass + @AfterAll public static void destroy() { executorService.shutdownNow(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { MOCK_SERVICE.reset(); } @Test - public void testSuccessfulUnaryResponse() throws ExecutionException, InterruptedException { + void testSuccessfulUnaryResponse() throws ExecutionException, InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -173,7 +170,7 @@ public void testSuccessfulUnaryResponse() throws ExecutionException, Interrupted * @throws ExecutionException */ @Test - public void testSuccessfulMultipleResponsesForUnaryCall() + void testSuccessfulMultipleResponsesForUnaryCall() throws InterruptedException, ExecutionException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -203,8 +200,7 @@ public void testSuccessfulMultipleResponsesForUnaryCall() * @throws ExecutionException */ @Test - public void testErrorMultipleResponsesForUnaryCall() - throws InterruptedException, ExecutionException { + void testErrorMultipleResponsesForUnaryCall() throws InterruptedException, ExecutionException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -231,7 +227,7 @@ public void testErrorMultipleResponsesForUnaryCall() * @throws InterruptedException */ @Test - public void testErrorUnaryResponse() throws InterruptedException { + void testErrorUnaryResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -242,7 +238,7 @@ public void testErrorUnaryResponse() throws InterruptedException { try { callable.futureCall(createTestMessage(2), defaultCallContext).get(); - Assert.fail("No exception raised"); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(400); @@ -258,7 +254,7 @@ public void testErrorUnaryResponse() throws InterruptedException { * @throws InterruptedException */ @Test - public void testErrorNullContentSuccessfulResponse() throws InterruptedException { + void testErrorNullContentSuccessfulResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -266,7 +262,7 @@ public void testErrorNullContentSuccessfulResponse() throws InterruptedException try { callable.futureCall(createTestMessage(2), defaultCallContext).get(); - Assert.fail("No exception raised"); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpJsonStatusRuntimeException respExp = (HttpJsonStatusRuntimeException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(200); @@ -282,7 +278,7 @@ public void testErrorNullContentSuccessfulResponse() throws InterruptedException * @throws InterruptedException */ @Test - public void testErrorNullContentFailedResponse() throws InterruptedException { + void testErrorNullContentFailedResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -290,7 +286,7 @@ public void testErrorNullContentFailedResponse() throws InterruptedException { try { callable.futureCall(createTestMessage(2), defaultCallContext).get(); - Assert.fail("No exception raised"); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(400); @@ -304,7 +300,7 @@ public void testErrorNullContentFailedResponse() throws InterruptedException { * @throws InterruptedException */ @Test - public void testErrorNon2xxOr4xxResponse() throws InterruptedException { + void testErrorNon2xxOr4xxResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -315,7 +311,7 @@ public void testErrorNon2xxOr4xxResponse() throws InterruptedException { try { callable.futureCall(createTestMessage(2), defaultCallContext).get(); - Assert.fail("No exception raised"); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(500); @@ -331,7 +327,7 @@ public void testErrorNon2xxOr4xxResponse() throws InterruptedException { * @throws InterruptedException */ @Test - public void testDeadlineExceededResponse() throws InterruptedException { + void testDeadlineExceededResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); @@ -342,7 +338,7 @@ public void testDeadlineExceededResponse() throws InterruptedException { try { callable.futureCall(createTestMessage(10), callContext).get(); - Assert.fail("No exception raised"); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpJsonStatusRuntimeException respExp = (HttpJsonStatusRuntimeException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(504); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java index 3fc1724439..5cae0fda31 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java @@ -61,17 +61,14 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class HttpJsonDirectServerStreamingCallableTest { +class HttpJsonDirectServerStreamingCallableTest { private static final Color DEFAULT_REQUEST = Color.newBuilder().setRed(0.5f).build(); private static final Color ASYNC_REQUEST = DEFAULT_REQUEST.toBuilder().setGreen(1000).build(); private static final Color ERROR_REQUEST = Color.newBuilder().setRed(-1).build(); @@ -89,12 +86,12 @@ public class HttpJsonDirectServerStreamingCallableTest { private MockHttpService mockService; ApiMethodDescriptor methodServerStreamingRecognize; - @Before - public void initialize() throws IOException { + @BeforeEach + void initialize() throws IOException { initialize(Duration.ofSeconds(30)); } - public void initialize(Duration timeout) throws IOException { + void initialize(Duration timeout) throws IOException { this.methodServerStreamingRecognize = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.v1.Fake/ServerStreamingRecognize") @@ -162,14 +159,14 @@ public void initialize(Duration timeout) throws IOException { clientContext); } - @After - public void destroy() throws InterruptedException { + @AfterEach + void destroy() throws InterruptedException { executorService.shutdown(); channel.shutdown(); } @Test - public void testBadContext() { + void testBadContext() { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); // Create a local callable with a bad context ServerStreamingCallable streamingCallable = @@ -186,7 +183,7 @@ public void testBadContext() { MoneyObserver observer = new MoneyObserver(true, latch); try { streamingCallable.call(DEFAULT_REQUEST, observer); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -195,7 +192,7 @@ public void testBadContext() { } @Test - public void testServerStreamingStart() throws InterruptedException { + void testServerStreamingStart() throws InterruptedException { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -206,7 +203,7 @@ public void testServerStreamingStart() throws InterruptedException { } @Test - public void testServerStreaming() throws InterruptedException { + void testServerStreaming() throws InterruptedException { mockService.addResponse(new Money[] {DEFAULT_RESPONSE, DEFAULTER_RESPONSE}); CountDownLatch latch = new CountDownLatch(3); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -220,7 +217,7 @@ public void testServerStreaming() throws InterruptedException { } @Test - public void testManualFlowControl() throws Exception { + void testManualFlowControl() throws Exception { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -240,7 +237,7 @@ public void testManualFlowControl() throws Exception { } @Test - public void testCancelClientCall() throws Exception { + void testCancelClientCall() throws Exception { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -256,7 +253,7 @@ public void testCancelClientCall() throws Exception { } @Test - public void testOnResponseError() throws Throwable { + void testOnResponseError() throws Throwable { mockService.addException(404, new RuntimeException("some error")); CountDownLatch latch = new CountDownLatch(1); @@ -281,7 +278,7 @@ public void testOnResponseError() throws Throwable { } @Test - public void testObserverErrorCancelsCall() throws Throwable { + void testObserverErrorCancelsCall() throws Throwable { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); final RuntimeException expectedCause = new RuntimeException("some error"); final SettableApiFuture actualErrorF = SettableApiFuture.create(); @@ -321,7 +318,7 @@ protected void onCompleteImpl() { } @Test - public void testBlockingServerStreaming() { + void testBlockingServerStreaming() { mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); Color request = Color.newBuilder().setRed(0.5f).build(); ServerStream response = streamingCallable.call(request); @@ -333,7 +330,7 @@ public void testBlockingServerStreaming() { // This test ensures that the server-side streaming does not exceed the timeout value @Test - public void testDeadlineExceededServerStreaming() throws InterruptedException, IOException { + void testDeadlineExceededServerStreaming() throws InterruptedException, IOException { // set a low timeout to trigger deadline-exceeded sooner initialize(Duration.ofSeconds(1)); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java index 702f327a6b..0858ae350c 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java @@ -30,7 +30,7 @@ package com.google.api.gax.httpjson; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -42,17 +42,17 @@ import com.google.common.truth.Truth; import com.google.protobuf.Field; import com.google.protobuf.Option; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpJsonLongRunningClientTest { +class HttpJsonLongRunningClientTest { private OperationSnapshotFactory operationSnapFact; private PollingRequestFactory