We have a Configuration
class and LocalStorage
class Configuration takes LocalStorage instance in constructor, LocalStorage takes Context
in constructor. We are just trying to start with UI testing.
We are trying to do this
private val localStorage = Mockito.mock(LocalStorage::class.java)
// in our setup method
Mockito.`when`(localStorage.getString(anyString())).thenReturn(str)
Here problem is that getString()
method call starts happening immediately when tests are run. We have not even written actual test yet.
Mockito Android version: 3.1.0