summaryrefslogtreecommitdiffstats
path: root/api4/apitestlib.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r--api4/apitestlib.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index c6c1dfa94..87a3976f5 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -20,6 +20,7 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
"github.com/mattermost/platform/utils"
+ "github.com/mattermost/platform/wsapi"
s3 "github.com/minio/minio-go"
)
@@ -55,9 +56,11 @@ func SetupEnterprise() *TestHelper {
app.NewServer()
app.InitStores()
InitRouter()
+ wsapi.InitRouter()
app.StartServer()
utils.InitHTML()
InitApi(true)
+ wsapi.InitApi()
utils.EnableDebugLogForTest()
app.Srv.Store.MarkSystemRanUnitTests()
@@ -85,8 +88,10 @@ func Setup() *TestHelper {
app.NewServer()
app.InitStores()
InitRouter()
+ wsapi.InitRouter()
app.StartServer()
InitApi(true)
+ wsapi.InitApi()
utils.EnableDebugLogForTest()
app.Srv.Store.MarkSystemRanUnitTests()
@@ -167,6 +172,10 @@ func (me *TestHelper) CreateClient() *model.Client4 {
return model.NewAPIv4Client("http://localhost" + utils.Cfg.ServiceSettings.ListenAddress)
}
+func (me *TestHelper) CreateWebSocketClient() (*model.WebSocketClient, *model.AppError) {
+ return model.NewWebSocketClient4("ws://localhost"+utils.Cfg.ServiceSettings.ListenAddress, me.Client.AuthToken)
+}
+
func (me *TestHelper) CreateUser() *model.User {
return me.CreateUserWithClient(me.Client)
}