mirror of
https://github.com/nikoksr/notify.git
synced 2025-02-19 19:00:14 +02:00
199 lines
5.8 KiB
Go
199 lines
5.8 KiB
Go
// Code generated by mockery v2.43.2. DO NOT EDIT.
|
|
|
|
package mattermost
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
http "github.com/nikoksr/notify/service/http"
|
|
)
|
|
|
|
// mockhttpClient is an autogenerated mock type for the httpClient type
|
|
type mockhttpClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type mockhttpClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *mockhttpClient) EXPECT() *mockhttpClient_Expecter {
|
|
return &mockhttpClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// AddReceivers provides a mock function with given fields: wh
|
|
func (_m *mockhttpClient) AddReceivers(wh ...*http.Webhook) {
|
|
_va := make([]interface{}, len(wh))
|
|
for _i := range wh {
|
|
_va[_i] = wh[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, _va...)
|
|
_m.Called(_ca...)
|
|
}
|
|
|
|
// mockhttpClient_AddReceivers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddReceivers'
|
|
type mockhttpClient_AddReceivers_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// AddReceivers is a helper method to define mock.On call
|
|
// - wh ...*http.Webhook
|
|
func (_e *mockhttpClient_Expecter) AddReceivers(wh ...interface{}) *mockhttpClient_AddReceivers_Call {
|
|
return &mockhttpClient_AddReceivers_Call{Call: _e.mock.On("AddReceivers",
|
|
append([]interface{}{}, wh...)...)}
|
|
}
|
|
|
|
func (_c *mockhttpClient_AddReceivers_Call) Run(run func(wh ...*http.Webhook)) *mockhttpClient_AddReceivers_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
variadicArgs := make([]*http.Webhook, len(args)-0)
|
|
for i, a := range args[0:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(*http.Webhook)
|
|
}
|
|
}
|
|
run(variadicArgs...)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_AddReceivers_Call) Return() *mockhttpClient_AddReceivers_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_AddReceivers_Call) RunAndReturn(run func(...*http.Webhook)) *mockhttpClient_AddReceivers_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// PostSend provides a mock function with given fields: postfn
|
|
func (_m *mockhttpClient) PostSend(postfn http.PostSendHookFn) {
|
|
_m.Called(postfn)
|
|
}
|
|
|
|
// mockhttpClient_PostSend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostSend'
|
|
type mockhttpClient_PostSend_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// PostSend is a helper method to define mock.On call
|
|
// - postfn http.PostSendHookFn
|
|
func (_e *mockhttpClient_Expecter) PostSend(postfn interface{}) *mockhttpClient_PostSend_Call {
|
|
return &mockhttpClient_PostSend_Call{Call: _e.mock.On("PostSend", postfn)}
|
|
}
|
|
|
|
func (_c *mockhttpClient_PostSend_Call) Run(run func(postfn http.PostSendHookFn)) *mockhttpClient_PostSend_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(http.PostSendHookFn))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_PostSend_Call) Return() *mockhttpClient_PostSend_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_PostSend_Call) RunAndReturn(run func(http.PostSendHookFn)) *mockhttpClient_PostSend_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// PreSend provides a mock function with given fields: prefn
|
|
func (_m *mockhttpClient) PreSend(prefn http.PreSendHookFn) {
|
|
_m.Called(prefn)
|
|
}
|
|
|
|
// mockhttpClient_PreSend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreSend'
|
|
type mockhttpClient_PreSend_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// PreSend is a helper method to define mock.On call
|
|
// - prefn http.PreSendHookFn
|
|
func (_e *mockhttpClient_Expecter) PreSend(prefn interface{}) *mockhttpClient_PreSend_Call {
|
|
return &mockhttpClient_PreSend_Call{Call: _e.mock.On("PreSend", prefn)}
|
|
}
|
|
|
|
func (_c *mockhttpClient_PreSend_Call) Run(run func(prefn http.PreSendHookFn)) *mockhttpClient_PreSend_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(http.PreSendHookFn))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_PreSend_Call) Return() *mockhttpClient_PreSend_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_PreSend_Call) RunAndReturn(run func(http.PreSendHookFn)) *mockhttpClient_PreSend_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Send provides a mock function with given fields: ctx, subject, message
|
|
func (_m *mockhttpClient) Send(ctx context.Context, subject string, message string) error {
|
|
ret := _m.Called(ctx, subject, message)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Send")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, subject, message)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// mockhttpClient_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
|
|
type mockhttpClient_Send_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Send is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - subject string
|
|
// - message string
|
|
func (_e *mockhttpClient_Expecter) Send(ctx interface{}, subject interface{}, message interface{}) *mockhttpClient_Send_Call {
|
|
return &mockhttpClient_Send_Call{Call: _e.mock.On("Send", ctx, subject, message)}
|
|
}
|
|
|
|
func (_c *mockhttpClient_Send_Call) Run(run func(ctx context.Context, subject string, message string)) *mockhttpClient_Send_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_Send_Call) Return(_a0 error) *mockhttpClient_Send_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockhttpClient_Send_Call) RunAndReturn(run func(context.Context, string, string) error) *mockhttpClient_Send_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// newMockhttpClient creates a new instance of mockhttpClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func newMockhttpClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *mockhttpClient {
|
|
mock := &mockhttpClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|