-
Notifications
You must be signed in to change notification settings - Fork 246
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
Avoiding Mockito internal APIs #64
Comments
It'd be great to clean this up. Luckily it looks like all the internal api usages are centralized in InvocationHandlerAdapter (and there's only a few). Do you have any more info you can provide on what can be used instead of these internal classes / interfaces? |
When trying to convert the non-inline dexmaker mockmaker I am currently stuck in the problem that Mockito.framework().getInvocationFactory().createInvocation ... takes a Callable for the read-method. If the real method throws an non-Exception-Throwable the realmethod-Callable cannot re-throw this. Wrapping it in a InvocationTargetException hides the lowest stack frame. |
@mockitoguy : Can you recommend how to throw a non-Exception-Throwable from a realMethod used in Mockito.framework().getInvocationFactory().createInvocation(...) ? |
….Set The MockMap is mostly a re-implementation of WeakConcurrentMap with a few Android'y twists such as creating less objects and using android.util types where they don't cause a performance regression. I stopped using the WeakConcurrentSet as we need to remember which classes are transformed, hence using a weak-reference would require us to un-transform the classes when the reference goes away. We don't do that, hence don't use weak-references.
... still waiting for mockito 2.16 to be able to replace the usage of the internal Instantiator.
The MockMap is mostly a re-implementation of WeakConcurrentMap with a few Android'y twists such as creating less objects and using android.util types where they don't cause a performance regression. I stopped using the WeakConcurrentSet as we need to remember which classes are transformed, hence using a weak-reference would require us to un-transform the classes when the reference goes away. We don't do that, hence don't use weak-references.
... still waiting for mockito 2.16 to be able to replace the usage of the internal Instantiator.
@moltmann is there still work left to do on this one? |
Now that there is a public instantiator provider, use it. This was the last internal mockito API we used.
pull #93 and we are done. |
Now that there is a public instantiator provider, use it. This was the last internal mockito API we used.
Thanks @moltmann! |
Hey guys!
Dexmaker is using internal Mockito APIs, are you interested in working together to clean this up?
While working on extending Mockito APIs so that it is easier to integrate (mockito/mockito#1110), I took a look at dexmaker code in case I need to be cautions about breaking some compatibility :) I found a class that imports a couple of internal Mockito classes (org.mockito.internal).
The text was updated successfully, but these errors were encountered: