-
Notifications
You must be signed in to change notification settings - Fork 156
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
Mockito cannot mock final classes error #77
Comments
reisfernanda
pushed a commit
to reisfernanda/codelab-android-dagger
that referenced
this issue
Nov 3, 2023
reisfernanda
added a commit
to reisfernanda/codelab-android-dagger
that referenced
this issue
Nov 3, 2023
thank you, it works for me:
|
Thank you for posting this. Just an update: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To fix the below error which occurs when running unit tests that have a dependency with the
UserManager
class, we need to update Mockito to a version higher than 5.0.0 because mocking final classes feature is enabled by default. In my case updating Mockito to version 5.3.1 fixed the issue.Solution:
testImplementation 'org.mockito:mockito-core:5.3.1'
Problem:
The text was updated successfully, but these errors were encountered: