mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
add plugin mock to TestUnitUpdateConfig
This commit is contained in:
parent
202aface50
commit
3ec5419092
2 changed files with 4 additions and 5 deletions
|
|
@ -41,6 +41,9 @@ func TestUnitUpdateConfig(t *testing.T) {
|
|||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
pluginMock := mocks.PluginStore{}
|
||||
pluginMock.On("Get", mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&model.PluginKeyValue{}, nil)
|
||||
|
||||
mockStore := th.App.Srv().Store().(*mocks.Store)
|
||||
mockUserStore := mocks.UserStore{}
|
||||
mockUserStore.On("Count", mock.Anything).Return(int64(10), nil)
|
||||
|
|
@ -57,6 +60,7 @@ func TestUnitUpdateConfig(t *testing.T) {
|
|||
mockStore.On("System").Return(&mockSystemStore)
|
||||
mockStore.On("License").Return(&mockLicenseStore)
|
||||
mockStore.On("GetDBSchemaVersion").Return(1, nil)
|
||||
mockStore.On("Plugin").Return(&pluginMock).Maybe()
|
||||
|
||||
prev := *th.App.Config().ServiceSettings.SiteURL
|
||||
|
||||
|
|
|
|||
|
|
@ -177,14 +177,9 @@ func SetupWithStoreMock(tb testing.TB) *TestHelper {
|
|||
statusMock.On("Get", "user1").Return(&model.Status{UserId: "user1", Status: model.StatusOnline}, nil)
|
||||
statusMock.On("UpdateLastActivityAt", "user1", mock.Anything).Return(nil)
|
||||
statusMock.On("SaveOrUpdate", mock.AnythingOfType("*model.Status")).Return(nil)
|
||||
|
||||
pluginMock := mocks.PluginStore{}
|
||||
pluginMock.On("Get", mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(&model.PluginKeyValue{}, nil)
|
||||
|
||||
emptyMockStore := mocks.Store{}
|
||||
emptyMockStore.On("Close").Return(nil)
|
||||
emptyMockStore.On("Status").Return(&statusMock)
|
||||
emptyMockStore.On("Plugin").Return(&pluginMock).Maybe()
|
||||
th.App.Srv().SetStore(&emptyMockStore)
|
||||
|
||||
return th
|
||||
|
|
|
|||
Loading…
Reference in a new issue