Removing mockingDetails API from Mockito
See original GitHub issueAfter some exchange with other member of the community, code such as
Mockito.mockingDetails(someObject).isMock();
Mockito.mockingDetails(someObject).isSpy();
It looks wrong ; Mockito is the entry point for user friendly usage from within the test. Inspecting mocks looks wrong when it’s a normal user.
However I know framework developers may need to inspect mocks. Let’s keep the MockingDetails
type but instantiate it from another static factory method.
The drawback is the removal of this API for current users. Maybe we can mark Mockito.mockingDetails(..)
deprecated in 1.9.x and remove it in 2.0.0
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
MockingDetails (Mockito 2.8.9 API) - javadoc.io
This method is useful for framework integrators and for certain edge cases. Manipulating the collection (e.g. by removing, adding elements) is safe and...
Read more >10 - Stack Overflow
I can see that the MockingDetails class in mockito-core has this method getMockCreationSettings(), but mockito-all doesn't have. The test is ...
Read more >org.mockito.MockingDetails.getStubbings java code examples
Returns stubbings declared on this mock object. Mockito.mockingDetails(mock).getStubbings() What is 'stubbing'? Stubbing is your when(x).then(y) declaration, ...
Read more >How to use mockingDetails method of org.mockito.Mockito class
Learn how to use mockingDetails method in org.mockito.Mockito for your next JUnit project with LambdaTest Automation Testing Advisor.
Read more >How to get original class of a mocked object for reflection ...
new method to MockingDetails. Cheers! -- Szczepan Faber Principal engineer@gradle; Founder@mockito. Join us for Gradle Summit 2014, June 12th and 13th ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Per discussion in Slack with @marcingrzejszczak on Spring Boot, these methods would be the replacement for the
MockUtil
classes to be backwards compatible for both Mockito 1.9.X and Mockito 2.X.Closing as
MockingDetails
will finally stay as per #541 #542