Grails 2.4.4 HQL for service tests?

I am trying to create a test Grails service that executes an HQL supported service (executeQuery) method. This is now possible with HibernateTestMixin. However, I cannot find or create a working example of this. This is where I started:

@TestFor(FeatureRelationshipService)
@Mock([FeatureRelationship,Feature,Gene,MRNA])
class FeatureRelationshipServiceSpec extends Specification {

      

this is giving me errors stating that String requests are not supported by GROM (nothing new).

and I changed it to:

@TestFor(FeatureRelationshipService)
@TestMixin([HibernateTestMixin,ServiceUnitTestMixin])
@Domain([FeatureRelationship,Feature,Gene,MRNA])

      

or

@TestMixin(HibernateTestMixin)
@Domain([FeatureRelationship,Feature,Gene,MRNA])

      

I am getting the same error:

Failure:  parents for feature(org.bbop.apollo.FeatureRelationshipServiceSpec)
|  org.springframework.beans.factory.BeanCreationException: Error creating bean with     name 'persistenceInterceptor': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
at grails.test.runtime.GrailsApplicationTestPlugin$1.initializeContext(GrailsApplicationTestPlugin.groovy:118)

      

+3


source to share





All Articles