title: How to mock/stub only one field in a case class
body: <p>I have seen many articles on how to mock the method in the case class when testing with scalamock.</p>
  <p>However, sometimes I need to mock only one field. For example when I'm testing a very narrow workflow.</p>
  <p>I thought that <code>stub[Type].copy(f = &quot;1&quot;)</code> would do a trick, but it returns only <code>null</code>.</p>
  <p>Neither can you mock the field as if it was a method:</p>
  <pre><code>val x = mock[Type]
  ( x.f _ ).when().then(&quot;1&quot;)
  </code></pre>
  <p>This won't compile as well.</p>
  <p>What is the workaround in this situation? What is the best practice in this situation? Should I really define the whole case class fields that I don't need to test?</p>