I am using grails 2.5.5 with java 8. To get this working with the new dates, I defined a mapping between the java 8 dates (ZonedDateTime) and the database/hibernate dates. This works fine, no problem at all
here's where the problem starts: Unit Testing: I have a method which uses
Foo.withCriteria{
ge("startDate",foo.startDate)
}
the problem now is that startDate is a ZonedDateTime and I get the error that startDate is no existent property of Foo. Using FindAllBy gives the same problem.
I cannot mock this method, for it is a private method. How do i get these java 8 dates working in unit tests?
(if I gave too little information, just ask, I can provide, but I thought this would be enough and I wanted to keep it as general as possible for stackOverflow)