2021-02-24 18:02:26 +00:00
|
|
|
package mock
|
|
|
|
|
|
|
|
|
|
import (
|
2025-06-30 20:45:39 +00:00
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go-v2/service/lambda"
|
2021-02-24 18:02:26 +00:00
|
|
|
"github.com/stretchr/testify/mock"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type LambdaMock struct {
|
|
|
|
|
mock.Mock
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-30 20:45:39 +00:00
|
|
|
func (l *LambdaMock) Invoke(ctx context.Context, input *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error) {
|
2021-02-24 18:02:26 +00:00
|
|
|
args := l.Called(input)
|
|
|
|
|
out, err := args.Get(0), args.Error(1)
|
|
|
|
|
if out == nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return out.(*lambda.InvokeOutput), err
|
|
|
|
|
}
|