narancs
narancs

Reputation: 5294

Robolectric fails to mock LocalBroadcastManager

at org.robolectric.shadows.support.v4.
ShadowLocalBroadcastManager.shadowOf(ShadowLocalBroadcastManager.java:42)

I am getting the above error when trying to test a class, which using a LocalBroadcastManager. I am using Robolectric and Mockito to run my tests.

Could you please advice how can I mock this LocalBroadcastManager, so I can turn my test green?

here are my dependencies:

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.robolectric:robolectric:3.5'
testCompile 'org.robolectric:shadows-support-v4:3.0'
testCompile "org.robolectric:shadows-multidex:3.0"

androidTestCompile 'com.android.support:support-annotations:25.3.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

Upvotes: 1

Views: 679

Answers (0)

Related Questions