diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-26 11:36:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-26 11:36:54 -0500 |
commit | 6f6005c617799e2f51071f43af718e5d4e77492b (patch) | |
tree | 0928b6705aa5db61d73845d28436e909d2b273a2 /jobs/server_test.go | |
parent | ab7e5b35d88dd0ae403c1f656fd72e9a3b46cdab (diff) | |
download | chat-6f6005c617799e2f51071f43af718e5d4e77492b.tar.gz chat-6f6005c617799e2f51071f43af718e5d4e77492b.tar.bz2 chat-6f6005c617799e2f51071f43af718e5d4e77492b.zip |
Store mocks (#7724)
* store mocks
* add example
Diffstat (limited to 'jobs/server_test.go')
-rw-r--r-- | jobs/server_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/jobs/server_test.go b/jobs/server_test.go new file mode 100644 index 000000000..3b5ef6f3d --- /dev/null +++ b/jobs/server_test.go @@ -0,0 +1,39 @@ +// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package jobs + +import ( + "testing" + + "github.com/mattermost/mattermost-server/model" + "github.com/mattermost/mattermost-server/store" + "github.com/mattermost/mattermost-server/store/storetest" + "github.com/mattermost/mattermost-server/utils" +) + +func TestJobServer_LoadLicense(t *testing.T) { + if utils.T == nil { + utils.TranslationsPreInit() + } + + mockStore := &storetest.Store{} + defer mockStore.AssertExpectations(t) + + server := &JobServer{ + Store: mockStore, + } + + mockStore.SystemStore.On("Get").Return(storetest.NewStoreChannel(store.StoreResult{ + Data: model.StringMap{ + model.SYSTEM_ACTIVE_LICENSE_ID: "thelicenseid00000000000000", + }, + })) + mockStore.LicenseStore.On("Get", "thelicenseid00000000000000").Return(storetest.NewStoreChannel(store.StoreResult{ + Data: &model.LicenseRecord{ + Id: "thelicenseid00000000000000", + }, + })) + + server.LoadLicense() +} |