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 #3061 : Deprecated mockedTypeIsInconsistentWithDelegatedInstance() #3159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

u4859839
Copy link

This PR resolves issue #3061.

Initially I thought it would be possible to replace the delegatedInstance() reference. However, investigating the origins of the mockTypeIsInconsistentWithDelegatedInstance exception, it seems to me that the exception is not needed. It is only thrown in the validateDelegatedInstance method, and this method is never called anywhere in the codebase. Thus, the exception can be deprecated.

This will avoid any further confusion with the delegatedInstance() reference.

This is my first ever pull request, so any feedback is greatly appreciated.

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

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd62884) 85.52% compared to head (2827de2) 85.53%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #3159   +/-   ##
=========================================
  Coverage     85.52%   85.53%           
- Complexity     2912     2914    +2     
=========================================
  Files           333      334    +1     
  Lines          8856     8861    +5     
  Branches       1095     1096    +1     
=========================================
+ Hits           7574     7579    +5     
+ Misses          994      993    -1     
- Partials        288      289    +1     
Files Coverage Δ
...java/org/mockito/internal/exceptions/Reporter.java 91.06% <ø> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TimvdLippe
Copy link
Contributor

If these methods are no longer referenced in the project, then rather than marking them as deprecated, let's remove them altogether. Since these methods are in org.mockito.internal, we don't consider its API part of our SemVer guarantee.

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.

None yet

3 participants