title: Testing Grails Spring Integration
body: <p>I'm trying to write an integration test for a Service which uses a gateway to send requests to a queue.  The gateway is wired up to the queue using spring integration in resources.xml: </p>
  
  <pre><code>    &lt;gateway 
              service-interface="WebRequestService" 
              id="webRequestGateway" 
              default-request-channel="queueChannel" /&gt; 
  </code></pre>
  
  <p>Using the example by Russ Miles <a href="http://blog.springsource.com/2008/12/11/spring-integration-in-grails-part-1/" rel="nofollow noreferrer">http://blog.springsource.com/2008/12/11/spring-integration-in-grails-part-1/</a>, I was able to write a Controller integration test as the gateway comes in using DI. </p>
  
  <p>However, when trying to do this with a Service integration test, I don't get the DI for the gateway, and can't initialise it as it's an interface. </p>
  
  <p>Can I get access to the bean from within a Service integration test?  Or is there a way of initialising it within the service? </p>