Add missing contexts in request handler mocks

This commit is contained in:
lash 2025-01-19 09:40:10 +00:00
parent ddd8d7cac0
commit c9b92191f3
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -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 {