Skip to content

Commit

Permalink
Update middleware framework integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Xabier Larrakoetxea <[email protected]>
  • Loading branch information
slok committed Mar 27, 2019
1 parent a28f76c commit 8ed45ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions middleware/gorestful/gorestful_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {

// Mocks.
mr := &mmetrics.Recorder{}
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()

// Create our instance with the middleware.
mdlw := middleware.New(middleware.Config{Recorder: mr})
Expand Down
8 changes: 4 additions & 4 deletions middleware/httprouter/httprouter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {

// Mocks.
mr := &mmetrics.Recorder{}
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()

// Create our instance with the middleware.
mdlw := middleware.New(middleware.Config{Recorder: mr})
Expand Down
8 changes: 4 additions & 4 deletions middleware/negroni/negroni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {

// Mocks.
mr := &mmetrics.Recorder{}
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()

// Create our negroni instance with the middleware.
mdlw := middleware.New(middleware.Config{Recorder: mr})
Expand Down

0 comments on commit 8ed45ff

Please sign in to comment.