title: Using mockk to match any varargs
body: <p>I'm trying to mock an Android Context to return a string from a resource id. However I have trouble matching the stub to the call, I assume it is because of the varargs. However I am new to mockk so I might just miss something very easy.</p>
  
  <p>I mock the context this way:</p>
  
  <pre><code>val context = mockk&lt;Context&gt;()
  every { context.getString(any(), any()) } returns stringToReturn
  </code></pre>
  
  <p>But when calling getString on the object it throws the following exception:</p>
  
  <pre><code>io.mockk.MockKException: no answer found for: Context(#1).getString(2131689544, [])
  </code></pre>
  
  <p>If it is important, I call the function in the class under test similar to this. formatArgs may be empty but doesn't have to:</p>
  
  <pre><code>protected fun foo(stringResource: Int, vararg formatArgs: Any) {
      val s = context.getString(errorMessageStringResource, *formatArgs)
  </code></pre>
  
  <p>Any idea how I can fix this?</p>
  
  <p>You can check the project and reproduce the exception here: <a href="https://github.com/findusl/OneNightComps/blob/develop/Android/app/src/test/java/lehrbaum/de/onenightcomps/viewmodel/TestErrorViewModel.kt" rel="noreferrer">Github Project</a></p>