title: Grails: how to save value to transient field while unit test with spock?
body: <p>In order to test a domain class, which has a transient field, I tried to put a value for that field by the two following ways:</p>
  
  <pre><code>Requirement requirement = new Requirement(linearProduct: linearProduct, periodIndexes: [1,2,3])
  requirement.periodIndexes = [1,2,3]
  </code></pre>
  
  <p>Both of them made the field appear as null object when getting into the tested function.</p>
  
  <p>My question is how to make the values pass although it transient field?</p>