Our normal way of writing unit tests is using mocks via Mockito. However, LocalBroadcastManager
, for some unexplicable reason, is final - thus preventing Mockito from expanding it, which prevents us to mock
/spy
it...
--> How can I write unit tests for a class that contain LocalBroadcastManager?
I would for example like to check that when some conditions occur etc. certain broadcasts (containing specific extras) are sent out.