MM-10658 Change config fields to pointers (#9033)

* MM 10658 Change config fields to pointers (#8898)

* Change fields of config structs to pointers and set defaults

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix tests that go broken during switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Apply changes of current master while switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix new config pointer uses

* Fix app tests

* Fix mail test

* remove debugging statement

* fix TestUpdateConfig

* assign config consistently

* initialize AmazonS3Region in TestS3TestConnection

* initialize fields for TestEmailTest

* fix TestCheckMandatoryS3Fields
Этот коммит содержится в:
Joram Wilander
2019-01-31 08:12:01 -05:00
коммит произвёл GitHub
родитель 0c981aa010
Коммит 2ca222033c
53 изменённых файлов: 729 добавлений и 516 удалений

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

@@ -127,7 +127,7 @@ func TestHandleCommandResponsePost(t *testing.T) {
assert.NotEqual(t, args.ChannelId, post.ChannelId)
// Override username config is turned off. No override should occur.
th.App.Config().ServiceSettings.EnablePostUsernameOverride = false
*th.App.Config().ServiceSettings.EnablePostUsernameOverride = false
resp.ChannelId = ""
command.Username = "Command username"
resp.Username = "Response username"
@@ -136,7 +136,7 @@ func TestHandleCommandResponsePost(t *testing.T) {
assert.Nil(t, err)
assert.Nil(t, post.Props["override_username"])
th.App.Config().ServiceSettings.EnablePostUsernameOverride = true
*th.App.Config().ServiceSettings.EnablePostUsernameOverride = true
// Override username config is turned on. Override username through command property.
post, err = th.App.HandleCommandResponsePost(command, args, resp, builtIn)
@@ -152,10 +152,10 @@ func TestHandleCommandResponsePost(t *testing.T) {
assert.Equal(t, resp.Username, post.Props["override_username"])
assert.Equal(t, "true", post.Props["from_webhook"])
th.App.Config().ServiceSettings.EnablePostUsernameOverride = false
*th.App.Config().ServiceSettings.EnablePostUsernameOverride = false
// Override icon url config is turned off. No override should occur.
th.App.Config().ServiceSettings.EnablePostIconOverride = false
*th.App.Config().ServiceSettings.EnablePostIconOverride = false
command.IconURL = "Command icon url"
resp.IconURL = "Response icon url"
@@ -163,7 +163,7 @@ func TestHandleCommandResponsePost(t *testing.T) {
assert.Nil(t, err)
assert.Nil(t, post.Props["override_icon_url"])
th.App.Config().ServiceSettings.EnablePostIconOverride = true
*th.App.Config().ServiceSettings.EnablePostIconOverride = true
// Override icon url config is turned on. Override icon url through command property.
post, err = th.App.HandleCommandResponsePost(command, args, resp, builtIn)