From 4c1ddcff10b359baf5728b334acb60cc3e1b1123 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 6 Jul 2018 06:07:09 -0700 Subject: MM-10703 Adding blank request context to plugin hooks for future use. (#9043) * Adding blank request context to plugin hooks for future use. * Rename RequestContext to Context * Adding context to ServeHTTP and ExecuteCommand * Fixing import cycle in test. --- app/plugin_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/plugin_test.go') diff --git a/app/plugin_test.go b/app/plugin_test.go index b0b6e9c1b..02b492d28 100644 --- a/app/plugin_test.go +++ b/app/plugin_test.go @@ -10,6 +10,7 @@ import ( "github.com/gorilla/mux" "github.com/mattermost/mattermost-server/model" + "github.com/mattermost/mattermost-server/plugin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -68,7 +69,7 @@ func TestHandlePluginRequest(t *testing.T) { var assertions func(*http.Request) router := mux.NewRouter() router.HandleFunc("/plugins/{plugin_id:[A-Za-z0-9\\_\\-\\.]+}/{anything:.*}", func(_ http.ResponseWriter, r *http.Request) { - th.App.servePluginRequest(nil, r, func(_ http.ResponseWriter, r *http.Request) { + th.App.servePluginRequest(nil, r, func(_ *plugin.Context, _ http.ResponseWriter, r *http.Request) { assertions(r) }) }) -- cgit v1.2.3-1-g7c22