Reputation: 525
Some static method did not get injected to grails services. But What if I wanna assert whether a domain class table is empty in a service?
Like in a controller, I can do:
assert DomainClass.count()==0
What is the alternative in a grails service or a grails domain class?
Upvotes: 0
Views: 326
Reputation: 1543
I'm not sure why it does not work as is, but it worked for me when I wrapped the assertion in braces
assert (DomainClass.count()==0)
Upvotes: 0