|
| 1 | +// Automatically generated by pegomock. DO NOT EDIT! |
| 2 | +// Source: github.com/hootsuite/atlantis/server/events/webhooks (interfaces: SlackClient) |
| 3 | + |
| 4 | +package mocks |
| 5 | + |
| 6 | +import ( |
| 7 | + "reflect" |
| 8 | + |
| 9 | + webhooks "github.com/hootsuite/atlantis/server/events/webhooks" |
| 10 | + pegomock "github.com/petergtz/pegomock" |
| 11 | +) |
| 12 | + |
| 13 | +type MockSlackClient struct { |
| 14 | + fail func(message string, callerSkip ...int) |
| 15 | +} |
| 16 | + |
| 17 | +func NewMockSlackClient() *MockSlackClient { |
| 18 | + return &MockSlackClient{fail: pegomock.GlobalFailHandler} |
| 19 | +} |
| 20 | + |
| 21 | +func (mock *MockSlackClient) AuthTest() error { |
| 22 | + params := []pegomock.Param{} |
| 23 | + result := pegomock.GetGenericMockFrom(mock).Invoke("AuthTest", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) |
| 24 | + var ret0 error |
| 25 | + if len(result) != 0 { |
| 26 | + if result[0] != nil { |
| 27 | + ret0 = result[0].(error) |
| 28 | + } |
| 29 | + } |
| 30 | + return ret0 |
| 31 | +} |
| 32 | + |
| 33 | +func (mock *MockSlackClient) TokenIsSet() bool { |
| 34 | + params := []pegomock.Param{} |
| 35 | + result := pegomock.GetGenericMockFrom(mock).Invoke("TokenIsSet", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) |
| 36 | + var ret0 bool |
| 37 | + if len(result) != 0 { |
| 38 | + if result[0] != nil { |
| 39 | + ret0 = result[0].(bool) |
| 40 | + } |
| 41 | + } |
| 42 | + return ret0 |
| 43 | +} |
| 44 | + |
| 45 | +func (mock *MockSlackClient) ChannelExists(channelName string) (bool, error) { |
| 46 | + params := []pegomock.Param{channelName} |
| 47 | + result := pegomock.GetGenericMockFrom(mock).Invoke("ChannelExists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) |
| 48 | + var ret0 bool |
| 49 | + var ret1 error |
| 50 | + if len(result) != 0 { |
| 51 | + if result[0] != nil { |
| 52 | + ret0 = result[0].(bool) |
| 53 | + } |
| 54 | + if result[1] != nil { |
| 55 | + ret1 = result[1].(error) |
| 56 | + } |
| 57 | + } |
| 58 | + return ret0, ret1 |
| 59 | +} |
| 60 | + |
| 61 | +func (mock *MockSlackClient) PostMessage(channel string, applyResult webhooks.ApplyResult) error { |
| 62 | + params := []pegomock.Param{channel, applyResult} |
| 63 | + result := pegomock.GetGenericMockFrom(mock).Invoke("PostMessage", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) |
| 64 | + var ret0 error |
| 65 | + if len(result) != 0 { |
| 66 | + if result[0] != nil { |
| 67 | + ret0 = result[0].(error) |
| 68 | + } |
| 69 | + } |
| 70 | + return ret0 |
| 71 | +} |
| 72 | + |
| 73 | +func (mock *MockSlackClient) VerifyWasCalledOnce() *VerifierSlackClient { |
| 74 | + return &VerifierSlackClient{mock, pegomock.Times(1), nil} |
| 75 | +} |
| 76 | + |
| 77 | +func (mock *MockSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierSlackClient { |
| 78 | + return &VerifierSlackClient{mock, invocationCountMatcher, nil} |
| 79 | +} |
| 80 | + |
| 81 | +func (mock *MockSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierSlackClient { |
| 82 | + return &VerifierSlackClient{mock, invocationCountMatcher, inOrderContext} |
| 83 | +} |
| 84 | + |
| 85 | +type VerifierSlackClient struct { |
| 86 | + mock *MockSlackClient |
| 87 | + invocationCountMatcher pegomock.Matcher |
| 88 | + inOrderContext *pegomock.InOrderContext |
| 89 | +} |
| 90 | + |
| 91 | +func (verifier *VerifierSlackClient) AuthTest() *SlackClient_AuthTest_OngoingVerification { |
| 92 | + params := []pegomock.Param{} |
| 93 | + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params) |
| 94 | + return &SlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} |
| 95 | +} |
| 96 | + |
| 97 | +type SlackClient_AuthTest_OngoingVerification struct { |
| 98 | + mock *MockSlackClient |
| 99 | + methodInvocations []pegomock.MethodInvocation |
| 100 | +} |
| 101 | + |
| 102 | +func (c *SlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { |
| 103 | +} |
| 104 | + |
| 105 | +func (c *SlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { |
| 106 | +} |
| 107 | + |
| 108 | +func (verifier *VerifierSlackClient) TokenIsSet() *SlackClient_TokenIsSet_OngoingVerification { |
| 109 | + params := []pegomock.Param{} |
| 110 | + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TokenIsSet", params) |
| 111 | + return &SlackClient_TokenIsSet_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} |
| 112 | +} |
| 113 | + |
| 114 | +type SlackClient_TokenIsSet_OngoingVerification struct { |
| 115 | + mock *MockSlackClient |
| 116 | + methodInvocations []pegomock.MethodInvocation |
| 117 | +} |
| 118 | + |
| 119 | +func (c *SlackClient_TokenIsSet_OngoingVerification) GetCapturedArguments() { |
| 120 | +} |
| 121 | + |
| 122 | +func (c *SlackClient_TokenIsSet_OngoingVerification) GetAllCapturedArguments() { |
| 123 | +} |
| 124 | + |
| 125 | +func (verifier *VerifierSlackClient) ChannelExists(channelName string) *SlackClient_ChannelExists_OngoingVerification { |
| 126 | + params := []pegomock.Param{channelName} |
| 127 | + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ChannelExists", params) |
| 128 | + return &SlackClient_ChannelExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} |
| 129 | +} |
| 130 | + |
| 131 | +type SlackClient_ChannelExists_OngoingVerification struct { |
| 132 | + mock *MockSlackClient |
| 133 | + methodInvocations []pegomock.MethodInvocation |
| 134 | +} |
| 135 | + |
| 136 | +func (c *SlackClient_ChannelExists_OngoingVerification) GetCapturedArguments() string { |
| 137 | + channelName := c.GetAllCapturedArguments() |
| 138 | + return channelName[len(channelName)-1] |
| 139 | +} |
| 140 | + |
| 141 | +func (c *SlackClient_ChannelExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { |
| 142 | + params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) |
| 143 | + if len(params) > 0 { |
| 144 | + _param0 = make([]string, len(params[0])) |
| 145 | + for u, param := range params[0] { |
| 146 | + _param0[u] = param.(string) |
| 147 | + } |
| 148 | + } |
| 149 | + return |
| 150 | +} |
| 151 | + |
| 152 | +func (verifier *VerifierSlackClient) PostMessage(channel string, applyResult webhooks.ApplyResult) *SlackClient_PostMessage_OngoingVerification { |
| 153 | + params := []pegomock.Param{channel, applyResult} |
| 154 | + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", params) |
| 155 | + return &SlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} |
| 156 | +} |
| 157 | + |
| 158 | +type SlackClient_PostMessage_OngoingVerification struct { |
| 159 | + mock *MockSlackClient |
| 160 | + methodInvocations []pegomock.MethodInvocation |
| 161 | +} |
| 162 | + |
| 163 | +func (c *SlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, webhooks.ApplyResult) { |
| 164 | + channel, applyResult := c.GetAllCapturedArguments() |
| 165 | + return channel[len(channel)-1], applyResult[len(applyResult)-1] |
| 166 | +} |
| 167 | + |
| 168 | +func (c *SlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []webhooks.ApplyResult) { |
| 169 | + params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) |
| 170 | + if len(params) > 0 { |
| 171 | + _param0 = make([]string, len(params[0])) |
| 172 | + for u, param := range params[0] { |
| 173 | + _param0[u] = param.(string) |
| 174 | + } |
| 175 | + _param1 = make([]webhooks.ApplyResult, len(params[1])) |
| 176 | + for u, param := range params[1] { |
| 177 | + _param1[u] = param.(webhooks.ApplyResult) |
| 178 | + } |
| 179 | + } |
| 180 | + return |
| 181 | +} |
0 commit comments