PullRequestTrigger.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 "bnema.dev/ermite/internal/ports"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewPullRequestTrigger creates a new instance of PullRequestTrigger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewPullRequestTrigger(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *PullRequestTrigger {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &PullRequestTrigger{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// PullRequestTrigger is an autogenerated mock type for the PullRequestTrigger type
39type PullRequestTrigger struct {
40 mock.Mock
41}
42
43type PullRequestTrigger_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *PullRequestTrigger) EXPECT() *PullRequestTrigger_Expecter {
48 return &PullRequestTrigger_Expecter{mock: &_m.Mock}
49}
50
51// OnPullRequest provides a mock function for the type PullRequestTrigger
52func (_mock *PullRequestTrigger) OnPullRequest(ctx context.Context, repo domain.RepoName, ev ports.PullRequestEvent, p domain.Principal) {
53 _mock.Called(ctx, repo, ev, p)
54 return
55}
56
57// PullRequestTrigger_OnPullRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnPullRequest'
58type PullRequestTrigger_OnPullRequest_Call struct {
59 *mock.Call
60}
61
62// OnPullRequest is a helper method to define mock.On call
63// - ctx context.Context
64// - repo domain.RepoName
65// - ev ports.PullRequestEvent
66// - p domain.Principal
67func (_e *PullRequestTrigger_Expecter) OnPullRequest(ctx any, repo any, ev any, p any) *PullRequestTrigger_OnPullRequest_Call {
68 return &PullRequestTrigger_OnPullRequest_Call{Call: _e.mock.On("OnPullRequest", ctx, repo, ev, p)}
69}
70
71func (_c *PullRequestTrigger_OnPullRequest_Call) Run(run func(ctx context.Context, repo domain.RepoName, ev ports.PullRequestEvent, p domain.Principal)) *PullRequestTrigger_OnPullRequest_Call {
72 _c.Call.Run(func(args mock.Arguments) {
73 var arg0 context.Context
74 if args[0] != nil {
75 arg0 = args[0].(context.Context)
76 }
77 var arg1 domain.RepoName
78 if args[1] != nil {
79 arg1 = args[1].(domain.RepoName)
80 }
81 var arg2 ports.PullRequestEvent
82 if args[2] != nil {
83 arg2 = args[2].(ports.PullRequestEvent)
84 }
85 var arg3 domain.Principal
86 if args[3] != nil {
87 arg3 = args[3].(domain.Principal)
88 }
89 run(
90 arg0,
91 arg1,
92 arg2,
93 arg3,
94 )
95 })
96 return _c
97}
98
99func (_c *PullRequestTrigger_OnPullRequest_Call) Return() *PullRequestTrigger_OnPullRequest_Call {
100 _c.Call.Return()
101 return _c
102}
103
104func (_c *PullRequestTrigger_OnPullRequest_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ev ports.PullRequestEvent, p domain.Principal)) *PullRequestTrigger_OnPullRequest_Call {
105 _c.Run(run)
106 return _c
107}