Rewrite test to avoid timezone issues.

This commit is contained in:
Mark Nellemann 2021-01-27 15:26:47 +01:00
parent 0909298bbc
commit 6fc55f14cb

View file

@ -97,14 +97,13 @@ class SyslogParserRfc3164Test extends Specification {
void "test parseRfc3164Timestamp"() { void "test parseRfc3164Timestamp"() {
setup: setup:
OffsetDateTime odt = OffsetDateTime.now()
String dateString = "Sep 12 20:50:13" String dateString = "Sep 12 20:50:13"
when: when:
Instant inst = syslogParser.parseTimestamp(dateString) Instant inst = syslogParser.parseTimestamp(dateString)
then: then:
inst.toString() == "${odt.getYear()}-09-12T18:50:13Z" inst.epochSecond == 1631472613
} }
} }