title: How to create Spock mocks outside of a specification class?
body: <p>We combine Spock tests with Spring's @ContextConfiguration so we can build beans in a spring context and then use Spock for the actual testing. We would like to inject spock mocks into our spring beans. For Mockito there is an extension which allows you to do things like:</p>
  
  <pre><code> &lt;mockito:mock id="accountService" class="org.kubek2k.account.DefaultAccountService" /&gt;
  </code></pre>
  
  <p>and then reference this mock to other spring beans. There seems to be no such extension for Spock. Then again building this is probably not too much effort if you know how to create Mocks outside of the Specification class. The only way of creating a Spock mock that I'm aware of is:</p>
  
  <pre><code>T Mock(Class&lt;T&gt; type)   
  </code></pre>
  
  <p>in Specification. Is there some API in Spock to create Mocks when not being inside the Specification class, so I could create Spock mocks for a spring context?</p>