MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)

* Generate and use an interface instead of *App
Этот коммит содержится в:
Eli Yukelzon
2020-02-13 13:26:58 +01:00
коммит произвёл GitHub
родитель 66fc096768
Коммит 17523fa5d9
200 изменённых файлов: 4553 добавлений и 2361 удалений

Просмотреть файл

@@ -26,7 +26,7 @@ var ApiClient *model.Client4
var URL string
type TestHelper struct {
App *app.App
App app.AppIface
Server *app.Server
Web *Web
@@ -75,12 +75,12 @@ func Setup(tb testing.TB) *TestHelper {
})
web := New(s, s.AppOptions, s.Router)
URL = fmt.Sprintf("http://localhost:%v", a.Srv.ListenAddr.Port)
URL = fmt.Sprintf("http://localhost:%v", a.Srv().ListenAddr.Port)
ApiClient = model.NewAPIv4Client(URL)
a.DoAppMigrations()
a.Srv.Store.MarkSystemRanUnitTests()
a.Srv().Store.MarkSystemRanUnitTests()
a.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.EnableOpenServer = true
@@ -226,7 +226,7 @@ func TestPublicFilesRequest(t *testing.T) {
defer os.RemoveAll(pluginDir)
defer os.RemoveAll(webappPluginDir)
env, err := plugin.NewEnvironment(th.App.NewPluginAPI, pluginDir, webappPluginDir, th.App.Log)
env, err := plugin.NewEnvironment(th.App.NewPluginAPI, pluginDir, webappPluginDir, th.App.Log())
require.NoError(t, err)
pluginID := "com.mattermost.sample"