The problem I'm facing is that Matchers.anyObject()
returns null
. When used to mock method that only accepts non-nullable types it causes a "Should not be null" exception to be thrown.
`when`(mockedBackend.login(anyObject())).thenAnswer { invocationOnMock -> someResponse }
Mocked method:
public open fun login(userCredentials: UserCredentials): Response