title: Grails 2.3 integration test behaving badly - ServletContext must not null
body: <p>I've seen a few posts about issues with Grails 2.3.x and integration testing, but nothing has helped my situation yet, so here goes:</p>
  
  <p>I want to test my Grails services against a real live database (Oracle) and so I wrote some integration tests in Spock. No matter which of the recommended approaches I try, I get the same error. I'm hoping it's something simple and dumb, but I fear that there is an issue which needs to be addressed by the Grails team.</p>
  
  <p>Here's the code, properly sanitized to remove any hint of where I work:</p>
  
  <pre><code>package com.mycompany
  
  import grails.test.spock.IntegrationSpec
  import spock.lang.*
  import com.mycompany.User
  
  class UserServiceSpec extends IntegrationSpec {
  
      UserService userService
  
      def setup() {
      }
  
      def cleanup() {
      }
  
      void "find a user by their id"() {
              when:
                  User user = userService.find('1234')
          then:
                  user.firstName == 'Brian'
      }
  }
  </code></pre>
  
  <p>From everything I've read out there, this is how you do it with Grails 2.3 and beyond. I consistently get the following error</p>
  
  <pre><code>java.lang.IllegalArgumentException: ServletContext must not be null
  </code></pre>
  
  <p>Any help is always appreciated. </p>
  
  <p>Brian</p>