title: MockK "io.mockk.MockKException: no answer found for:" error
body: <p>Hi i am trying to mock the response i get from a Single observable that gets returned from retrofit using a delegator that my presenter class calls and i am getting the following error:</p>
  <blockquote>
  <p>io.mockk.MockKException: no answer found for: LoginPresenter(#1).login(LoginRequest(email=hello@gmail.com, password=password123))</p>
  </blockquote>
  <p>Here is my test code</p>
  <pre class="lang-kotlin prettyprint-override"><code>@Test
  fun testKotlinMock(){
  
      val presenter : LoginPresenter = mockk&lt;LoginPresenter&gt;()
  
      val delegator = mockk&lt;AccountDelegatorContract&gt;()
  
      val viewCallback = mockk&lt;LoginContract.LoginViewCallBack&gt;()
  
      val cookieStore = mockk&lt;PianoCookieStore&gt;()
  
      val loginRequest = LoginRequest(&quot;hello@gmail.com&quot;, &quot;password123&quot;)
      val customerResponse = CustomerResponse(&quot;jon&quot;, &quot;richy&quot;)
  
      every { delegator.login(loginRequest) } returns Single.just(Response.success(any()))
      every { delegator.getCustomer() } returns Single.just(customerResponse)
      every { presenter.loginViewCallBack } returns viewCallback
      every { presenter.accountDelegator } returns delegator
      every { presenter.cookieStorage } returns cookieStore
  
      presenter.login(loginRequest)
  }
  </code></pre>
  <p>My actual Presenter code looks like this:</p>
  <pre class="lang-kotlin prettyprint-override"><code>@Inject
  lateinit var loginViewCallBack: LoginViewCallBack
  
  @Inject
  lateinit var delegator: DelegatorContract
  
  @Inject
  lateinit var cookieStorage: CookieStore
  
  @Inject
  constructor()
  
  override fun login(loginRequest: LoginRequest) {
      delegator.login(loginRequest)
          .flatMap({ response -&gt;
              saveCookieAndContinue(response)
          })
          .observeOn(AndroidSchedulers.mainThread())
          .subscribeOn(Schedulers.io())
          .subscribe(object : SingleObserver&lt;CustomerResponse&gt;{
              override fun onSubscribe(d: Disposable) {
              }
      
              override fun onError(e: Throwable) {
                  loginViewCallBack.onErrorLogin(PianoError.ERROR_LOGIN_INVALID)
                  Log.d(&quot;JJJ&quot;, &quot;login error&quot;)
              }
  
              override fun onSuccess(customerResponse : CustomerResponse) {
                  loginViewCallBack.onLoginSuccess(customerResponse)
                  Log.d(&quot;JJJ&quot;, &quot;login successfully&quot;)
              }
          })
  }
      
          private fun saveCookieAndContinue(response: Response&lt;Void&gt;): Single&lt;CustomerResponse&gt; {
              if (response.isSuccessful) {
                  val headers = response.headers()
                  cookieStorage.saveSessionCookies(headers.get(PianoCookieStore.COOKIE_HEADER_SET_NAME)!!)
                  return accountDelegator.getCustomer()
              }
              //TODO: Change this to throw a login exception?
             throw RuntimeException()
          }
  </code></pre>
  <p>i basically want to mock the injected dependencies you see from the main code and then run a happy path unit test.</p>
  <p>It fails when i call the presenter.login(loginRequest) with the no answer found error</p>
  <p>This is the kotlin extenstion plugin i am using <a href="http://mockk.io/" rel="noreferrer">http://mockk.io/</a></p>