title: MockK: mocking an jpa repository.save call
body: <p>My code saves an object to database in some bigger method, but I don't need to test this.
  So I want to mock the Repository.save method. But the <code>save</code> method returns the saved object.
  I tried the following:</p>
  <pre><code>@MockK
  private lateinit var mockJobRepository: JobRepository
  val jobSlot = slot&lt;Job&gt;()
  // ...
  every { mockJobRepository.save&lt;Job&gt;(capture(jobSlot)) } 
      returns(jobSlot.captured)
  </code></pre>
  <p>But it throws an runtime error:
  &quot;lateinit property captured has not been initialized&quot;</p>
  <p>How do I just return the given argument in the mock?</p>