-
Notifications
You must be signed in to change notification settings - Fork 249
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
Support serialization of Mockito mocks #56
Comments
@rsharifu Does this issue still happen if you remove |
@drewhannay I run the test again, the issue still exists even after removing
|
Thanks for the extremely detailed report, this is incredibly helpful. I spent some time investigating this and it looks like serialization support is a feature of JVM Mockito that was never implemented in dexmaker. It seems like this will be non-trivial to implement and I don't know how quickly I can get to it, so I'm going to edit the description of this issue to note that this is a missing feature request. |
@drewhannay would it be a hack to make com.android.dx.mockito.InvocationHandlerAdapter Serializable? |
That was my first try. 😉 I don't think that will work though...the actual code needed to make serializable mocks behave as expected is pretty complex. It may be worth checking out the new |
I'm writing a unit-test for Android app, which creates a mock of serializable custom class and tries to serialize it. It works fine in JUnit test when I'm running it in JVM, but fails with following error when I'm running it as Android test in emulator:
Full gist of error message.
Here is my code (Android test gist):
Entity:
Gradle dependencies:
How to properly serialize mock object on Android?
The text was updated successfully, but these errors were encountered: