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
Mockito Public API Support Roadmap #726
Comments
How to use PowerMockito.mockStatic()? |
Unfortunately, there is no alternative, except use PowerMock with Mockito 1. |
Experimental supporting Mockito 2.4.0 has been added in PowerMock 1.7.0RC in pull request #740 |
@thekingnothing |
I am trying to use the combo below - but I still get "Exception in thread "main" java.lang.NoClassDefFoundError: org/mockito/exceptions/Reporter" Is there currently any working combo for Mockito 2 and PowerMockito.mockStatic()?
|
@TheKlint, could you provide full stack trace? How throw exception? |
@thekingnothing I think below exception is mentioned by @TheKlint
|
Hi, same problem
|
I am facing the same issue with below configuration.
|
@TheKlint @HCL-Balaji @drayan85 @AlekseiMarkov
Please, check dependencies, to use PowerMock with Mockito 2+ it should be not a but org.powermock:powermock-api-mockito2:1.7.0RC2 https://github.com/powermock/powermock/wiki/Mockito-2-(Maven) |
@thekingnothing , thanks . with mokito2 working for now. |
Use a new MockSetting API when mock is being created.
Use Mockito Public API to create a mock
Use Mockito Public API to create a mock
Refactoring to isolate Mockito internal code.
@thekingnothing All the "current mockito 2 compatibility issues" listed in the first post are closed, but the wiki still states that Mockito2 support is experimental. What has to be in place before the Mockito2 support is no longer experimental? |
The mockito/mockito#1110<https://github.com/mockito/mockito/issues/1110#issuecomment-317418861> should be closed before make supporting Mockito 2 official stable.
We still have some issues, for example cleaning/reset mock could work incorrectly. Things like checking if class ready for static mock was just commented out.
Best regrads,
Arthur Zagretdinov
On 24 Jul 2017, at 11:18, Stian H. Nesbø <notifications@github.com<mailto:notifications@github.com>> wrote:
All the "current mockito 2 compatibility issues" listed in the first post are closed, but the wiki still states that Mockito2 support is experimental. What has to be in place before the Mockito2 support is no longer experimental?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub<#726 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMkKADn8j3noP4H41n7JGVXZd8jUoKSyks5sRGFZgaJpZM4LBEt2>.
|
Using Mockito API for stubbing and creating invocation.
Replace using ThrowsException and other Mockito's internals answers by calling public API.
Use Mockito Public API to create a mock
Using Mockito API for stubbing and creating invocation.
Replace using ThrowsException and other Mockito's internals answers by calling public API.
Using Mockito API for stubbing and creating invocation.
Clearing code and fixing test.
Upgrade Mockito to 2.10.0 - release with a new Mockito API.
Fix tests that are failed only on travis due different order of executing.
Delete unnecessary mockito-modules file, because there is no mockito modules any more.
Using Mockito API for stubbing and creating invocation.
Replace using ThrowsException and other Mockito's internals answers by calling public API.
Using Mockito API for stubbing and creating invocation.
Replace using ThrowsException and other Mockito's internals answers by calling public API.
Remove deprecated `verifyStatic()`.
Remove reseting mocking process in PowerMockito
Remove unused Mockito related code.
Replace dirty approach for checking if call to real method was handled by mockito.
Remove using Mockito internal class in default.properties
Remove `MockingFrameworkReporterFactory` because it does not make sense anymore.
Clearing code: fix todo and refactor tests,
Clearing code and fixing test.
Upgrade Mockito to 2.10.0 - release with a new Mockito API.
Fix tests that are failed only on travis due different order of executing.
Delete unnecessary mockito-modules file, because there is no mockito modules any more.
These changes have been released to Maven Central |
Powermock is heavily relying on the internal workings of Mockito. As result hight cost of compatibility maintenance. We should move to using public SPI. Mockito team is ready to help and provide change in API.
Main goal: clean code without dirty hacks to get internals of Mockito.
We need:
Current mockito 2 compatibility issues:
The text was updated successfully, but these errors were encountered: