Tried something like this `Mockito.when(view.hideK...
# android
j
Tried something like this
Mockito.when(view.hideKeyboard()).then(doNothing())
l
verify(view).hideKeyboard()
j
But I get this error : However, there were exactly 2 interactions with this mock: view.hideKeyboard();
l
If that is expected: verify(view, times(2)).hideKeyboard()
j
But I have to mock the view.hideKeyboard, right?
Because I have inside mView?.showProgressBar(true) mView?.hideKeyboard()
Any idea @louis993546
l
yes, you have to mock or spy the
view
r
I think you already have it mocked - otherwise you wouldn't get that error
👆 1
j
But I'm getting this error :
Copy code
However, there were exactly 2 interactions with this mock:
view.hideKeyboard();
view.showProgressBar(true);
r
Post the code, it's hard to figure it out without seeing what you're doing...