lundi 11 juillet 2016

@TestMixin(HibernateTestMixin) in Grails 3.1.x can´t handle joinded tables?

My Application uses the SpringSecurityCore Plugin. In my AdminUser Class i have something like this:

static mapping = {
    table   'com_admin_user'
    id      generator: 'native', params:[ sequence: 'com_adinuser_id_seq' ]
    password column: 'password'
    sort    'login'
}

I wrote a test an used the 'HibernateTestMixin' and also the following 3 Classes in @Domain- Annotation: AdminUser, AdminRole, AdminUserRole

If i run the test, i get:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerAwarePostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: com_admin_role

I added testCompile 'org.grails:grails-datastore-test-support:5.0.5.RELEASE'

Is it possible that HibernateTestMixin can not handle this structure? Or do I something wrong?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire