question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing mockingDetails API from Mockito

See original GitHub issue

After 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:closed
  • Created 9 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TimvdLippecommented, Aug 14, 2016

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.

0reactions
bric3commented, Aug 17, 2016

Closing as MockingDetails will finally stay as per #541 #542

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found