Given a ZonedDateTime with a time zone other than UTC, TimeUtil.toZonedDateTime returns a wrong result. It discards the time zone within the String with the time zone set within TimeUtil.
The following test fails, but should succeed:
def "A TimeUtil should parse ZonedDateTime objects with time zone correctly"() {
given:
def time = TimeUtil.withDefaults.toZonedDateTime("2020-04-22T00:00:00+01:00")
expect:
DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(time) == "2020-04-22T00:00:00+01:00"
}