diff --git a/api/handler/triggers_test.go b/api/handler/triggers_test.go index 4534c35d6..ea558c2bf 100644 --- a/api/handler/triggers_test.go +++ b/api/handler/triggers_test.go @@ -207,14 +207,13 @@ func TestGetTriggerFromRequest(t *testing.T) { Convey("for graphite remote", func() { triggerDTO.TriggerSource = moira.GraphiteRemote body, _ := json.Marshal(triggerDTO) + testLogger, _ := logging.GetLogger("Test") Convey("when ErrRemoteTriggerResponse returned", func() { request := httptest.NewRequest(http.MethodPut, "/trigger", bytes.NewReader(body)) request.Header.Add("content-type", "application/json") request = request.WithContext(setValuesToRequestCtx(request.Context(), allSourceProvider, api.GetTestLimitsConfig())) - testLogger, _ := logging.GetLogger("Test") - request = middleware.WithLogEntry(request, middleware.NewLogEntry(testLogger, request)) var returnedErr error = remote.ErrRemoteTriggerResponse{ @@ -233,8 +232,6 @@ func TestGetTriggerFromRequest(t *testing.T) { request.Header.Add("content-type", "application/json") request = request.WithContext(setValuesToRequestCtx(request.Context(), allSourceProvider, api.GetTestLimitsConfig())) - testLogger, _ := logging.GetLogger("Test") - request = middleware.WithLogEntry(request, middleware.NewLogEntry(testLogger, request)) var returnedErr error = remote.ErrRemoteUnavailable{