MockK “io.mockk.MockKException: no answer found for:” error

In your case you mocked the classes being tested. You have two options:

  • get rid of mockk for loginPresenter, just use original object and set properties
  • use spyk to create spy. This is something in between original object and mock

The exception is throw because mocks are strict by default, it just do not know how to handle it because mocks as objects are not initialized at all.

Read more about mocks, spies and relaxed mocks here: https://blog.kotlin-academy.com/mocking-is-not-rocket-science-mockk-features-e5d55d735a98

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)