title: Accessing servletContext from a service within an integration test
body: <p>I am trying to access the <code>servletContext</code> (application context) from a service into an integration test. </p>
  
  <p>Here is how I try to allow it into my integration test: </p>
  
  <pre><code>import org.codehaus.groovy.grails.web.context.ServletContextHolder as SCH 
  
  class ScraperServiceIntegrationTests extends GroovyTestCase {
     ScraperService scraperService
  
      def testStoring() {
          scraperService = new ScraperService()
          scraperService.servletContext = new SCH() 
          scraperService.storing()
          ...
      }
      ...
  }
  </code></pre>
  
  <p>Here is how I use the servlet context in my service: </p>
  
  <pre><code>class ScraperService {
  
      static transactional = true
      def servletContext 
  
      synchronized def storing() {
          servletContext.numberOfCreditProvider = "whatever"
          ...
      }
      ...
  }
  </code></pre>
  
  <p>I get the following error message: </p>
  
  <pre><code>No such property: numberOfCreditProvider for class: org.codehaus.groovy.grails.web.context.ServletContextHolder
  </code></pre>
  
  <p>How can I solve this error?</p>