github.com/qichengzx/mattermost-server@v4.5.1-0.20180604164826-2c75247c97d0+incompatible/plugin/plugintest/hooks.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 // Regenerate this file using `make plugin-mocks`. 4 5 package plugintest 6 7 import http "net/http" 8 import mock "github.com/stretchr/testify/mock" 9 import model "github.com/mattermost/mattermost-server/model" 10 import plugin "github.com/mattermost/mattermost-server/plugin" 11 12 // Hooks is an autogenerated mock type for the Hooks type 13 type Hooks struct { 14 mock.Mock 15 } 16 17 // ExecuteCommand provides a mock function with given fields: args 18 func (_m *Hooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { 19 ret := _m.Called(args) 20 21 var r0 *model.CommandResponse 22 if rf, ok := ret.Get(0).(func(*model.CommandArgs) *model.CommandResponse); ok { 23 r0 = rf(args) 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).(*model.CommandResponse) 27 } 28 } 29 30 var r1 *model.AppError 31 if rf, ok := ret.Get(1).(func(*model.CommandArgs) *model.AppError); ok { 32 r1 = rf(args) 33 } else { 34 if ret.Get(1) != nil { 35 r1 = ret.Get(1).(*model.AppError) 36 } 37 } 38 39 return r0, r1 40 } 41 42 // MessageHasBeenPosted provides a mock function with given fields: post 43 func (_m *Hooks) MessageHasBeenPosted(post *model.Post) { 44 _m.Called(post) 45 } 46 47 // MessageHasBeenUpdated provides a mock function with given fields: newPost, oldPost 48 func (_m *Hooks) MessageHasBeenUpdated(newPost *model.Post, oldPost *model.Post) { 49 _m.Called(newPost, oldPost) 50 } 51 52 // MessageWillBePosted provides a mock function with given fields: post 53 func (_m *Hooks) MessageWillBePosted(post *model.Post) (*model.Post, string) { 54 ret := _m.Called(post) 55 56 var r0 *model.Post 57 if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { 58 r0 = rf(post) 59 } else { 60 if ret.Get(0) != nil { 61 r0 = ret.Get(0).(*model.Post) 62 } 63 } 64 65 var r1 string 66 if rf, ok := ret.Get(1).(func(*model.Post) string); ok { 67 r1 = rf(post) 68 } else { 69 r1 = ret.Get(1).(string) 70 } 71 72 return r0, r1 73 } 74 75 // MessageWillBeUpdated provides a mock function with given fields: newPost, oldPost 76 func (_m *Hooks) MessageWillBeUpdated(newPost *model.Post, oldPost *model.Post) (*model.Post, string) { 77 ret := _m.Called(newPost, oldPost) 78 79 var r0 *model.Post 80 if rf, ok := ret.Get(0).(func(*model.Post, *model.Post) *model.Post); ok { 81 r0 = rf(newPost, oldPost) 82 } else { 83 if ret.Get(0) != nil { 84 r0 = ret.Get(0).(*model.Post) 85 } 86 } 87 88 var r1 string 89 if rf, ok := ret.Get(1).(func(*model.Post, *model.Post) string); ok { 90 r1 = rf(newPost, oldPost) 91 } else { 92 r1 = ret.Get(1).(string) 93 } 94 95 return r0, r1 96 } 97 98 // OnActivate provides a mock function with given fields: _a0 99 func (_m *Hooks) OnActivate(_a0 plugin.API) error { 100 ret := _m.Called(_a0) 101 102 var r0 error 103 if rf, ok := ret.Get(0).(func(plugin.API) error); ok { 104 r0 = rf(_a0) 105 } else { 106 r0 = ret.Error(0) 107 } 108 109 return r0 110 } 111 112 // OnConfigurationChange provides a mock function with given fields: 113 func (_m *Hooks) OnConfigurationChange() error { 114 ret := _m.Called() 115 116 var r0 error 117 if rf, ok := ret.Get(0).(func() error); ok { 118 r0 = rf() 119 } else { 120 r0 = ret.Error(0) 121 } 122 123 return r0 124 } 125 126 // OnDeactivate provides a mock function with given fields: 127 func (_m *Hooks) OnDeactivate() error { 128 ret := _m.Called() 129 130 var r0 error 131 if rf, ok := ret.Get(0).(func() error); ok { 132 r0 = rf() 133 } else { 134 r0 = ret.Error(0) 135 } 136 137 return r0 138 } 139 140 // ServeHTTP provides a mock function with given fields: _a0, _a1 141 func (_m *Hooks) ServeHTTP(_a0 http.ResponseWriter, _a1 *http.Request) { 142 _m.Called(_a0, _a1) 143 }