I am trying to make a unit test over a namedquery method and it´s not working as I am using the method grails.orm.HibernateCriteriaBuilder.createAlias which doesn´t seem to be found by Grails: " No signature of method: grails.gorm.CriteriaBuilder.createAlias()"
I guess the problem is that when making a unit test and mocking the class, it´s trying to find the method around "grails.gorm.CriteriaBuilder" class and not grails.orm.HibernateCriteriaBuilder class, 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 signature of method: grails.gorm.CriteriaBuilder.createAlias()