Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3219: Add support for static mocks on DoNotMockEnforcer #3220

Merged
merged 1 commit into from Jan 22, 2024

Conversation

andrebrait
Copy link
Contributor

Fixes #3219
Fix mockStatic bypassing DoNotMockEnforcer
Add (optional) method on DoNotMockEnforcer for static mocks

Checklist

  • Read the contributing guide
  • PR should be motivated, i.e. what does it fix, why, and if relevant how
  • If possible / relevant include an example in the description, that could help all readers
    including project members to get a better picture of the change
  • Avoid other runtime dependencies
  • Meaningful commit history ; intention is important please rebase your commit history so that each
    commit is meaningful and help the people that will explore a change in 2 years
  • The pull request follows coding style
  • Mention Fixes #<issue number> in the description if relevant
  • At least one commit should mention Fixes #<issue number> if relevant

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

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

Nice tests! I think an enum API is easier to manage and avoids introducing many more overloads, as well as clear migration path for future implementations of DoNotMockEnforcer.

@andrebrait
Copy link
Contributor Author

@TimvdLippe changes performed. It's technically missing a test project, though. Let me know if you'd still like to have it and I'll make it on Monday.

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

@andrebrait andrebrait force-pushed the gh-pr-3219 branch 2 times, most recently from b5cd2c8 to 01b32ab Compare January 22, 2024 15:46
Fixes mockito#3219
Fix mockStatic bypassing DoNotMockEnforcer
Add (optional) method on DoNotMockEnforcer for static mocks
@TimvdLippe TimvdLippe merged commit 9173522 into mockito:main Jan 22, 2024
18 checks passed
@andrebrait andrebrait deleted the gh-pr-3219 branch January 22, 2024 16:40
andrebrait added a commit to andrebrait/mockito that referenced this pull request Jan 23, 2024
- Follow up to mockito#3220
- Make the method return the lowest common denominator type
andrebrait added a commit to andrebrait/mockito that referenced this pull request Jan 23, 2024
- Follow up to mockito#3220
- Make the method return the lowest common denominator type
TimvdLippe pushed a commit that referenced this pull request Jan 23, 2024
Make the method return the lowest common denominator type

Follow up to #3220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mockito#mockStatic(Class<?>) skips DoNotMockEnforcer
2 participants