Skip to content

test: Upgrade Mockito to 4.11.0#1345

Merged
tom-andersen merged 11 commits intomainfrom
mockito3
Jul 4, 2023
Merged

test: Upgrade Mockito to 4.11.0#1345
tom-andersen merged 11 commits intomainfrom
mockito3

Conversation

@tom-andersen
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@tom-andersen tom-andersen requested a review from a team as a code owner June 27, 2023 15:59
@tom-andersen tom-andersen requested a review from a team June 27, 2023 15:59
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: firestore Issues related to the googleapis/java-firestore API. labels Jun 27, 2023
@tom-andersen tom-andersen changed the title Mockito3 test: Upgrade Mockito to 4.11.0 Jun 27, 2023
Copy link
Copy Markdown
Contributor

@MarkDuckworth MarkDuckworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than one comment that may just be me lacking info about why the commented line was changed.


@Test
public void limitToLastRequiresAtLeastOneOrderingConstraint() throws Exception {
doAnswer(queryResponse())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it intentional to remove the doAnswer(...)... block from this test and the test below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mockito has become strict, and will fail test if mocked behaviour isn't used. So I removed mocked behaviour.

@tom-andersen tom-andersen merged commit 0b4180e into main Jul 4, 2023
@tom-andersen tom-andersen deleted the mockito3 branch July 4, 2023 14:00
@tom-andersen
Copy link
Copy Markdown
Contributor Author

This PR build on work from @suztomo: #1344

cherylEnkidu pushed a commit that referenced this pull request Dec 11, 2023
* 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 <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the googleapis/java-firestore API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants