title: How do you get the sessionFactory in a Grails Geb/Spock test case?
body: <p>I think I need to flush the hibernate session in a GebSpec test, and so I want to get the sessionFactory.</p>
  
  <p>It looks like it should be injected but when I do something like this:-</p>
  
  <pre><code>class MySpec extends GebSpec {
  def sessionFactory
  ...
  def "test session"(){
  ....do some setup
  then: 
    assert sessionFactory != null
  }
  </code></pre>
  
  <p>it fails with sessionFactory being null.</p>