title: groovy.lang.MissingPropertyException: No such property: CREATED for class:
body: <p>I am walking through integration tests on the controller below, it is a generic project to create a category for FAQs on a web probject.   And the following test returns a "groovy.lang.MissingPropertyException: No such property: CREATED for class: "</p>
  
  <p>Controller snippet:</p>
  
  <pre><code>static allowedMethods = [
      index: 'GET', show: 'GET', create: 'GET', edit: 'GET', 
      save: 'POST', update: 'PUT', delete:'DELETE'
  ]
  
  ...more stuff...
  
  @Transactional
      def save(FaqCategory faqCategoryInstance) {
          if (faqCategoryInstance == null) {
              flash.errorMessage = message(code: 'default.not.found.message', args: [message(code: 'faqCategory.label', default: 'FAQ Category'), params.id])
              redirect action: 'index', method: 'GET'
              return
          }
          if (faqCategoryInstance.hasErrors()) {
              respond faqCategoryInstance.errors, view:'create'
              return
          }
          if(!faqCategoryInstance.save(flush:true)){
              respond faqCategoryInstance.errors, view:'create'
              return
          }
          request.withFormat {
              form multipartForm {
                  flash.message = message(code: 'default.created.message', args: [message(code: 'faqCategory.label', default: 'FAQ Category'), faqCategoryInstance.id])
                  redirect faqCategoryInstance
              }
              '*' { respond faqCategoryInstance, [status: CREATED] }
          }
      }
  </code></pre>
  
  <p>Test snippet:</p>
  
  <pre><code>@Test
      void "test save with null params"(){
          def cont = new FaqCategoryController()
          cont.request.method = 'GET'
          cont.params.id = ''
          cont.save() 
          assertEquals 'FAQ Category not found with id', cont.flash.errorMessage
          assertEquals "/faqCategory/index", cont.response.redirectUrl
  </code></pre>
  
  <p>The ironic thing is that I have the (almost) the exact same test in a very similar controller, and that particular test doesn't throw any errors at all and the import statements are identical in each file.  I understand the error msg, but I don't understand where it's coming from or how to fix it.</p>
  
  <p>Here also are the import statements that are common to both test files that I alluded to above:</p>
  
  <pre><code>import static org.junit.Assert.*
  import ....DbunitGroovyTestCase // can't show path because of organizational security
  import junit.framework.JUnit4TestAdapter
  import grails.test.mixin.TestFor
  import junit.framework.TestCase
  
  import org.junit.*
  import spock.lang.*
  </code></pre>
  
  <p>-r</p>