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

Make MockUtil.getMockMaker() public Mockito API #3129

Merged
merged 1 commit into from Oct 6, 2023

Conversation

AndreasTu
Copy link
Contributor

The MockitoPlugins interface now provides access to the MockUtil.getMockMaker() method.

Fixes #3128

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 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (edc6243) 85.48% compared to head (7857798) 85.51%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3129      +/-   ##
============================================
+ Coverage     85.48%   85.51%   +0.02%     
- Complexity     2892     2894       +2     
============================================
  Files           329      330       +1     
  Lines          8826     8828       +2     
  Branches       1095     1095              
============================================
+ Hits           7545     7549       +4     
+ Misses          994      992       -2     
  Partials        287      287              
Files Coverage Δ
...l/configuration/plugins/DefaultMockitoPlugins.java 92.68% <100.00%> (+0.18%) ⬆️
.../main/java/org/mockito/internal/util/MockUtil.java 95.18% <ø> (+2.40%) ⬆️
.../main/java/org/mockito/plugins/MockitoPlugins.java 100.00% <100.00%> (ø)

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

AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 5, 2023
The MockitoPlugins interface now provides access to the getMockMaker()
method.

Fixes mockito#3128
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 6, 2023
MockitoInlineMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129
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.

Thanks!

@TimvdLippe TimvdLippe merged commit fb48e09 into mockito:main Oct 6, 2023
13 checks passed
@AndreasTu AndreasTu deleted the fix_3128 branch October 6, 2023 14:39
@AndreasTu
Copy link
Contributor Author

@TimvdLippe thanks for the help and the merge!

AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 9, 2023
MockitoInlineMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 11, 2023
MockitoInlineMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 11, 2023
MockitoInlineMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 11, 2023
MockitoInlineMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 12, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 13, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 22, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Oct 25, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Nov 6, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Nov 12, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Nov 12, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Dec 17, 2023
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Jan 23, 2024
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Moved IMockMakerSettings and MockMakerId to package spock.mock.

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Jan 24, 2024
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Feb 8, 2024
MockitoMockMaker supports to mock static methods
of Java classes with the new Spec API:

`MockStatic()`
`StubStatic()`
`SpyStatic()`

This also supports Java callers of the static methods.

Added MockUtil.isStaticMock()

Added code to use public Mockito API introduced with
mockito/mockito#3129

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
Co-authored-by: Marc Philipp <marc@gradle.com>
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.

Make MockUtil.getMockMaker() public or public Mockito API
3 participants