diff options
author | Joram Wilander <jwawilander@gmail.com> | 2018-07-16 15:49:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-16 15:49:26 -0400 |
commit | 275731578e72d2c6e12cfb2fc315d3446474faec (patch) | |
tree | 25df7525ed2244c7dec5be44495b45ffc0ae1023 /plugin/plugintest | |
parent | 88eef609ab712097ff2b13a2ca45c31ea6fa7df2 (diff) | |
download | chat-275731578e72d2c6e12cfb2fc315d3446474faec.tar.gz chat-275731578e72d2c6e12cfb2fc315d3446474faec.tar.bz2 chat-275731578e72d2c6e12cfb2fc315d3446474faec.zip |
MM-10254 Add plugin APIs for getting/updating user statuses (#9101)
* Add plugin APIs for getting/updating user statuses
* Add and update tests
* Updates per feedback
Diffstat (limited to 'plugin/plugintest')
-rw-r--r-- | plugin/plugintest/api.go | 77 | ||||
-rw-r--r-- | plugin/plugintest/hooks.go | 2 |
2 files changed, 77 insertions, 2 deletions
diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index 3ce1d0145..06ab02560 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v1.0.0 // Regenerate this file using `make plugin-mocks`. @@ -674,6 +674,56 @@ func (_m *API) GetUserByUsername(name string) (*model.User, *model.AppError) { return r0, r1 } +// GetUserStatus provides a mock function with given fields: userId +func (_m *API) GetUserStatus(userId string) (*model.Status, *model.AppError) { + ret := _m.Called(userId) + + var r0 *model.Status + if rf, ok := ret.Get(0).(func(string) *model.Status); ok { + r0 = rf(userId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Status) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { + r1 = rf(userId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + +// GetUserStatusesByIds provides a mock function with given fields: userIds +func (_m *API) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { + ret := _m.Called(userIds) + + var r0 []*model.Status + if rf, ok := ret.Get(0).(func([]string) []*model.Status); ok { + r0 = rf(userIds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Status) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok { + r1 = rf(userIds) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + // KVDelete provides a mock function with given fields: key func (_m *API) KVDelete(key string) *model.AppError { ret := _m.Called(key) @@ -1016,3 +1066,28 @@ func (_m *API) UpdateUser(user *model.User) (*model.User, *model.AppError) { return r0, r1 } + +// UpdateUserStatus provides a mock function with given fields: status, userId +func (_m *API) UpdateUserStatus(status string, userId string) (*model.Status, *model.AppError) { + ret := _m.Called(status, userId) + + var r0 *model.Status + if rf, ok := ret.Get(0).(func(string, string) *model.Status); ok { + r0 = rf(status, userId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Status) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { + r1 = rf(status, userId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} diff --git a/plugin/plugintest/hooks.go b/plugin/plugintest/hooks.go index d88792f58..61268c299 100644 --- a/plugin/plugintest/hooks.go +++ b/plugin/plugintest/hooks.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v1.0.0 // Regenerate this file using `make plugin-mocks`. |