diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-06-25 12:33:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 12:33:13 -0700 |
commit | 1e5c432e1029601a664454388ae366ef69618d62 (patch) | |
tree | cb9e8bfb66640ac3b29c934bb2c3202d25aeb368 /plugin/plugintest/hooks.go | |
parent | ecefa6cdd1e7376046bbec82c1b47f7756fea646 (diff) | |
download | chat-1e5c432e1029601a664454388ae366ef69618d62.tar.gz chat-1e5c432e1029601a664454388ae366ef69618d62.tar.bz2 chat-1e5c432e1029601a664454388ae366ef69618d62.zip |
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.
* Tweaks from feedback.
Diffstat (limited to 'plugin/plugintest/hooks.go')
-rw-r--r-- | plugin/plugintest/hooks.go | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/plugin/plugintest/hooks.go b/plugin/plugintest/hooks.go index 3de257c76..790a5a993 100644 --- a/plugin/plugintest/hooks.go +++ b/plugin/plugintest/hooks.go @@ -7,7 +7,6 @@ package plugintest import http "net/http" import mock "github.com/stretchr/testify/mock" import model "github.com/mattermost/mattermost-server/model" -import plugin "github.com/mattermost/mattermost-server/plugin" // Hooks is an autogenerated mock type for the Hooks type type Hooks struct { @@ -39,6 +38,29 @@ func (_m *Hooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse return r0, r1 } +// Implemented provides a mock function with given fields: +func (_m *Hooks) Implemented() ([]string, error) { + ret := _m.Called() + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // MessageHasBeenPosted provides a mock function with given fields: post func (_m *Hooks) MessageHasBeenPosted(post *model.Post) { _m.Called(post) @@ -95,13 +117,13 @@ func (_m *Hooks) MessageWillBeUpdated(newPost *model.Post, oldPost *model.Post) return r0, r1 } -// OnActivate provides a mock function with given fields: _a0 -func (_m *Hooks) OnActivate(_a0 plugin.API) error { - ret := _m.Called(_a0) +// OnActivate provides a mock function with given fields: +func (_m *Hooks) OnActivate() error { + ret := _m.Called() var r0 error - if rf, ok := ret.Get(0).(func(plugin.API) error); ok { - r0 = rf(_a0) + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() } else { r0 = ret.Error(0) } @@ -137,7 +159,7 @@ func (_m *Hooks) OnDeactivate() error { return r0 } -// ServeHTTP provides a mock function with given fields: _a0, _a1 -func (_m *Hooks) ServeHTTP(_a0 http.ResponseWriter, _a1 *http.Request) { - _m.Called(_a0, _a1) +// ServeHTTP provides a mock function with given fields: w, r +func (_m *Hooks) ServeHTTP(w http.ResponseWriter, r *http.Request) { + _m.Called(w, r) } |