Skip to content

Commit 8ed45ff

Browse files
committed
Update middleware framework integration tests
Signed-off-by: Xabier Larrakoetxea <[email protected]>
1 parent a28f76c commit 8ed45ff

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

middleware/gorestful/gorestful_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {
4747

4848
// Mocks.
4949
mr := &mmetrics.Recorder{}
50-
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51-
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52-
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
53-
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
50+
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51+
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
53+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()
5454

5555
// Create our instance with the middleware.
5656
mdlw := middleware.New(middleware.Config{Recorder: mr})

middleware/httprouter/httprouter_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {
4747

4848
// Mocks.
4949
mr := &mmetrics.Recorder{}
50-
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51-
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52-
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
53-
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
50+
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51+
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
53+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()
5454

5555
// Create our instance with the middleware.
5656
mdlw := middleware.New(middleware.Config{Recorder: mr})

middleware/negroni/negroni_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ func TestMiddlewareIntegration(t *testing.T) {
4747

4848
// Mocks.
4949
mr := &mmetrics.Recorder{}
50-
mr.On("ObserveHTTPRequestDuration", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51-
mr.On("ObserveHTTPResponseSize", test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52-
mr.On("AddInflightRequests", test.expHandlerID, 1).Once()
53-
mr.On("AddInflightRequests", test.expHandlerID, -1).Once()
50+
mr.On("ObserveHTTPRequestDuration", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
51+
mr.On("ObserveHTTPResponseSize", mock.Anything, test.expHandlerID, mock.Anything, test.expMethod, test.expStatusCode).Once()
52+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, 1).Once()
53+
mr.On("AddInflightRequests", mock.Anything, test.expHandlerID, -1).Once()
5454

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

0 commit comments

Comments
 (0)