Skip to content

Commit

Permalink
test: move shared variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrMatsko committed Nov 27, 2024
1 parent 5cfed1f commit 455dfd7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/handler/triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down

0 comments on commit 455dfd7

Please sign in to comment.