I am trying to do a unit test using the namedquery method, and it does not work since I am using the grails.orm.HibernateCriteriaBuilder.createAlias method, which Grails did not seem to find: "No signature Method: grails.gorm.CriteriaBuilder.createAlias () "
I assume the problem is that when creating a unit test and making fun of the class, it tries to find the method around the grails.gorm.CriteriaBuilder class, not grails.orm.HibernateCriteriaBuilder , why? any ideas to solve it?
class Book{ static namedQueries = { testMethod() { createAlias('name', 'james') } } } @Mock([Book]) class BookTests{ @Test void myTest() { Book.testMethod(); } }
Error: no method signature: grails.gorm.CriteriaBuilder.createAlias ()
alvaro.rmfg
source share