summaryrefslogtreecommitdiffstats
path: root/plugin/plugintest/hooks.go
blob: b0053a1ad1d628ff9768ca80fbd924040b8f391d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	m.Called(w, r)
}