From 5d101b29a60514036021bf18606f3cde33003fd3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 21:10:16 +0200 Subject: [PATCH 01/11] chore(deps): update dependency com.google.cloud:google-cloud-firestore to v3.13.2 (#1341) 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:google-cloud-firestore](https://togithub.com/googleapis/java-firestore) | `3.13.1` -> `3.13.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-firestore/3.13.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-firestore/3.13.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-firestore/3.13.2/compatibility-slim/3.13.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-firestore/3.13.2/confidence-slim/3.13.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-firestore ### [`v3.13.2`](https://togithub.com/googleapis/java-firestore/blob/HEAD/CHANGELOG.md#​3132-httpsgithubcomgoogleapisjava-firestorecomparev3131v3132-2023-06-22) [Compare Source](https://togithub.com/googleapis/java-firestore/compare/v3.13.1...v3.13.2) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.12.0 ([#​1338](https://togithub.com/googleapis/java-firestore/issues/1338)) ([0ef1882](https://togithub.com/googleapis/java-firestore/commit/0ef18821e1bec0a99da5609f6b894f0c4131f6c5))
--- ### 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/java-firestore). --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3069ec5cab..158cebe09d 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-firestore - 3.13.1 + 3.13.2 ``` @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-firestore' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-firestore:3.13.1' +implementation 'com.google.cloud:google-cloud-firestore:3.13.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.13.1" +libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.13.2" ``` @@ -222,7 +222,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-firestore/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-firestore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.13.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.13.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 03387e374e..ddb05b5db3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud google-cloud-firestore - 3.13.1 + 3.13.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cbac554239..256bec3fbb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-firestore - 3.13.1 + 3.13.2 From c75157ef73ed6064e82bd0dc12a5767293e80987 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 19:32:15 +0000 Subject: [PATCH 02/11] chore(main): release 3.13.3-SNAPSHOT (#1340) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- google-cloud-firestore-admin/pom.xml | 4 ++-- google-cloud-firestore-bom/pom.xml | 16 ++++++++-------- google-cloud-firestore/pom.xml | 4 ++-- grpc-google-cloud-firestore-admin-v1/pom.xml | 4 ++-- grpc-google-cloud-firestore-v1/pom.xml | 4 ++-- pom.xml | 14 +++++++------- proto-google-cloud-firestore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-firestore-bundle-v1/pom.xml | 4 ++-- proto-google-cloud-firestore-v1/pom.xml | 4 ++-- versions.txt | 16 ++++++++-------- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/google-cloud-firestore-admin/pom.xml b/google-cloud-firestore-admin/pom.xml index d95ad4eb63..3ab6114fa2 100644 --- a/google-cloud-firestore-admin/pom.xml +++ b/google-cloud-firestore-admin/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-firestore-admin - 3.13.2 + 3.13.3-SNAPSHOT jar Google Cloud Firestore Admin Client https://github.com/googleapis/java-firestore @@ -14,7 +14,7 @@ com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/google-cloud-firestore-bom/pom.xml b/google-cloud-firestore-bom/pom.xml index 9a0f89d9b9..52f6e05d81 100644 --- a/google-cloud-firestore-bom/pom.xml +++ b/google-cloud-firestore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-firestore-bom - 3.13.2 + 3.13.3-SNAPSHOT pom com.google.cloud @@ -52,37 +52,37 @@ com.google.cloud google-cloud-firestore - 3.13.2 + 3.13.3-SNAPSHOT com.google.cloud google-cloud-firestore-admin - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/google-cloud-firestore/pom.xml b/google-cloud-firestore/pom.xml index dcd475e8f1..2fde07ac17 100644 --- a/google-cloud-firestore/pom.xml +++ b/google-cloud-firestore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-firestore - 3.13.2 + 3.13.3-SNAPSHOT jar Google Cloud Firestore https://github.com/googleapis/java-firestore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT google-cloud-firestore diff --git a/grpc-google-cloud-firestore-admin-v1/pom.xml b/grpc-google-cloud-firestore-admin-v1/pom.xml index 0f27c2f71b..6cf08a86cb 100644 --- a/grpc-google-cloud-firestore-admin-v1/pom.xml +++ b/grpc-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT grpc-google-cloud-firestore-admin-v1 GRPC library for grpc-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/grpc-google-cloud-firestore-v1/pom.xml b/grpc-google-cloud-firestore-v1/pom.xml index 5a8842b1c8..c84e0a284a 100644 --- a/grpc-google-cloud-firestore-v1/pom.xml +++ b/grpc-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT grpc-google-cloud-firestore-v1 GRPC library for grpc-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/pom.xml b/pom.xml index e41e5edab1..bc759f609c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-firestore-parent pom - 3.13.2 + 3.13.3-SNAPSHOT Google Cloud Firestore Parent https://github.com/googleapis/java-firestore @@ -150,32 +150,32 @@ com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.cloud google-cloud-firestore - 3.13.2 + 3.13.3-SNAPSHOT com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/proto-google-cloud-firestore-admin-v1/pom.xml b/proto-google-cloud-firestore-admin-v1/pom.xml index 8916887f78..eb6855c53e 100644 --- a/proto-google-cloud-firestore-admin-v1/pom.xml +++ b/proto-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.2 + 3.13.3-SNAPSHOT proto-google-cloud-firestore-admin-v1 PROTO library for proto-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/proto-google-cloud-firestore-bundle-v1/pom.xml b/proto-google-cloud-firestore-bundle-v1/pom.xml index ef54f1f64b..38cacd2d78 100644 --- a/proto-google-cloud-firestore-bundle-v1/pom.xml +++ b/proto-google-cloud-firestore-bundle-v1/pom.xml @@ -5,14 +5,14 @@ 4.0.0 proto-google-cloud-firestore-bundle-v1 - 3.13.2 + 3.13.3-SNAPSHOT proto-google-cloud-firestore-bundle-v1 PROTO library for proto-google-cloud-firestore-bundle-v1 com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/proto-google-cloud-firestore-v1/pom.xml b/proto-google-cloud-firestore-v1/pom.xml index b1a75120be..c6d20b7c7e 100644 --- a/proto-google-cloud-firestore-v1/pom.xml +++ b/proto-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.2 + 3.13.3-SNAPSHOT proto-google-cloud-firestore-v1 PROTO library for proto-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.13.2 + 3.13.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1a753a5da1..541000736e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,11 +1,11 @@ # Format: # module:released-version:current-version -google-cloud-firestore:3.13.2:3.13.2 -google-cloud-firestore-admin:3.13.2:3.13.2 -google-cloud-firestore-bom:3.13.2:3.13.2 -grpc-google-cloud-firestore-admin-v1:3.13.2:3.13.2 -grpc-google-cloud-firestore-v1:3.13.2:3.13.2 -proto-google-cloud-firestore-admin-v1:3.13.2:3.13.2 -proto-google-cloud-firestore-v1:3.13.2:3.13.2 -proto-google-cloud-firestore-bundle-v1:3.13.2:3.13.2 +google-cloud-firestore:3.13.2:3.13.3-SNAPSHOT +google-cloud-firestore-admin:3.13.2:3.13.3-SNAPSHOT +google-cloud-firestore-bom:3.13.2:3.13.3-SNAPSHOT +grpc-google-cloud-firestore-admin-v1:3.13.2:3.13.3-SNAPSHOT +grpc-google-cloud-firestore-v1:3.13.2:3.13.3-SNAPSHOT +proto-google-cloud-firestore-admin-v1:3.13.2:3.13.3-SNAPSHOT +proto-google-cloud-firestore-v1:3.13.2:3.13.3-SNAPSHOT +proto-google-cloud-firestore-bundle-v1:3.13.2:3.13.3-SNAPSHOT From d931375130e247742c6492d01726cf412de078a8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:26:16 +0000 Subject: [PATCH 03/11] chore: Java 8 unit test to build code in Java 17 and run tests on Java 8 (#1800) (#1337) * Our Java projects are configured to produce Java 8-compatible bytecode via https://togithub.com/googleapis/java-shared-config/blob/main/pom.xml#L848. This unit test change ensures this config is applied correctly. * This change also switches the JDK distribution of GitHub Actions to temurin from zulu. * For the repositories that mark "dependencies (8)" and "dependencies (11)" as required, they should point to only "dependencies (17)" via `.github/sync-repo-settings.yaml` and repo's Settings tab. Source-Link: https://togithub.com/googleapis/synthtool/commit/cbe010084fc59dc15730c86e9b8e03ddac1de050 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/sync-repo-settings.yaml | 3 +-- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++-- .kokoro/build.sh | 3 ++- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b8ef92bef8..47a70ea40c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:c33bd13e1eab022b0499a3afbfb4b93ae10cb8ad89d8203a6343a88b1b78400f -# created: 2023-06-21T18:48:32.287298785Z + digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 +# created: 2023-06-22T15:06:52.039318836Z diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6450eab87e..44943036ef 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -8,8 +8,7 @@ branchProtectionRules: requiresCodeOwnerReviews: true requiresStrictStatusChecks: false requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) + - dependencies (17) - lint - clirr - units (8) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3bb26e377..65436cde41 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [11, 17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -36,6 +36,28 @@ jobs: - run: .kokoro/build.sh env: JOB_TYPE: test + units-java8: + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: zulu + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: zulu + - run: .kokoro/build.sh + env: + JOB_TYPE: test windows: runs-on: windows-latest steps: @@ -54,7 +76,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index c1c6a48ff7..05af1e71fb 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,7 +47,8 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} RETURN_CODE=$? ;; lint) From 035addee1f735d484947014bd626cb6eb7f32dd4 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 27 Jun 2023 11:25:06 -0400 Subject: [PATCH 04/11] ci: Java 17 profile to run tests with old Mockito (#1343) --- pom.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pom.xml b/pom.xml index bc759f609c..0116dba3ea 100644 --- a/pom.xml +++ b/pom.xml @@ -264,5 +264,35 @@ com/google/cloud/firestore/v1/package-info.java + + + + java17 + + [17,) + + + !jvm + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.lang=ALL-UNNAMED + + + + + From 2db92ccf90f475e5b6b9bb44ee2881e39173b489 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 12:45:40 -0400 Subject: [PATCH 05/11] ci: javadoc job (JDK 17) in ci.yaml (#1819) (#1346) This also changes the JDK distribution from zulu to temurin https://github.com/actions/setup-java#eclipse-temurin Source-Link: https://github.com/googleapis/synthtool/commit/ef9fe2ef6d92c7ff967d9d4f704035b3f5c9051d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:31c8276a1bfb43766597d32645721c029cb94571f1b8d996cb2c290744fe52f9 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/workflows/ci.yaml | 26 +++++++++++++++++++------- .github/workflows/samples.yaml | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 47a70ea40c..258389d1aa 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 -# created: 2023-06-22T15:06:52.039318836Z + digest: sha256:31c8276a1bfb43766597d32645721c029cb94571f1b8d996cb2c290744fe52f9 +# created: 2023-06-27T18:51:58.922150125Z diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65436cde41..e27b2c5756 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh @@ -45,7 +45,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 8 - distribution: zulu + distribution: temurin - name: "Set jvm system property environment variable for surefire plugin (unit tests)" # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm @@ -54,7 +54,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 17 - distribution: zulu + distribution: temurin - run: .kokoro/build.sh env: JOB_TYPE: test @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -81,17 +81,29 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh + javadoc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 11 - run: java -version - run: .kokoro/build.sh @@ -103,7 +115,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.sh diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index 912ed8b2b0..10d252d775 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check From 541240e87cdafdaa39c8228694d640a50307d5d3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Jun 2023 21:02:13 +0200 Subject: [PATCH 06/11] chore(deps): update dependency com.google.cloud:libraries-bom to v26.18.0 (#1347) 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:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.17.0` -> `26.18.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.18.0/compatibility-slim/26.17.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.18.0/confidence-slim/26.17.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-cloud-bom (com.google.cloud:libraries-bom) ### [`v26.18.0`](https://togithub.com/googleapis/java-cloud-bom/blob/HEAD/CHANGELOG.md#​26180-httpsgithubcomgoogleapisjava-cloud-bomcomparev26170v26180-2023-06-28) ##### Dependencies - update dependency com.google.cloud:first-party-dependencies to v3.12.0 ([#​6057](https://togithub.com/googleapis/java-cloud-bom/issues/6057)) ([4c52805](https://togithub.com/googleapis/java-cloud-bom/commit/4c52805563963c5f03d75542d83a86785ddde2eb)) - update dependency com.google.cloud:gapic-libraries-bom to v1.14.0 ([#​6067](https://togithub.com/googleapis/java-cloud-bom/issues/6067)) ([2ba5fb8](https://togithub.com/googleapis/java-cloud-bom/commit/2ba5fb8a1a5de8ab5f925313e68128cb914b5e6b)) - update dependency com.google.cloud:google-cloud-bigquery to v2.29.0 ([#​6051](https://togithub.com/googleapis/java-cloud-bom/issues/6051)) ([f0e719c](https://togithub.com/googleapis/java-cloud-bom/commit/f0e719cbe972e09a9b75d0f5841122518123248a)) - update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.39.1 ([#​6058](https://togithub.com/googleapis/java-cloud-bom/issues/6058)) ([795e555](https://togithub.com/googleapis/java-cloud-bom/commit/795e5550a97e9724bfc777a7295e962ea6ebedf5)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.24.1 ([#​6076](https://togithub.com/googleapis/java-cloud-bom/issues/6076)) ([47b8b96](https://togithub.com/googleapis/java-cloud-bom/commit/47b8b96e0660434628cdcdd68ea9b66d38bf51a0)) - update dependency com.google.cloud:google-cloud-datastore-bom to v2.16.0 ([#​6066](https://togithub.com/googleapis/java-cloud-bom/issues/6066)) ([4b3b665](https://togithub.com/googleapis/java-cloud-bom/commit/4b3b66506c4f7ea53f790d5e95ca6f687ec2c512)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.13.2 ([#​6052](https://togithub.com/googleapis/java-cloud-bom/issues/6052)) ([dfd0068](https://togithub.com/googleapis/java-cloud-bom/commit/dfd00685d239bf5cd6613221874fcac02f0e2eaf)) - update dependency com.google.cloud:google-cloud-logging-bom to v3.15.5 ([#​6055](https://togithub.com/googleapis/java-cloud-bom/issues/6055)) ([23ba420](https://togithub.com/googleapis/java-cloud-bom/commit/23ba420a4a1eaa4baed11161871278311ff6e4dd)) - update dependency com.google.cloud:google-cloud-logging-logback to v0.130.17-alpha ([#​6061](https://togithub.com/googleapis/java-cloud-bom/issues/6061)) ([5182d43](https://togithub.com/googleapis/java-cloud-bom/commit/5182d43e53a1dfda0776f1f9559620d643bfedca)) - update dependency com.google.cloud:google-cloud-nio to v0.126.18 ([#​6060](https://togithub.com/googleapis/java-cloud-bom/issues/6060)) ([9bbf047](https://togithub.com/googleapis/java-cloud-bom/commit/9bbf047c93ca1f6929e79eb5ceee29f2f0acb9d2)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.15 ([#​6059](https://togithub.com/googleapis/java-cloud-bom/issues/6059)) ([7d5eecd](https://togithub.com/googleapis/java-cloud-bom/commit/7d5eecda25b4270dfe0add8adabc277f8d6c5a6e)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.16 ([#​6070](https://togithub.com/googleapis/java-cloud-bom/issues/6070)) ([9a627d4](https://togithub.com/googleapis/java-cloud-bom/commit/9a627d49381dd10304965ad080d270e66650965a)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.17 ([#​6073](https://togithub.com/googleapis/java-cloud-bom/issues/6073)) ([3f3a096](https://togithub.com/googleapis/java-cloud-bom/commit/3f3a0967049de9f401afa6c4cb5c306fe7dd7025)) - update dependency com.google.cloud:google-cloud-pubsublite-bom to v1.12.10 ([#​6077](https://togithub.com/googleapis/java-cloud-bom/issues/6077)) ([8ef9b9c](https://togithub.com/googleapis/java-cloud-bom/commit/8ef9b9c773052a9d9a3d07f4877e0a31213417f6)) - update dependency com.google.cloud:google-cloud-pubsublite-bom to v1.12.9 ([#​6065](https://togithub.com/googleapis/java-cloud-bom/issues/6065)) ([d1005e9](https://togithub.com/googleapis/java-cloud-bom/commit/d1005e9b3c4ffa21ceead5e923e020935f1eaa58)) - update dependency com.google.cloud:google-cloud-spanner-bom to v6.43.1 ([#​6071](https://togithub.com/googleapis/java-cloud-bom/issues/6071)) ([9e51be0](https://togithub.com/googleapis/java-cloud-bom/commit/9e51be059519912d5703288efedfa02d876fee06)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.11.1 ([#​6072](https://togithub.com/googleapis/java-cloud-bom/issues/6072)) ([05565e8](https://togithub.com/googleapis/java-cloud-bom/commit/05565e8ead5f86451bdcc911953219fa9e18ca57)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.11.2 ([#​6074](https://togithub.com/googleapis/java-cloud-bom/issues/6074)) ([236016b](https://togithub.com/googleapis/java-cloud-bom/commit/236016bf309a9e4e1d657d58cf19608ec4b06a05)) - update dependency com.google.cloud:google-cloud-storage-bom to v2.22.5 ([#​6064](https://togithub.com/googleapis/java-cloud-bom/issues/6064)) ([2315aeb](https://togithub.com/googleapis/java-cloud-bom/commit/2315aeb00346bb56a26d53178917f17df7644525)) - update dependency com.google.cloud.tools:dependencies to v1.5.13 ([#​6046](https://togithub.com/googleapis/java-cloud-bom/issues/6046)) ([72382c3](https://togithub.com/googleapis/java-cloud-bom/commit/72382c3db2833da664363bc9cbdea9f22fe60c19))
--- ### 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/java-firestore). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 158cebe09d..0465ada23d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.17.0 + 26.18.0 pom import @@ -50,7 +50,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.17.0') +implementation platform('com.google.cloud:libraries-bom:26.18.0') implementation 'com.google.cloud:google-cloud-firestore' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 0e02a3f65a..4c706cd725 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -32,7 +32,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> com.google.cloud libraries-bom - 26.17.0 + 26.18.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bfd7e4474f..331046ad9c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -34,7 +34,7 @@ com.google.cloud libraries-bom - 26.17.0 + 26.18.0 pom import From 0b4180e0dd44454ba1bfe69941f8a1ac88eef80d Mon Sep 17 00:00:00 2001 From: Tom Andersen Date: Tue, 4 Jul 2023 10:00:48 -0400 Subject: [PATCH 07/11] test: Upgrade Mockito to 4.11.0 (#1345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mockito 4 * Replaced old class with new class * format * Make Mockito lenient (no failure, even if mock never used). * Make Mockito lenient (no failure, even if mock never used). * Fix test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Remove unused mock * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Static import for simpler code. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Tomo Suzuki Co-authored-by: Owl Bot --- google-cloud-firestore/pom.xml | 4 +- .../firestore/AggregateQuerySnapshotTest.java | 2 +- .../cloud/firestore/AggregateQueryTest.java | 2 +- .../cloud/firestore/BulkWriterTest.java | 29 +-- .../firestore/CollectionReferenceTest.java | 7 +- .../cloud/firestore/ConformanceTest.java | 36 ++-- .../firestore/DocumentReferenceTest.java | 113 ++++++---- .../cloud/firestore/FirestoreBundleTest.java | 2 +- .../google/cloud/firestore/FirestoreTest.java | 16 +- .../cloud/firestore/LocalFirestoreHelper.java | 5 +- .../google/cloud/firestore/MapperTest.java | 14 +- .../cloud/firestore/PartitionQuery.java | 15 +- .../cloud/firestore/QueryCountTest.java | 81 ++----- .../com/google/cloud/firestore/QueryTest.java | 202 ++++-------------- .../cloud/firestore/RateLimiterTest.java | 2 +- .../cloud/firestore/RecursiveDeleteTest.java | 35 +-- .../google/cloud/firestore/ToStringTest.java | 2 +- .../cloud/firestore/TransactionTest.java | 86 +++++--- .../com/google/cloud/firestore/WatchTest.java | 12 +- .../cloud/firestore/WriteBatchTest.java | 34 +-- 20 files changed, 301 insertions(+), 398 deletions(-) diff --git a/google-cloud-firestore/pom.xml b/google-cloud-firestore/pom.xml index 2fde07ac17..ddead074a0 100644 --- a/google-cloud-firestore/pom.xml +++ b/google-cloud-firestore/pom.xml @@ -131,8 +131,8 @@
org.mockito - mockito-all - 1.10.19 + mockito-core + 4.11.0 test diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQuerySnapshotTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQuerySnapshotTest.java index d500cad2f9..a7f5864285 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQuerySnapshotTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQuerySnapshotTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class AggregateQuerySnapshotTest { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQueryTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQueryTest.java index e8baa9e0d8..d7e5134740 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQueryTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/AggregateQueryTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class AggregateQueryTest { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java index 202809188b..c8f8875f92 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java @@ -26,8 +26,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.*; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; @@ -65,11 +64,11 @@ import org.junit.rules.Timeout; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class BulkWriterTest { @@ -153,7 +152,7 @@ public static ApiFuture mergeResponses( @Before public void before() { - doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); + lenient().doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); testExecutor = Executors.newSingleThreadScheduledExecutor(); final ScheduledExecutorService timeoutExecutor = @@ -1011,7 +1010,7 @@ public void flushSucceedsEvenIfBulkCommitFails() throws Exception { .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.set(doc2, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.flush().get(); @@ -1023,7 +1022,7 @@ public void closeSucceedsEvenIfBulkCommitFails() throws Exception { .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.set(doc2, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.close(); @@ -1035,7 +1034,7 @@ public void individualWritesErrorIfBulkCommitFails() throws Exception { .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); int opCount = 0; ApiFuture result1 = bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); ApiFuture result2 = bulkWriter.set(doc2, LocalFirestoreHelper.SINGLE_FIELD_MAP); @@ -1058,7 +1057,7 @@ public void individualWritesErrorIfBulkCommitFailsWithNonFirestoreException() th .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); int opCount = 0; ApiFuture result1 = bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); ApiFuture result2 = bulkWriter.set(doc2, LocalFirestoreHelper.SINGLE_FIELD_MAP); @@ -1086,7 +1085,7 @@ public void retriesWritesWhenBatchWriteFailsWithRetryableError() throws Exceptio .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); ApiFuture result = bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.close(); @@ -1125,7 +1124,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); bulkWriter = firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(timeoutExecutor).build()); @@ -1175,7 +1174,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); bulkWriter = firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(timeoutExecutor).build()); @@ -1325,7 +1324,8 @@ public void cannotSetThrottlingOptionsWithThrottlingDisabled() throws Exception } catch (Exception e) { assertEquals( e.getMessage(), - "Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set to false."); + "Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set to" + + " false."); } try { @@ -1335,7 +1335,8 @@ public void cannotSetThrottlingOptionsWithThrottlingDisabled() throws Exception } catch (Exception e) { assertEquals( e.getMessage(), - "Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set to false."); + "Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set to" + + " false."); } } diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/CollectionReferenceTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/CollectionReferenceTest.java index 0ede445461..9e22b40a74 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/CollectionReferenceTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/CollectionReferenceTest.java @@ -31,11 +31,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class CollectionReferenceTest { @@ -94,7 +94,8 @@ public void addDocument() throws Exception { doReturn(LocalFirestoreHelper.SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - argCaptor.capture(), Matchers.>any()); + argCaptor.capture(), + ArgumentMatchers.>any()); ApiFuture future = collectionReference.add(LocalFirestoreHelper.SINGLE_FIELD_MAP); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java index dd5b215950..8b759e10da 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java @@ -25,6 +25,7 @@ import static com.google.cloud.firestore.LocalFirestoreHelper.getAllResponse; import static com.google.cloud.firestore.LocalFirestoreHelper.queryResponse; import static com.google.cloud.firestore.UserDataConverter.NO_DELETES; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; @@ -32,11 +33,8 @@ import com.google.api.core.ApiFuture; import com.google.api.core.SettableApiFuture; import com.google.api.gax.rpc.BidiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientStream; import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.Timestamp; import com.google.cloud.conformance.ConformanceTestLocator; import com.google.cloud.conformance.ConformanceTestLocator.MatchPattern; @@ -87,7 +85,6 @@ import org.junit.runners.AllTests; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; @@ -123,9 +120,7 @@ private static List initTests(TestDefinition.TestFile testSuite) { || excludedTests.contains(testDefinition.getDescription())) { continue; } - final Test test = buildTest(testDefinition); - MockitoAnnotations.initMocks(test); - tests.add(test); + tests.add(buildTest(testDefinition)); } return tests; @@ -223,7 +218,9 @@ public final void run(TestResult testResult) { if (DEBUG_MODE) { System.out.printf(DEBUG_MESSAGE_FORMAT, description, testParameters); } - runTest(); + try (AutoCloseable mocks = MockitoAnnotations.openMocks(this)) { + runTest(); + } }); testResult.endTest(this); } @@ -261,10 +258,7 @@ private ConformanceGetTestRunner(String description, GetTest testParameters) { public void runTest() throws Throwable { doAnswer(getAllResponse(Collections.emptyMap())) .when(firestore) - .streamRequest( - getAllCapture.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(getAllCapture.capture(), streamObserverCapture.capture(), any()); document(testParameters.getDocRefPath()).get().get(); @@ -288,7 +282,7 @@ private ConformanceCreateTestRunner(String description, CreateTest testParameter public void runTest() { doReturn(commitResponse(testParameters.getRequest().getWritesCount(), 0)) .when(firestore) - .sendRequest(commitCapture.capture(), Matchers.>any()); + .sendRequest(commitCapture.capture(), any()); try { ApiFuture apiCall = @@ -319,7 +313,7 @@ private ConformanceSetTestRunner(String description, SetTest testParameters) { public void runTest() { doReturn(commitResponse(testParameters.getRequest().getWritesCount(), 0)) .when(firestore) - .sendRequest(commitCapture.capture(), Matchers.>any()); + .sendRequest(commitCapture.capture(), any()); ApiFuture apiCall; try { @@ -364,7 +358,7 @@ private ConformanceUpdateTestRunner(String description, UpdateTest testParameter public void runTest() { doReturn(commitResponse(testParameters.getRequest().getWritesCount(), 0)) .when(firestore) - .sendRequest(commitCapture.capture(), Matchers.>any()); + .sendRequest(commitCapture.capture(), any()); try { ApiFuture apiCall; @@ -405,7 +399,7 @@ private ConformanceUpdatePathsTestRunner(String description, UpdatePathsTest tes public void runTest() { doReturn(commitResponse(testParameters.getRequest().getWritesCount(), 0)) .when(firestore) - .sendRequest(commitCapture.capture(), Matchers.>any()); + .sendRequest(commitCapture.capture(), any()); try { ApiFuture apiCall; @@ -461,7 +455,7 @@ private ConformanceDeleteTestRunner(String description, DeleteTest testParameter public void runTest() throws Throwable { doReturn(commitResponse(0, testParameters.getRequest().getWritesCount())) .when(firestore) - .sendRequest(commitCapture.capture(), Matchers.>any()); + .sendRequest(commitCapture.capture(), any()); if (!testParameters.hasPrecondition()) { document(testParameters.getDocRefPath()).delete().get(); @@ -491,10 +485,7 @@ private ConformanceQueryTestRunner( public void runTest() { doAnswer(queryResponse()) .when(firestore) - .streamRequest( - runQueryCapture.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQueryCapture.capture(), streamObserverCapture.capture(), any()); Query query = collection(testParameters.getCollPath()); @@ -646,8 +637,7 @@ public void runTest() throws Throwable { return noOpRequestObserver; }) .when(firestore) - .streamRequest( - streamObserverCapture.capture(), Matchers.any(BidiStreamingCallable.class)); + .streamRequest(streamObserverCapture.capture(), any()); final List expectedSnapshots = new ArrayList<>(testParameters.getSnapshotsList()); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/DocumentReferenceTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/DocumentReferenceTest.java index aecc8b6bea..7d982b86c6 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/DocumentReferenceTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/DocumentReferenceTest.java @@ -92,11 +92,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class DocumentReferenceTest { @@ -149,7 +149,8 @@ public void serializeBasicTypes() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(ALL_SUPPORTED_TYPES_MAP).get(); documentReference.set(ALL_SUPPORTED_TYPES_OBJECT).get(); @@ -164,7 +165,8 @@ public void serializeDocumentReference() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(map("docRef", documentReference)).get(); @@ -183,19 +185,22 @@ public void doesNotSerializeAdvancedNumberTypes() { pojo.bigIntegerValue = new BigInteger("0"); expectedErrorMessages.put( pojo, - "Could not serialize object. Numbers of type BigInteger are not supported, please use an int, long, float, double or BigDecimal (found in field 'bigIntegerValue')"); + "Could not serialize object. Numbers of type BigInteger are not supported, please use an" + + " int, long, float, double or BigDecimal (found in field 'bigIntegerValue')"); pojo = new InvalidPOJO(); pojo.byteValue = 0; expectedErrorMessages.put( pojo, - "Could not serialize object. Numbers of type Byte are not supported, please use an int, long, float, double or BigDecimal (found in field 'byteValue')"); + "Could not serialize object. Numbers of type Byte are not supported, please use an int," + + " long, float, double or BigDecimal (found in field 'byteValue')"); pojo = new InvalidPOJO(); pojo.shortValue = 0; expectedErrorMessages.put( pojo, - "Could not serialize object. Numbers of type Short are not supported, please use an int, long, float, double or BigDecimal (found in field 'shortValue')"); + "Could not serialize object. Numbers of type Short are not supported, please use an int," + + " long, float, double or BigDecimal (found in field 'shortValue')"); for (Map.Entry testCase : expectedErrorMessages.entrySet()) { try { @@ -214,7 +219,7 @@ public void deserializeBasicTypes() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); assertEquals(snapshot.getData(), ALL_SUPPORTED_TYPES_MAP); @@ -271,7 +276,7 @@ public void deserializeDocumentReference() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); assertEquals(documentReference, snapshot.getData().get("docRef")); @@ -285,7 +290,7 @@ public void getFieldWithFieldMask() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get(FieldMask.of(FieldPath.of("foo"))).get(); assertEquals("foo", getAllCapture.getValue().getMask().getFieldPaths(0)); assertEquals("bar", snapshot.get("foo")); @@ -298,7 +303,7 @@ public void deserializesDates() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); @@ -323,7 +328,7 @@ public void doesNotDeserializeAdvancedNumberTypes() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); try { @@ -332,7 +337,8 @@ public void doesNotDeserializeAdvancedNumberTypes() throws Exception { } catch (RuntimeException e) { assertEquals( String.format( - "Could not deserialize object. Deserializing values to %s is not supported (found in field '%s')", + "Could not deserialize object. Deserializing values to %s is not supported (found" + + " in field '%s')", typeName, fieldName), e.getMessage()); } @@ -355,7 +361,7 @@ public void notFound() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); assertEquals(documentReference, snapshot.getReference()); @@ -369,7 +375,8 @@ public void deleteDocument() throws Exception { doReturn(SINGLE_DELETE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.delete().get(); documentReference @@ -390,7 +397,8 @@ public void createDocument() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.create(SINGLE_FIELD_MAP).get(); documentReference.create(SINGLE_FIELD_OBJECT).get(); @@ -407,7 +415,8 @@ public void createWithServerTimestamp() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.create(LocalFirestoreHelper.SERVER_TIMESTAMP_MAP).get(); documentReference.create(LocalFirestoreHelper.SERVER_TIMESTAMP_OBJECT).get(); @@ -427,7 +436,8 @@ public void setWithServerTimestamp() throws Exception { doReturn(FIELD_TRANSFORM_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(LocalFirestoreHelper.SERVER_TIMESTAMP_MAP).get(); documentReference.set(LocalFirestoreHelper.SERVER_TIMESTAMP_OBJECT).get(); @@ -447,7 +457,8 @@ public void updateWithServerTimestamp() throws Exception { doReturn(FIELD_TRANSFORM_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update(LocalFirestoreHelper.SERVER_TIMESTAMP_MAP).get(); @@ -474,7 +485,8 @@ public void mergeWithServerTimestamps() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference .set(LocalFirestoreHelper.SERVER_TIMESTAMP_MAP, SetOptions.mergeFields("inner.bar")) @@ -498,7 +510,8 @@ public void setWithIncrement() throws Exception { doReturn(FIELD_TRANSFORM_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference .set(map("integer", FieldValue.increment(1), "double", FieldValue.increment(1.1))) @@ -522,7 +535,8 @@ public void setWithArrayUnion() throws Exception { doReturn(FIELD_TRANSFORM_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(map("foo", FieldValue.arrayUnion("bar", map("foo", "baz")))).get(); @@ -540,7 +554,8 @@ public void setWithArrayRemove() throws Exception { doReturn(FIELD_TRANSFORM_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(map("foo", FieldValue.arrayRemove("bar", map("foo", "baz")))).get(); @@ -688,7 +703,8 @@ public void setDocumentWithMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(SINGLE_FIELD_MAP, SetOptions.merge()).get(); documentReference.set(SINGLE_FIELD_OBJECT, SetOptions.merge()).get(); @@ -714,7 +730,8 @@ public void setDocumentWithEmptyMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(map(), SetOptions.merge()).get(); @@ -727,7 +744,8 @@ public void setDocumentWithNestedMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(NESTED_CLASS_OBJECT, SetOptions.mergeFields("first.foo")).get(); documentReference @@ -756,7 +774,8 @@ public void setMultipleFieldsWithMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference .set( @@ -784,7 +803,8 @@ public void setNestedMapWithMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(NESTED_CLASS_OBJECT, SetOptions.mergeFields("first", "second")).get(); @@ -804,7 +824,8 @@ public void mergeWithDotsInFieldName() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference .set( @@ -828,7 +849,8 @@ public void extractFieldMaskFromMerge() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.set(NESTED_CLASS_OBJECT, SetOptions.merge()).get(); @@ -868,7 +890,8 @@ public void updateDocument() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update(SINGLE_FIELD_MAP); documentReference.update("foo", "bar").get(); @@ -886,7 +909,8 @@ public void updateWithDotsInFieldName() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update(map("a.b.c", map("d.e", "foo"))).get(); @@ -910,7 +934,8 @@ public void updateNestedMap() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update("a.b", "foo", "a.c", FieldValue.delete()).get(); @@ -961,7 +986,8 @@ public void deleteField() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update("foo", "bar", "bar.foo", FieldValue.delete()).get(); @@ -981,7 +1007,8 @@ public void updateNestedDocument() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); Map nestedObject = new HashMap<>(); nestedObject.put("a", "b"); @@ -1005,7 +1032,8 @@ public void updateDocumentWithTwoFields() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update("a", "b", "c", "d").get(); @@ -1027,7 +1055,8 @@ public void updateDocumentWithPreconditions() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); Precondition options = Precondition.updatedAt(Timestamp.ofTimeSecondsAndNanos(479978400, 123000000)); @@ -1052,7 +1081,8 @@ public void updateIndividualPojo() throws ExecutionException, InterruptedExcepti doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); documentReference.update(UPDATED_POJO); documentReference.update(UPDATED_POJO).get(); CommitRequest expectedCommit = @@ -1068,7 +1098,8 @@ public void deleteNestedFieldUsingFieldPath() throws Exception { doReturn(SINGLE_WRITE_COMMIT_RESPONSE) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); FieldPath path = FieldPath.of("a.b", "c.d"); documentReference.update(path, FieldValue.delete()).get(); CommitRequest expectedCommit = @@ -1097,7 +1128,7 @@ public void deserializeCustomList() throws ExecutionException, InterruptedExcept .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); LocalFirestoreHelper.CustomList customList = snapshot.toObject(LocalFirestoreHelper.CustomList.class); @@ -1129,7 +1160,7 @@ public void deserializeCustomMap() throws ExecutionException, InterruptedExcepti .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentSnapshot snapshot = documentReference.get().get(); LocalFirestoreHelper.CustomMap customMap = snapshot.toObject(LocalFirestoreHelper.CustomMap.class); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreBundleTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreBundleTest.java index 28ff1d7105..780bbd6981 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreBundleTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreBundleTest.java @@ -46,7 +46,7 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class FirestoreBundleTest { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java index 9d685022d9..d4df6220b4 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java @@ -47,11 +47,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class FirestoreTest { @@ -85,7 +85,7 @@ public void illegalFieldPath() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentReference doc = firestoreMock.document("coll/doc"); DocumentSnapshot snapshot = doc.get().get(); @@ -116,7 +116,7 @@ public void getAll() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentReference doc1 = firestoreMock.document("coll/doc1"); DocumentReference doc2 = firestoreMock.document("coll/doc2"); @@ -137,7 +137,7 @@ public void getAllWithFieldMask() throws Exception { .streamRequest( getAllCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); DocumentReference doc1 = firestoreMock.document("coll/doc1"); FieldMask fieldMask = FieldMask.of(FieldPath.of("foo", "bar")); @@ -190,7 +190,8 @@ public void arrayUnionWithPojo() throws ExecutionException, InterruptedException doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); DocumentReference doc = firestoreMock.document("coll/doc"); doc.update("array", FieldValue.arrayUnion(SINGLE_FIELD_OBJECT)).get(); @@ -208,7 +209,8 @@ public void arrayRemoveWithPojo() throws ExecutionException, InterruptedExceptio doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); DocumentReference doc = firestoreMock.document("coll/doc"); doc.update("array", FieldValue.arrayRemove(SINGLE_FIELD_OBJECT)).get(); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java index b3774224e4..896a51e3af 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java @@ -86,7 +86,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; import org.mockito.ArgumentCaptor; -import org.mockito.Matchers; +import org.mockito.ArgumentMatchers; import org.mockito.stubbing.Answer; import org.mockito.stubbing.Stubber; import org.threeten.bp.Duration; @@ -1203,7 +1203,8 @@ void initializeStub( Preconditions.checkNotNull(stubber, "Stubber should not be null"); stubber .when(firestoreMock) - .sendRequest(argumentCaptor.capture(), Matchers.>any()); + .sendRequest( + argumentCaptor.capture(), ArgumentMatchers.>any()); } public void verifyAllRequestsSent() { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/MapperTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/MapperTest.java index e3725127e0..5ea6cd84f9 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/MapperTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/MapperTest.java @@ -48,7 +48,7 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @SuppressWarnings({"unused", "WeakerAccess", "SpellCheckingInspection"}) @RunWith(MockitoJUnitRunner.class) @@ -1850,7 +1850,8 @@ public void shortsCantBeSerialized() { final ShortBean bean = new ShortBean(); bean.value = 1; assertExceptionContains( - "Numbers of type Short are not supported, please use an int, long, float, double or BigDecimal (found in field 'value')", + "Numbers of type Short are not supported, please use an int, long, float, double or" + + " BigDecimal (found in field 'value')", () -> serialize(bean)); } @@ -1859,7 +1860,8 @@ public void bytesCantBeSerialized() { final ByteBean bean = new ByteBean(); bean.value = 1; assertExceptionContains( - "Numbers of type Byte are not supported, please use an int, long, float, double or BigDecimal (found in field 'value')", + "Numbers of type Byte are not supported, please use an int, long, float, double or" + + " BigDecimal (found in field 'value')", () -> serialize(bean)); } @@ -2193,14 +2195,16 @@ public void enumsAreSerialized() { bean.pathologicalEnum = PathologicalEnum.One; bean.setEnumValue(SimpleEnum.Foo); assertJson( - "{'enumField': 'Bar', 'enumValue': 'Foo', 'complexEnum': 'One', 'enumUsingPropertyName': 'Three', 'pathologicalEnum': 'Two'}", + "{'enumField': 'Bar', 'enumValue': 'Foo', 'complexEnum': 'One', 'enumUsingPropertyName':" + + " 'Three', 'pathologicalEnum': 'Two'}", serialize(bean)); } @Test public void enumsAreParsed() { String json = - "{'enumField': 'Bar', 'enumValue': 'Foo', 'complexEnum': 'One', 'enumUsingPropertyName': 'Three', 'pathologicalEnum': 'Two'}"; + "{'enumField': 'Bar', 'enumValue': 'Foo', 'complexEnum': 'One', 'enumUsingPropertyName':" + + " 'Three', 'pathologicalEnum': 'Two'}"; EnumBean bean = deserialize(json, EnumBean.class); assertEquals(bean.enumField, SimpleEnum.Bar); assertEquals(bean.enumValue, SimpleEnum.Foo); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PartitionQuery.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PartitionQuery.java index 04203313be..4478ea9c97 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PartitionQuery.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PartitionQuery.java @@ -43,12 +43,12 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class PartitionQuery { @@ -109,7 +109,8 @@ public void requestsOneLessThanDesired() throws Exception { .when(firestoreMock) .sendRequest( requestCaptor.capture(), - Matchers.>any()); + ArgumentMatchers + .>any()); firestoreMock.collectionGroup("collectionId").getPartitions(desiredPartitionsCount).get(); @@ -153,14 +154,15 @@ public void convertsPartitionsToQueries() throws Exception { .when(firestoreMock) .sendRequest( requestCaptor.capture(), - Matchers.>any()); + ArgumentMatchers + .>any()); doAnswer(queryResponse()) .when(firestoreMock) .streamRequest( runQuery.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); List partitions = firestoreMock.collectionGroup("collectionId").getPartitions(desiredPartitionsCount).get(); @@ -193,7 +195,8 @@ public void sortsPartitions() throws Exception { .when(firestoreMock) .sendRequest( requestCaptor.capture(), - Matchers.>any()); + ArgumentMatchers + .>any()); List partitions = firestoreMock.collectionGroup("collectionId").getPartitions(desiredPartitionsCount).get(); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryCountTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryCountTest.java index ea9dad975f..3cf05648e3 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryCountTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryCountTest.java @@ -28,6 +28,7 @@ import static com.google.cloud.firestore.LocalFirestoreHelper.string; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -35,7 +36,6 @@ import com.google.api.core.ApiClock; import com.google.api.core.ApiFuture; import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.cloud.Timestamp; import com.google.cloud.firestore.spi.v1.FirestoreRpc; import com.google.firestore.v1.RunAggregationQueryRequest; @@ -49,9 +49,8 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.threeten.bp.Duration; @RunWith(MockitoJUnitRunner.class) @@ -80,10 +79,7 @@ public void before() { public void countShouldBeZeroForEmptyCollection() throws Exception { doAnswer(aggregationQueryResponse(0)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuerySnapshot snapshot = query.count().get().get(); @@ -94,10 +90,7 @@ public void countShouldBeZeroForEmptyCollection() throws Exception { public void countShouldBe99ForCollectionWith99Documents() throws Exception { doAnswer(aggregationQueryResponse(99)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuerySnapshot snapshot = query.count().get().get(); @@ -108,10 +101,7 @@ public void countShouldBe99ForCollectionWith99Documents() throws Exception { public void countShouldMakeCorrectRequestForACollection() throws Exception { doAnswer(aggregationQueryResponse(0)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); CollectionReference collection = firestoreMock.collection(COLLECTION_ID); collection.count().get(); @@ -123,10 +113,7 @@ public void countShouldMakeCorrectRequestForACollection() throws Exception { public void countShouldMakeCorrectRequestForAComplexQuery() throws Exception { doAnswer(aggregationQueryResponse(0)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").startAt("foo").endAt("bar").limitToLast(42).count().get().get(); @@ -144,10 +131,7 @@ public void countShouldMakeCorrectRequestForAComplexQuery() throws Exception { public void shouldReturnReadTimeFromResponse() throws Exception { doAnswer(aggregationQueryResponse(99, Timestamp.ofTimeSecondsAndNanos(123, 456))) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuerySnapshot snapshot = query.count().get().get(); @@ -158,10 +142,7 @@ public void shouldReturnReadTimeFromResponse() throws Exception { public void shouldIgnoreExtraRunAggregationQueryResponses() throws Exception { doAnswer(aggregationQueryResponses(123, 456)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuerySnapshot snapshot = query.count().get().get(); @@ -172,10 +153,7 @@ public void shouldIgnoreExtraRunAggregationQueryResponses() throws Exception { public void shouldIgnoreExtraErrors() throws Exception { doAnswer(aggregationQueryResponses(123, new Exception())) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuerySnapshot snapshot = query.count().get().get(); @@ -187,10 +165,7 @@ public void shouldPropagateErrors() throws Exception { Exception exception = new Exception(); doAnswer(aggregationQueryResponse(exception)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); ExecutionException executionException = assertThrows(ExecutionException.class, future::get); @@ -207,10 +182,7 @@ public void aggregateQueryGetQueryShouldReturnCorrectValue() throws Exception { public void aggregateQuerySnapshotGetQueryShouldReturnCorrectValue() throws Exception { doAnswer(aggregationQueryResponse()) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); AggregateQuery aggregateQuery = query.count(); AggregateQuerySnapshot snapshot = aggregateQuery.get().get(); @@ -223,10 +195,7 @@ public void shouldNotRetryIfExceptionIsNotFirestoreException() { doAnswer(aggregationQueryResponse(new NotFirestoreException())) .doAnswer(aggregationQueryResponse()) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); @@ -238,10 +207,7 @@ public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatus() thro doAnswer(aggregationQueryResponse(new FirestoreException("reason", Status.INTERNAL))) .doAnswer(aggregationQueryResponse(42)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); AggregateQuerySnapshot snapshot = future.get(); @@ -251,14 +217,10 @@ public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatus() thro @Test public void shouldNotRetryIfExceptionIsFirestoreExceptionWithNonRetryableStatus() { - doReturn(Duration.ZERO).when(firestoreMock).getTotalRequestTimeout(); doAnswer(aggregationQueryResponse(new FirestoreException("reason", Status.INVALID_ARGUMENT))) .doAnswer(aggregationQueryResponse()) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); @@ -273,10 +235,7 @@ public void shouldNotRetryIfExceptionIsFirestoreExceptionWithNonRetryableStatus( doAnswer(aggregationQueryResponse(new FirestoreException("reason", Status.INTERNAL))) .doAnswer(aggregationQueryResponse(42)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); AggregateQuerySnapshot snapshot = future.get(); @@ -291,10 +250,7 @@ public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatusWithinT doAnswer(aggregationQueryResponse(new FirestoreException("reason", Status.INTERNAL))) .doAnswer(aggregationQueryResponse(42)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); AggregateQuerySnapshot snapshot = future.get(); @@ -316,10 +272,7 @@ public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatusWithinT doAnswer(aggregationQueryResponse(new FirestoreException("reason", Status.INTERNAL))) .doAnswer(aggregationQueryResponse(42)) .when(firestoreMock) - .streamRequest( - runAggregationQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runAggregationQuery.capture(), streamObserverCapture.capture(), any()); ApiFuture future = query.count().get(); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryTest.java index f1591c400f..f862b37f16 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/QueryTest.java @@ -42,13 +42,13 @@ import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import com.google.api.core.ApiClock; import com.google.api.gax.rpc.ApiStreamObserver; import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.cloud.Timestamp; import com.google.cloud.firestore.Query.ComparisonFilterInternal; import com.google.cloud.firestore.Query.FilterInternal; @@ -77,10 +77,9 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.threeten.bp.Duration; @RunWith(MockitoJUnitRunner.class) @@ -131,10 +130,7 @@ public void before() { public void withLimit() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.limit(42).get().get(); @@ -145,10 +141,7 @@ public void withLimit() throws Exception { public void limitToLastReversesOrderingConstraints() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").limitToLast(42).get().get(); @@ -160,10 +153,7 @@ public void limitToLastReversesOrderingConstraints() throws Exception { public void limitToLastReversesCursors() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").startAt("foo").endAt("bar").limitToLast(42).get().get(); @@ -180,10 +170,7 @@ public void limitToLastReversesCursors() throws Exception { public void limitToLastReversesResults() throws Exception { doAnswer(queryResponse(DOCUMENT_NAME + "2", DOCUMENT_NAME + "1")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); QuerySnapshot querySnapshot = query.orderBy("foo").limitToLast(2).get().get(); @@ -194,13 +181,6 @@ public void limitToLastReversesResults() throws Exception { @Test public void limitToLastRequiresAtLeastOneOrderingConstraint() throws Exception { - doAnswer(queryResponse()) - .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); - try { query.limitToLast(1).get().get(); fail("Expected exception"); @@ -213,13 +193,6 @@ public void limitToLastRequiresAtLeastOneOrderingConstraint() throws Exception { @Test public void limitToLastRejectsStream() { - doAnswer(queryResponse()) - .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); - try { query.orderBy("foo").limitToLast(1).stream(null); fail("Expected exception"); @@ -235,10 +208,7 @@ public void limitToLastRejectsStream() { public void withOffset() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.offset(42).get().get(); @@ -249,10 +219,7 @@ public void withOffset() throws Exception { public void withFilter() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.whereEqualTo("foo", "bar").get().get(); query.whereEqualTo("foo", null).get().get(); @@ -300,10 +267,7 @@ public void withFilter() throws Exception { public void withFieldPathFilter() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.whereEqualTo(FieldPath.of("foo"), "bar").get().get(); query.whereNotEqualTo(FieldPath.of("foo"), "bar").get().get(); @@ -339,10 +303,7 @@ public void withFieldPathFilter() throws Exception { public void withCompositeFilter() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); // a == 10 && (b==20 || c==30 || (d==40 && e>50) || f==60) query @@ -375,10 +336,7 @@ public void withCompositeFilter() throws Exception { public void inQueriesWithReferenceArray() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query .whereIn(FieldPath.documentId(), Arrays.asList("doc", firestoreMock.document("coll/doc"))) @@ -402,10 +360,7 @@ public void inQueriesWithReferenceArray() throws Exception { public void inQueriesFieldsNotUsedInOrderBy() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); // Field "foo" used in `whereIn` should not appear in implicit orderBys in the resulting query. query @@ -456,10 +411,7 @@ public void validatesInQueries() { public void notInQueriesWithReferenceArray() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query .whereNotIn( @@ -517,7 +469,8 @@ public void validatesQueryOperatorForFieldPathDocumentId() { fail(); } catch (IllegalArgumentException e) { assertEquals( - "Invalid query. You cannot perform 'ARRAY_CONTAINS_ANY' queries on FieldPath.documentId().", + "Invalid query. You cannot perform 'ARRAY_CONTAINS_ANY' queries on" + + " FieldPath.documentId().", e.getMessage()); } } @@ -526,10 +479,7 @@ public void validatesQueryOperatorForFieldPathDocumentId() { public void withDocumentIdFilter() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.whereEqualTo(FieldPath.documentId(), "doc").get().get(); @@ -543,10 +493,7 @@ public void withDocumentIdFilter() throws Exception { public void withOrderBy() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").orderBy("foo.bar", Query.Direction.DESCENDING).get().get(); @@ -561,10 +508,7 @@ public void withOrderBy() throws Exception { public void withFieldPathOrderBy() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query .orderBy(FieldPath.of("foo")) @@ -583,10 +527,7 @@ public void withFieldPathOrderBy() throws Exception { public void withSelect() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.select(new String[] {}).get().get(); query.select("foo", "foo.bar").get().get(); @@ -605,10 +546,7 @@ public void withSelect() throws Exception { public void withFieldPathSelect() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.select(new FieldPath[] {}).get().get(); query.select(FieldPath.of("foo"), FieldPath.of("foo", "bar")).get().get(); @@ -627,10 +565,7 @@ public void withFieldPathSelect() throws Exception { public void withDocumentSnapshotCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.startAt(SINGLE_FIELD_SNAPSHOT).get(); @@ -648,10 +583,7 @@ public void withDocumentSnapshotCursor() { public void withDocumentIdAndDocumentSnapshotCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy(FieldPath.documentId()).startAt(SINGLE_FIELD_SNAPSHOT).get(); @@ -669,10 +601,7 @@ public void withDocumentIdAndDocumentSnapshotCursor() { public void withDocumentReferenceCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); DocumentReference documentCursor = firestoreMock.document(DOCUMENT_PATH); Value documentValue = reference(DOCUMENT_NAME); @@ -689,10 +618,7 @@ public void withDocumentReferenceCursor() { public void withExtractedDirectionForDocumentSnapshotCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo", Query.Direction.DESCENDING).startAt(SINGLE_FIELD_SNAPSHOT).get(); @@ -712,10 +638,7 @@ public void withExtractedDirectionForDocumentSnapshotCursor() { public void withInequalityFilterForDocumentSnapshotCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query .whereEqualTo("a", "b") @@ -743,10 +666,7 @@ public void withInequalityFilterForDocumentSnapshotCursor() { public void withEqualityFilterForDocumentSnapshotCursor() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.whereEqualTo("foo", "bar").startAt(SINGLE_FIELD_SNAPSHOT).get(); @@ -765,10 +685,7 @@ public void withEqualityFilterForDocumentSnapshotCursor() { public void withStartAt() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").orderBy(FieldPath.documentId()).startAt("bar", "doc").get().get(); @@ -819,10 +736,7 @@ public void withInvalidStartAt() { public void withStartAfter() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").startAfter("bar").get().get(); @@ -836,10 +750,7 @@ public void withStartAfter() throws Exception { public void withEndBefore() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").endBefore("bar").get().get(); @@ -853,10 +764,7 @@ public void withEndBefore() throws Exception { public void withEndAt() throws Exception { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.orderBy("foo").endAt("bar").get().get(); @@ -870,10 +778,7 @@ public void withEndAt() throws Exception { public void withCollectionGroup() { doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); Query query = firestoreMock.collectionGroup(COLLECTION_ID); query = query.whereGreaterThan(FieldPath.documentId(), "coll/doc"); @@ -917,10 +822,7 @@ public void orderByWithCursor() { public void getResult() throws Exception { doAnswer(queryResponse(DOCUMENT_NAME + "1", DOCUMENT_NAME + "2")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); QuerySnapshot result = query.get().get(); @@ -965,10 +867,7 @@ public void getResult() throws Exception { public void streamResult() throws Exception { doAnswer(queryResponse(DOCUMENT_NAME + "1", DOCUMENT_NAME + "2")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); final Semaphore semaphore = new Semaphore(0); final Iterator iterator = Arrays.asList("doc1", "doc2").iterator(); @@ -1000,10 +899,7 @@ public void successfulReturnWithoutOnComplete() throws Exception { queryResponseWithDone( /* callWithoutOnComplete */ true, DOCUMENT_NAME + "1", DOCUMENT_NAME + "2")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); final Semaphore semaphore = new Semaphore(0); final Iterator iterator = Arrays.asList("doc1", "doc2").iterator(); @@ -1039,10 +935,7 @@ public void successfulReturnCallsOnCompleteTwice() throws Exception { queryResponseWithDone( /* callWithoutOnComplete */ false, DOCUMENT_NAME + "1", DOCUMENT_NAME + "2")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); final Semaphore semaphore = new Semaphore(0); final Iterator iterator = Arrays.asList("doc1", "doc2").iterator(); @@ -1093,10 +986,7 @@ public void retriesAfterRetryableError() throws Exception { } }) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); // Verify the responses final Semaphore semaphore = new Semaphore(0); @@ -1147,10 +1037,7 @@ public void doesNotRetryAfterNonRetryableError() throws Exception { DOCUMENT_NAME + "1", DOCUMENT_NAME + "2")) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); // Verify the responses final Semaphore semaphore = new Semaphore(0); @@ -1185,10 +1072,7 @@ public void onlyRetriesWhenResultSent() throws Exception { FirestoreException.forServerRejection( Status.DEADLINE_EXCEEDED, "Simulated test failure"))) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); assertThrows(ExecutionException.class, () -> query.get().get()); @@ -1217,10 +1101,7 @@ public void retriesWithoutTimeout() throws Exception { } }) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); query.get().get(); @@ -1245,10 +1126,7 @@ public void doesNotRetryWithTimeout() { .answer(invocation); }) .when(firestoreMock) - .streamRequest( - runQuery.capture(), - streamObserverCapture.capture(), - Matchers.any()); + .streamRequest(runQuery.capture(), streamObserverCapture.capture(), any()); assertThrows(ExecutionException.class, () -> query.get().get()); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RateLimiterTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RateLimiterTest.java index baf1423000..afc4874353 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RateLimiterTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RateLimiterTest.java @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class RateLimiterTest { diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java index 84713a679c..5d485c32b3 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java @@ -39,6 +39,7 @@ import static org.junit.Assert.fail; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.lenient; import com.google.api.core.ApiAsyncFunction; import com.google.api.core.ApiFuture; @@ -76,11 +77,11 @@ import org.junit.rules.Timeout; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; @RunWith(MockitoJUnitRunner.class) @@ -113,7 +114,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) @Before public void before() { - doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); + lenient().doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); final ScheduledExecutorService timeoutExecutor = new ScheduledThreadPoolExecutor(1) { @@ -167,7 +168,7 @@ private void setupMocks( .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); if (!deleteDocRef.equals("")) { childrenDocuments = new ArrayList<>(childrenDocuments); @@ -202,7 +203,7 @@ public void getAllDescendantsRootLevelCollection() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); RunQueryRequest expectedRequest = query( @@ -231,7 +232,7 @@ public void getAllDescendantsNestedCollection() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); RunQueryRequest expectedRequest = query( @@ -261,14 +262,14 @@ public void getAllDescendantsDocument() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); // Include dummy response for the deleted fullDocumentPath reference. doAnswer((Answer>) mock -> successResponse(1)) .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); RunQueryRequest expectedRequest = query( @@ -294,13 +295,13 @@ public void createsRetryQueryAfterStreamExceptionWithLastReceivedDoc() throws Ex .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); doAnswer(mock -> successResponse(1)) .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); RunQueryRequest expectedRequest = query( @@ -368,7 +369,7 @@ public void createsSecondQueryWithCorrectStartAfter() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); doAnswer( mock -> { @@ -399,7 +400,7 @@ public void createsSecondQueryWithCorrectStartAfter() throws Exception { .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); BulkWriter bulkWriter = firestoreMock.bulkWriter(); bulkWriter.setMaxBatchSize(maxBatchSize); @@ -564,12 +565,12 @@ public void exceptionThrownIfProvidedReferenceWasNotDeleted() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); doReturn(BulkWriterTest.FAILED_FUTURE) .when(firestoreMock) .sendRequest( batchWriteCapture.capture(), - Matchers.>any()); + ArgumentMatchers.>any()); ApiFuture future = firestoreMock.recursiveDelete(firestoreMock.document("root/doc")); try { @@ -604,7 +605,7 @@ public void handlesSuccessfulStreamErrorRetries() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); ResponseStubber responseStubber = new ResponseStubber() { @@ -646,7 +647,7 @@ public void handlesMultipleCallsToRecursiveDelete() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); ResponseStubber responseStubber = new ResponseStubber() { @@ -671,7 +672,7 @@ public void usesSameBulkWriterInstanceAcrossCalls() throws Exception { .streamRequest( runQueryCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); final int[] callCount = {0}; final BulkWriter bulkWriter = firestoreMock.bulkWriter(); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ToStringTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ToStringTest.java index db0843f836..9dca2518e7 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ToStringTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ToStringTest.java @@ -28,7 +28,7 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; /** @author Eran Leshem */ @RunWith(MockitoJUnitRunner.class) diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java index 7f9200222b..4c559486bc 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java @@ -77,10 +77,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @SuppressWarnings("deprecation") @RunWith(MockitoJUnitRunner.class) @@ -132,7 +132,8 @@ public void returnsValue() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -156,7 +157,8 @@ public void returnsValueAsync() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runAsyncTransaction( @@ -180,7 +182,8 @@ public void canReturnNull() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction(transaction1 -> null, options); @@ -192,7 +195,8 @@ public void canReturnNullAsync() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runAsyncTransaction(t -> ApiFutures.immediateFuture(null), options); @@ -205,7 +209,8 @@ public void rollbackOnCallbackError() { doReturn(beginResponse()) .doReturn(rollbackResponse()) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -233,7 +238,8 @@ public void rollbackOnCallbackApiFutureErrorAsync() { doReturn(beginResponse()) .doReturn(rollbackResponse()) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runAsyncTransaction( @@ -257,7 +263,8 @@ public void rollbackOnCallbackApiFutureErrorAsync() { public void noRollbackOnBeginFailure() { doReturn(ApiFutures.immediateFailedFuture(new Exception("Expected exception"))) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -282,7 +289,8 @@ public void noRollbackOnBeginFailure() { public void noRollbackOnBeginFailureAsync() { doReturn(ApiFutures.immediateFailedFuture(new Exception("Expected exception"))) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runAsyncTransaction( @@ -308,7 +316,8 @@ public void noRollbackOnThrownExceptionAsync() { doReturn(beginResponse()) .doReturn(rollbackResponse()) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runAsyncTransaction( @@ -537,11 +546,13 @@ public void getDocument() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) .when(firestoreMock) - .streamRequest(requestCapture.capture(), streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + requestCapture.capture(), streamObserverCapture.capture(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runTransaction(t -> t.get(documentReference).get(), options); @@ -561,11 +572,13 @@ public void getDocumentAsync() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) .when(firestoreMock) - .streamRequest(requestCapture.capture(), streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + requestCapture.capture(), streamObserverCapture.capture(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runAsyncTransaction(t -> t.get(documentReference), options); @@ -588,11 +601,13 @@ public void getMultipleDocuments() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) .when(firestoreMock) - .streamRequest(requestCapture.capture(), streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + requestCapture.capture(), streamObserverCapture.capture(), ArgumentMatchers.any()); ApiFuture> transaction = firestoreMock.runTransaction(t -> t.getAll(doc1, doc2).get(), options); @@ -615,14 +630,15 @@ public void getMultipleDocumentsWithFieldMask() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) .when(firestoreMock) .streamRequest( requestCapture.capture(), streamObserverCapture.capture(), - Matchers.any()); + ArgumentMatchers.any()); final DocumentReference doc1 = firestoreMock.document("coll/doc1"); final FieldMask fieldMask = FieldMask.of(FieldPath.of("foo", "bar")); @@ -652,11 +668,13 @@ public void getQuery() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(queryResponse()) .when(firestoreMock) - .streamRequest(requestCapture.capture(), streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + requestCapture.capture(), streamObserverCapture.capture(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runTransaction(t -> t.get(queryReference).get(), options); @@ -676,11 +694,13 @@ public void getAggregateQuery() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(0, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); doAnswer(aggregationQueryResponse(42)) .when(firestoreMock) - .streamRequest(requestCapture.capture(), streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + requestCapture.capture(), streamObserverCapture.capture(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runTransaction(t -> t.get(aggregateQueryReference).get(), options); @@ -700,7 +720,8 @@ public void updateDocument() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(2, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -731,7 +752,8 @@ public void setDocument() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(2, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -762,7 +784,8 @@ public void createDocument() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(2, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -793,7 +816,8 @@ public void deleteDocument() throws Exception { doReturn(beginResponse()) .doReturn(commitResponse(2, 0)) .when(firestoreMock) - .sendRequest(requestCapture.capture(), Matchers.>any()); + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -899,7 +923,9 @@ public void readWriteTransactionOptionsBuilder_errorAttemptingToSetNumAttemptsLe @Test public void getShouldThrowWhenInvokedAfterAWriteWithAQuery() throws Exception { - doReturn(beginResponse()).when(firestoreMock).sendRequest(Matchers.any(), Matchers.any()); + doReturn(beginResponse()) + .when(firestoreMock) + .sendRequest(ArgumentMatchers.any(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runTransaction( @@ -916,7 +942,9 @@ public void getShouldThrowWhenInvokedAfterAWriteWithAQuery() throws Exception { @Test public void getShouldThrowWhenInvokedAfterAWriteWithAnAggregateQuery() throws Exception { - doReturn(beginResponse()).when(firestoreMock).sendRequest(Matchers.any(), Matchers.any()); + doReturn(beginResponse()) + .when(firestoreMock) + .sendRequest(ArgumentMatchers.any(), ArgumentMatchers.any()); ApiFuture transaction = firestoreMock.runTransaction( diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java index c6545fe1a8..1627796c98 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java @@ -29,8 +29,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.*; import com.google.api.gax.grpc.GrpcStatusCode; import com.google.api.gax.rpc.BidiStreamObserver; @@ -76,11 +75,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; @RunWith(MockitoJUnitRunner.class) @@ -156,10 +155,11 @@ public void before() { closes.drainPermits(); lastSnapshot = null; - doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); + lenient().doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); doAnswer(newRequestObserver()) .when(firestoreMock) - .streamRequest(streamObserverCapture.capture(), Matchers.any()); + .streamRequest( + streamObserverCapture.capture(), ArgumentMatchers.any()); } @After diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java index 7dace68293..92ca905c79 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java @@ -43,11 +43,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class WriteBatchTest { @@ -75,7 +75,8 @@ public void updateDocument() throws Exception { doReturn(commitResponse(4, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); List preconditions = Arrays.asList( @@ -118,7 +119,8 @@ public void updateDocumentWithPOJO() throws Exception { doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch.update(documentReference, "foo", UPDATE_SINGLE_FIELD_OBJECT); assertEquals(1, batch.getMutationsSize()); @@ -137,7 +139,8 @@ public void setDocument() throws Exception { doReturn(commitResponse(4, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch .set(documentReference, LocalFirestoreHelper.SINGLE_FIELD_MAP) @@ -167,7 +170,8 @@ public void setDocumentWithValue() throws Exception { doReturn(commitResponse(4, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch .set(documentReference, LocalFirestoreHelper.SINGLE_FIELD_PROTO) @@ -197,7 +201,8 @@ public void setDocumentWithFloat() throws Exception { doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch.set(documentReference, LocalFirestoreHelper.SINGLE_FLOAT_MAP); @@ -220,7 +225,8 @@ public void omitWriteResultForDocumentTransforms() throws Exception { doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch.set(documentReference, map("time", FieldValue.serverTimestamp())); @@ -235,7 +241,8 @@ public void createDocument() throws Exception { doReturn(commitResponse(2, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch .create(documentReference, LocalFirestoreHelper.SINGLE_FIELD_MAP) @@ -260,7 +267,8 @@ public void createDocumentWithValue() throws Exception { doReturn(commitResponse(2, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch .create(documentReference, LocalFirestoreHelper.SINGLE_FIELD_PROTO) @@ -285,7 +293,8 @@ public void createDocumentWithFloat() throws Exception { doReturn(commitResponse(1, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); batch.create(documentReference, LocalFirestoreHelper.SINGLE_FLOAT_MAP); @@ -308,7 +317,8 @@ public void deleteDocument() throws Exception { doReturn(commitResponse(2, 0)) .when(firestoreMock) .sendRequest( - commitCapture.capture(), Matchers.>any()); + commitCapture.capture(), + ArgumentMatchers.>any()); List writes = new ArrayList<>(); batch.delete(documentReference); From 7ff8e0d388fe29b645f96edb00c3ec767591b6de Mon Sep 17 00:00:00 2001 From: Tom Andersen Date: Wed, 5 Jul 2023 11:43:10 -0400 Subject: [PATCH 08/11] Revert "ci: Java 17 profile to run tests with old Mockito (#1343)" (#1349) This reverts commit 035addee1f735d484947014bd626cb6eb7f32dd4. --- pom.xml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/pom.xml b/pom.xml index 0116dba3ea..bc759f609c 100644 --- a/pom.xml +++ b/pom.xml @@ -264,35 +264,5 @@ com/google/cloud/firestore/v1/package-info.java - - - - java17 - - [17,) - - - !jvm - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - --add-opens=java.base/java.lang=ALL-UNNAMED - - - - - From 7c11f8a3667ad9bcc217813a7867e0d18760948e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Jul 2023 18:59:05 +0200 Subject: [PATCH 09/11] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 (#1351) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc759f609c..50b9affc81 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.12.0 + 3.13.0 pom import From 3fba2c55197671ef0835fedcecf004685d4a563e Mon Sep 17 00:00:00 2001 From: Mila <107142260+milaGGL@users.noreply.github.com> Date: Wed, 12 Jul 2023 22:43:08 -0400 Subject: [PATCH 10/11] Fix javadoc lint errors (#1353) --- .../google/cloud/firestore/BulkWriter.java | 82 ++++++++++--------- .../cloud/firestore/FirestoreBundle.java | 4 +- .../firestore/annotation/DocumentId.java | 3 +- 3 files changed, 48 insertions(+), 41 deletions(-) diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/BulkWriter.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/BulkWriter.java index 8c32e0da5c..df25e11918 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/BulkWriter.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/BulkWriter.java @@ -760,18 +760,20 @@ public void addWriteResultListener(WriteResultCallback writeResultCallback) { * *

The executor cannot be changed once writes have been enqueued onto the BulkWriter. * - *

For example, see the sample code: - * BulkWriter bulkWriter = firestore.bulkWriter(); - * bulkWriter.addWriteResultListener( - * (DocumentReference documentReference, WriteResult result) -> { - * System.out.println( - * "Successfully executed write on document: " - * + documentReference - * + " at: " - * + result.getUpdateTime()); - * } - * ); - * + *

For example, see the sample code: + * + *

{@code
+   * BulkWriter bulkWriter = firestore.bulkWriter();
+   * bulkWriter.addWriteResultListener(
+   *       (DocumentReference documentReference, WriteResult result) -> {
+   *           System.out.println(
+   *               "Successfully executed write on document: "
+   *                   + documentReference
+   *                   + " at: "
+   *                   + result.getUpdateTime());
+   *         }
+   *       );
+   * }
* * @param executor The executor to run the provided callback on. * @param writeResultCallback A callback to be called every time a BulkWriter operation @@ -796,20 +798,22 @@ public void addWriteResultListener( * maximum of 10 failed attempts. When an error handler is specified, the default error handler * will be overwritten. * - *

For example, see the sample code: - * BulkWriter bulkWriter = firestore.bulkWriter(); - * bulkWriter.addWriteErrorListener( - * (BulkWriterException error) -> { - * if (error.getStatus() == Status.UNAVAILABLE - * && error.getFailedAttempts() < MAX_RETRY_ATTEMPTS) { - * return true; - * } else { - * System.out.println("Failed write at document: " + error.getDocumentReference()); - * return false; - * } + *

For example, see the sample code: + * + *

{@code
+   * BulkWriter bulkWriter = firestore.bulkWriter();
+   * bulkWriter.addWriteErrorListener(
+   *       (BulkWriterException error) -> {
+   *         if (error.getStatus() == Status.UNAVAILABLE
+   *           && error.getFailedAttempts() < MAX_RETRY_ATTEMPTS) {
+   *           return true;
+   *         } else {
+   *           System.out.println("Failed write at document: " + error.getDocumentReference());
+   *           return false;
    *         }
-   *       );
-   * 
+   *       }
+   *     );
+   * }
* * @param onError A callback to be called every time a BulkWriter operation fails. Returning * `true` will retry the operation. Returning `false` will stop the retry loop. @@ -829,20 +833,22 @@ public void addWriteErrorListener(WriteErrorCallback onError) { * maximum of 10 failed attempts. When an error handler is specified, the default error handler * will be overwritten. * - *

For example, see the sample code: - * BulkWriter bulkWriter = firestore.bulkWriter(); - * bulkWriter.addWriteErrorListener( - * (BulkWriterException error) -> { - * if (error.getStatus() == Status.UNAVAILABLE - * && error.getFailedAttempts() < MAX_RETRY_ATTEMPTS) { - * return true; - * } else { - * System.out.println("Failed write at document: " + error.getDocumentReference()); - * return false; - * } + *

For example, see the sample code: + * + *

{@code
+   * BulkWriter bulkWriter = firestore.bulkWriter();
+   * bulkWriter.addWriteErrorListener(
+   *       (BulkWriterException error) -> {
+   *         if (error.getStatus() == Status.UNAVAILABLE
+   *           && error.getFailedAttempts() < MAX_RETRY_ATTEMPTS) {
+   *           return true;
+   *         } else {
+   *           System.out.println("Failed write at document: " + error.getDocumentReference());
+   *           return false;
    *         }
-   *       );
-   * 
+   *       }
+   *     );
+   * }
* * @param executor The executor to run the provided callback on. * @param onError A callback to be called every time a BulkWriter operation fails. Returning diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreBundle.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreBundle.java index 2b4977aebc..07cdedfdf5 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreBundle.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreBundle.java @@ -70,7 +70,7 @@ public String getId() { * read time will be included in the bundle. * * @param documentSnapshot A document snapshot to add. - * @returns This instance. + * @return This instance. */ public Builder add(DocumentSnapshot documentSnapshot) { return add(documentSnapshot, Optional.empty()); @@ -133,7 +133,7 @@ private Builder add(DocumentSnapshot documentSnapshot, Optional queryNam * * @param queryName The name of the query to add. * @param querySnap The query snapshot to add. - * @returns This instance. + * @return This instance. */ public Builder add(String queryName, QuerySnapshot querySnap) { BundledQuery query = querySnap.getQuery().toBundledQuery(); diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/annotation/DocumentId.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/annotation/DocumentId.java index f8463a87bf..07913f6c1c 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/annotation/DocumentId.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/annotation/DocumentId.java @@ -29,8 +29,9 @@ * the POJO is created from a Cloud Firestore document (for example, via {@link * DocumentSnapshot#toObject}). * + *

Any of the following will throw a runtime exception: + * *

    - * Any of the following will throw a runtime exception: *
  • This annotation is applied to a property of a type other than String or {@link * DocumentReference}. *
  • This annotation is applied to a property that is not writable (for example, a Java Bean From 834126af71c271947610149af5a188477c11a610 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 03:04:13 +0000 Subject: [PATCH 11/11] chore(main): release 3.13.3 (#1352) :robot: I have created a release *beep* *boop* --- ## [3.13.3](https://togithub.com/googleapis/java-firestore/compare/v3.13.2...v3.13.3) (2023-07-13) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#1351](https://togithub.com/googleapis/java-firestore/issues/1351)) ([7c11f8a](https://togithub.com/googleapis/java-firestore/commit/7c11f8a3667ad9bcc217813a7867e0d18760948e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ google-cloud-firestore-admin/pom.xml | 4 ++-- google-cloud-firestore-bom/pom.xml | 16 ++++++++-------- google-cloud-firestore/pom.xml | 4 ++-- grpc-google-cloud-firestore-admin-v1/pom.xml | 4 ++-- grpc-google-cloud-firestore-v1/pom.xml | 4 ++-- pom.xml | 14 +++++++------- proto-google-cloud-firestore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-firestore-bundle-v1/pom.xml | 4 ++-- proto-google-cloud-firestore-v1/pom.xml | 4 ++-- versions.txt | 16 ++++++++-------- 11 files changed, 44 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c362df94..4d3ab20799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.13.3](https://github.com/googleapis/java-firestore/compare/v3.13.2...v3.13.3) (2023-07-13) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#1351](https://github.com/googleapis/java-firestore/issues/1351)) ([7c11f8a](https://github.com/googleapis/java-firestore/commit/7c11f8a3667ad9bcc217813a7867e0d18760948e)) + ## [3.13.2](https://github.com/googleapis/java-firestore/compare/v3.13.1...v3.13.2) (2023-06-22) diff --git a/google-cloud-firestore-admin/pom.xml b/google-cloud-firestore-admin/pom.xml index 3ab6114fa2..be3e7c2100 100644 --- a/google-cloud-firestore-admin/pom.xml +++ b/google-cloud-firestore-admin/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-firestore-admin - 3.13.3-SNAPSHOT + 3.13.3 jar Google Cloud Firestore Admin Client https://github.com/googleapis/java-firestore @@ -14,7 +14,7 @@ com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/google-cloud-firestore-bom/pom.xml b/google-cloud-firestore-bom/pom.xml index 52f6e05d81..d95e73efde 100644 --- a/google-cloud-firestore-bom/pom.xml +++ b/google-cloud-firestore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-firestore-bom - 3.13.3-SNAPSHOT + 3.13.3 pom com.google.cloud @@ -52,37 +52,37 @@ com.google.cloud google-cloud-firestore - 3.13.3-SNAPSHOT + 3.13.3 com.google.cloud google-cloud-firestore-admin - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/google-cloud-firestore/pom.xml b/google-cloud-firestore/pom.xml index ddead074a0..65a7c137a3 100644 --- a/google-cloud-firestore/pom.xml +++ b/google-cloud-firestore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-firestore - 3.13.3-SNAPSHOT + 3.13.3 jar Google Cloud Firestore https://github.com/googleapis/java-firestore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 google-cloud-firestore diff --git a/grpc-google-cloud-firestore-admin-v1/pom.xml b/grpc-google-cloud-firestore-admin-v1/pom.xml index 6cf08a86cb..d1fd615d0d 100644 --- a/grpc-google-cloud-firestore-admin-v1/pom.xml +++ b/grpc-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 grpc-google-cloud-firestore-admin-v1 GRPC library for grpc-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/grpc-google-cloud-firestore-v1/pom.xml b/grpc-google-cloud-firestore-v1/pom.xml index c84e0a284a..b6f2dcf78c 100644 --- a/grpc-google-cloud-firestore-v1/pom.xml +++ b/grpc-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 grpc-google-cloud-firestore-v1 GRPC library for grpc-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/pom.xml b/pom.xml index 50b9affc81..19ad5c3f9c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-firestore-parent pom - 3.13.3-SNAPSHOT + 3.13.3 Google Cloud Firestore Parent https://github.com/googleapis/java-firestore @@ -150,32 +150,32 @@ com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.cloud google-cloud-firestore - 3.13.3-SNAPSHOT + 3.13.3 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/proto-google-cloud-firestore-admin-v1/pom.xml b/proto-google-cloud-firestore-admin-v1/pom.xml index eb6855c53e..f375a85071 100644 --- a/proto-google-cloud-firestore-admin-v1/pom.xml +++ b/proto-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.13.3-SNAPSHOT + 3.13.3 proto-google-cloud-firestore-admin-v1 PROTO library for proto-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/proto-google-cloud-firestore-bundle-v1/pom.xml b/proto-google-cloud-firestore-bundle-v1/pom.xml index 38cacd2d78..ce064a0967 100644 --- a/proto-google-cloud-firestore-bundle-v1/pom.xml +++ b/proto-google-cloud-firestore-bundle-v1/pom.xml @@ -5,14 +5,14 @@ 4.0.0 proto-google-cloud-firestore-bundle-v1 - 3.13.3-SNAPSHOT + 3.13.3 proto-google-cloud-firestore-bundle-v1 PROTO library for proto-google-cloud-firestore-bundle-v1 com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/proto-google-cloud-firestore-v1/pom.xml b/proto-google-cloud-firestore-v1/pom.xml index c6d20b7c7e..a33a7b16e1 100644 --- a/proto-google-cloud-firestore-v1/pom.xml +++ b/proto-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.13.3-SNAPSHOT + 3.13.3 proto-google-cloud-firestore-v1 PROTO library for proto-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.13.3-SNAPSHOT + 3.13.3 diff --git a/versions.txt b/versions.txt index 541000736e..adcd675d7b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,11 +1,11 @@ # Format: # module:released-version:current-version -google-cloud-firestore:3.13.2:3.13.3-SNAPSHOT -google-cloud-firestore-admin:3.13.2:3.13.3-SNAPSHOT -google-cloud-firestore-bom:3.13.2:3.13.3-SNAPSHOT -grpc-google-cloud-firestore-admin-v1:3.13.2:3.13.3-SNAPSHOT -grpc-google-cloud-firestore-v1:3.13.2:3.13.3-SNAPSHOT -proto-google-cloud-firestore-admin-v1:3.13.2:3.13.3-SNAPSHOT -proto-google-cloud-firestore-v1:3.13.2:3.13.3-SNAPSHOT -proto-google-cloud-firestore-bundle-v1:3.13.2:3.13.3-SNAPSHOT +google-cloud-firestore:3.13.3:3.13.3 +google-cloud-firestore-admin:3.13.3:3.13.3 +google-cloud-firestore-bom:3.13.3:3.13.3 +grpc-google-cloud-firestore-admin-v1:3.13.3:3.13.3 +grpc-google-cloud-firestore-v1:3.13.3:3.13.3 +proto-google-cloud-firestore-admin-v1:3.13.3:3.13.3 +proto-google-cloud-firestore-v1:3.13.3:3.13.3 +proto-google-cloud-firestore-bundle-v1:3.13.3:3.13.3