Setting lastUpdated of a Grails domain object in Spock
<p>I have a Grails 2.2.4 project, and I'm trying to write a unit test for a method that queries over <code>lastUpdated</code>, like so:</p>

<pre><code>Tile.createCriteria().list {
  lt('lastUpdated', new Date() - 1)
}
</code></pre>

<p>This method works fine in real life, but fails in my unit tests because I can't create any test data with <code>lastUpdated</code> other than <code>now</code>.  Setting <code>myTile.lastUpdated</code> explicitly doesn't work, since that's an update and thus triggers the auto-timestamping.  Turning off auto timestamping requires the <code>eventTriggeringInterceptor</code>, which doesn't seem to be available in unit tests.  Mocking the default <code>Date</code> constructor to return other values was also no help.  Direct SQL updates are not available in unit tests at all.</p>

<p>Is this possible in unit tests at all, or do I have to write an integration test?</p>