Files
mostlymatter/plugin/plugintest/hooks.go
Chris 402491b7e5 PLT-7407: Back-end plugins (#7409)
* tie back-end plugins together

* fix comment typo

* add tests and a bit of polish

* tests and polish

* add test, don't let backend executable paths escape the plugin directory
2017-09-11 10:02:02 -05:00

32 строки
522 B
Go

package plugintest
import (
"net/http"
"github.com/stretchr/testify/mock"
"github.com/mattermost/mattermost-server/plugin"
)
type Hooks struct {
mock.Mock
}
var _ plugin.Hooks = (*Hooks)(nil)
func (m *Hooks) OnActivate(api plugin.API) error {
return m.Called(api).Error(0)
}
func (m *Hooks) OnDeactivate() error {
return m.Called().Error(0)
}
func (m *Hooks) OnConfigurationChange() error {
return m.Called().Error(0)
}
func (m *Hooks) ServeHTTP(w http.ResponseWriter, r *http.Request) {
m.Called(w, r)
}