title: Grails/GORM: inconsistent behavior for inherited domain classes (Testing VS Bootstrap)
body: <p>I am seeing an inconsistency in the behavior of my application VS the outcome of a test-case that I have for an inherited domain class. Here are the classes involved in the issue (only part of code provided).</p>
  
  <pre><code>class Ticket {
      String title
      String description
      Date dateCreated
      Date lastUpdated
      User postedBy
  }
  
  class FacebookTicket extends Ticket {
      FacebookPost facebookPost
  }
  
  class FacebookPost {
      String postId
      String message
      String postedById
      String postedByName
      Date createdOnFacebook
      Date lastUpdatedOnFacebook
  }
  </code></pre>
  
  <p><strong>Relevant test code:</strong></p>
  
  <pre><code>def facebookPost1 = new FacebookPost(postId:"12345", message:"This post should become a ticket", postedById:"09876",postedByName:"Rowz Roller", createdOnFacebook: new Date(), lastUpdatedOnFacebook: new Date())
  
  facebookPost1.save(flush:true)
  
  def facebookTicket1 = new FacebookTicket (title:"Facebook Ticket1",description:"First FACEBOOK ticket here",postedBy:user1,facebookPost: facebookPost1)
  
  mockForConstraintsTests(FacebookTicket, [facebookTicket1])
  
  assertTrue facebookTicket1.validate() //Succeeds
  
  assertNotNull(facebookTicket1.save()) //Succeeds
  
  def instances = FacebookTicket.list()
  assertEquals 1,instances.size() //Fails
  </code></pre>
  
  <p>The <strong>assertEquals</strong> fails with junit.framework.AssertionFailedError: expected:&lt;1> but was:&lt;0></p>
  
  <p>However, the same piece of code works fine in Bootstrap and the relevant entity even shows up in the <strong>list</strong> view for FacebookTicket.</p>
  
  <p>Is this due to some limitation for GORM testing w.r.t. inherited domain classes or am I doing something wrong here?
  (The Ticket and FacebookPost tests work fine.)</p>
  
  <p>Thank you.</p>
  
  <p>PS: Please let me know if I should provide more code.</p>