Add missing contexts in request handler mocks
This commit is contained in:
parent
ddd8d7cac0
commit
c9b92191f3
@ -1,6 +1,8 @@
|
|||||||
package httpmocks
|
package httpmocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"git.defalsify.org/vise.git/engine"
|
"git.defalsify.org/vise.git/engine"
|
||||||
"git.defalsify.org/vise.git/persist"
|
"git.defalsify.org/vise.git/persist"
|
||||||
"git.defalsify.org/vise.git/resource"
|
"git.defalsify.org/vise.git/resource"
|
||||||
@ -13,8 +15,8 @@ type MockRequestHandler struct {
|
|||||||
GetConfigFunc func() engine.Config
|
GetConfigFunc func() engine.Config
|
||||||
GetEngineFunc func(cfg engine.Config, rs resource.Resource, pe *persist.Persister) engine.Engine
|
GetEngineFunc func(cfg engine.Config, rs resource.Resource, pe *persist.Persister) engine.Engine
|
||||||
OutputFunc func(rs request.RequestSession) (request.RequestSession, error)
|
OutputFunc func(rs request.RequestSession) (request.RequestSession, error)
|
||||||
ResetFunc func(rs request.RequestSession) (request.RequestSession, error)
|
ResetFunc func(ctx context.Context, rs request.RequestSession) (request.RequestSession, error)
|
||||||
ShutdownFunc func()
|
ShutdownFunc func(ctx context.Context)
|
||||||
GetRequestParserFunc func() request.RequestParser
|
GetRequestParserFunc func() request.RequestParser
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,12 +36,12 @@ func (m *MockRequestHandler) Output(rs request.RequestSession) (request.RequestS
|
|||||||
return m.OutputFunc(rs)
|
return m.OutputFunc(rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockRequestHandler) Reset(rs request.RequestSession) (request.RequestSession, error) {
|
func (m *MockRequestHandler) Reset(ctx context.Context, rs request.RequestSession) (request.RequestSession, error) {
|
||||||
return m.ResetFunc(rs)
|
return m.ResetFunc(ctx, rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockRequestHandler) Shutdown() {
|
func (m *MockRequestHandler) Shutdown(ctx context.Context) {
|
||||||
m.ShutdownFunc()
|
m.ShutdownFunc(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockRequestHandler) GetRequestParser() request.RequestParser {
|
func (m *MockRequestHandler) GetRequestParser() request.RequestParser {
|
||||||
|
Loading…
Reference in New Issue
Block a user