Shivani Sharma

Results 22 comments of Shivani Sharma

> I consulted my colleague and he said MockUp is used when A calls B calls C, and only want to mock C, which spy might not suit this case....

Also, this looks interesting - maybe can avoid reflection this way? https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/AdditionalAnswers.html#delegatesTo(java.lang.Object) Can use with mockConstruction But won't be able to maintain state, maybe reflection is better.

> @shivanisky @timtebeek Do you think this PR is ready for review now? Do you want to add the case for when in the MockUp a stubbed method is using...

In the past I’ve changed the dev code that was private to nothing (package private) manually. Even if you method.setAccessible() … how would you invoke the when? If it’s possible...

> Indeed. I prefer leave it to user determine. > > Just one more question, should we paste some comment to tell that why those private methods are ignored? You...

For this PR I believe you need to also add test cases to migrate methods of the MockUp which have parameters and use them inside the method. Or, at least...

Ah - that would have been hard to read, was using gmail to reply. In the below case, mockConstruction will not work, need to use mockConstructionWithAnswer(delegatesTo(mockedObject)). Also useful when migrating...

Sorry for the more comments - found a way for you to avoid reflection and minimise the code changes. Using the example code from previous comment: ``` Foo f =...

Glad that helped! Regarding the setup method, could do it in a separate small PR, and for now just exit if it has that annotation. If you really want to...

You might want to migrate to mockito, as I hit the same issue. Have built on @tinder-dthomson 's great work with much help from @timtebeek and added automation for more...