From 150f5a482e962b362d88f95a0417530b6ec8af43 Mon Sep 17 00:00:00 2001 From: Dominik Menke Date: Sun, 28 Jan 2024 22:47:42 +0100 Subject: [PATCH] fix tests --- service/middleware/logging_test.go | 4 ++-- service/status_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/service/middleware/logging_test.go b/service/middleware/logging_test.go index 0c9bb56..e61776a 100644 --- a/service/middleware/logging_test.go +++ b/service/middleware/logging_test.go @@ -27,7 +27,7 @@ func TestLogging(t *testing.T) { log, err := xlog.New( xlog.AsText(), xlog.WriteTo(&buf), - xlog.MockClock(time.Unix(1650000000, 0)), + xlog.MockClock(time.Unix(1650000000, 0).UTC()), ) require.NoError(t, err) @@ -36,7 +36,7 @@ func TestLogging(t *testing.T) { require.Equal(t, http.StatusOK, w.Code) assert.Equal(t, strings.Join([]string{ - "time=2022-04-15T07:20:00.000+02:00", + "time=2022-04-15T05:20:00.000Z", "level=INFO", `msg=""`, "method=GET", diff --git a/service/status_test.go b/service/status_test.go index 8d65832..c5724fa 100644 --- a/service/status_test.go +++ b/service/status_test.go @@ -63,7 +63,7 @@ func TestHandleStatus_withFailIO(t *testing.T) { log, err := xlog.New( xlog.AsText(), xlog.WriteTo(&buf), - xlog.MockClock(time.Unix(1650000000, 0)), + xlog.MockClock(time.Unix(1650000000, 0).UTC()), ) require.NoError(t, err) @@ -85,7 +85,7 @@ func TestHandleStatus_withFailIO(t *testing.T) { assert.Equal(t, http.StatusOK, rec.code) assert.Equal(t, mimeTypeJSON, rec.h.Get("Content-Type")) assert.Equal(t, strings.Join([]string{ - "time=2022-04-15T07:20:00.000+02:00", + "time=2022-04-15T05:20:00.000Z", "level=ERROR", `msg="failed to write response"`, `error="io: read/write on closed pipe"`,