diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-07-20 12:03:08 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-07-20 09:03:08 -0700 |
commit | 908a682fcf3bbc48db75099f636d627616757b24 (patch) | |
tree | 255879c6545cd16fd6d16adadb55d07b089bcbe4 /plugin/plugintest/api.go | |
parent | 610ac5a53c0f6536ca65ed2fe6e0646b468bd275 (diff) | |
download | chat-908a682fcf3bbc48db75099f636d627616757b24.tar.gz chat-908a682fcf3bbc48db75099f636d627616757b24.tar.bz2 chat-908a682fcf3bbc48db75099f636d627616757b24.zip |
make GetChannelByName take teamId first (#9134)
* make GetChannelByName take teamId first
I think it is more natural to accept `teamId`, then `channelName`,
given the pattern followed by other Plugin API methods and even the SQL
Store itself. The App layer seems unusual in accepting `channelName`
first.
This also re-generates the mocks fixing the parameter order for the
recently added `UserStatus` APIs.
* add GetChannelByNameForTeamName
Diffstat (limited to 'plugin/plugintest/api.go')
-rw-r--r-- | plugin/plugintest/api.go | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index 06ab02560..473ef6d2b 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0 +// Code generated by mockery v1.0.0. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. @@ -308,13 +308,13 @@ func (_m *API) GetChannel(channelId string) (*model.Channel, *model.AppError) { return r0, r1 } -// GetChannelByName provides a mock function with given fields: name, teamId -func (_m *API) GetChannelByName(name string, teamId string) (*model.Channel, *model.AppError) { - ret := _m.Called(name, teamId) +// GetChannelByName provides a mock function with given fields: teamId, name +func (_m *API) GetChannelByName(teamId string, name string) (*model.Channel, *model.AppError) { + ret := _m.Called(teamId, name) var r0 *model.Channel if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { - r0 = rf(name, teamId) + r0 = rf(teamId, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.Channel) @@ -323,7 +323,32 @@ func (_m *API) GetChannelByName(name string, teamId string) (*model.Channel, *mo var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { - r1 = rf(name, teamId) + r1 = rf(teamId, name) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.AppError) + } + } + + return r0, r1 +} + +// GetChannelByNameForTeamName provides a mock function with given fields: teamName, channelName +func (_m *API) GetChannelByNameForTeamName(teamName string, channelName string) (*model.Channel, *model.AppError) { + ret := _m.Called(teamName, channelName) + + var r0 *model.Channel + if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { + r0 = rf(teamName, channelName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Channel) + } + } + + var r1 *model.AppError + if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { + r1 = rf(teamName, channelName) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(*model.AppError) @@ -1067,13 +1092,13 @@ 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) +// UpdateUserStatus provides a mock function with given fields: userId, status +func (_m *API) UpdateUserStatus(userId string, status string) (*model.Status, *model.AppError) { + ret := _m.Called(userId, status) var r0 *model.Status if rf, ok := ret.Get(0).(func(string, string) *model.Status); ok { - r0 = rf(status, userId) + r0 = rf(userId, status) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.Status) @@ -1082,7 +1107,7 @@ func (_m *API) UpdateUserStatus(status string, userId string) (*model.Status, *m var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { - r1 = rf(status, userId) + r1 = rf(userId, status) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(*model.AppError) |