ussd/internal/testutil/mocks/httpmocks/requestparsermock.go

18 lines
455 B
Go
Raw Normal View History

2024-10-24 11:05:11 +02:00
package httpmocks
2025-01-06 06:50:53 +01:00
import "context"
2024-10-24 11:05:11 +02:00
// MockRequestParser implements the handlers.RequestParser interface for testing
type MockRequestParser struct {
GetSessionIdFunc func(any) (string, error)
GetInputFunc func(any) ([]byte, error)
}
2025-01-06 06:50:53 +01:00
func (m *MockRequestParser) GetSessionId(ctx context.Context, rq any) (string, error) {
2024-10-24 11:05:11 +02:00
return m.GetSessionIdFunc(rq)
}
func (m *MockRequestParser) GetInput(rq any) ([]byte, error) {
return m.GetInputFunc(rq)
}