diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go index a7948cfd4b..b92bc3288d 100644 --- a/plugin/plugintest/api.go +++ b/plugin/plugintest/api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. @@ -23,6 +23,10 @@ func (_m *API) AddChannelMember(channelId string, userID string) (*model.Channel ret := _m.Called(channelId, userID) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelMember, *model.AppError)); ok { + return rf(channelId, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok { r0 = rf(channelId, userID) } else { @@ -31,7 +35,6 @@ func (_m *API) AddChannelMember(channelId string, userID string) (*model.Channel } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(channelId, userID) } else { @@ -48,6 +51,10 @@ func (_m *API) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.Ap ret := _m.Called(reaction) var r0 *model.Reaction + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, *model.AppError)); ok { + return rf(reaction) + } if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok { r0 = rf(reaction) } else { @@ -56,7 +63,6 @@ func (_m *API) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.Ap } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Reaction) *model.AppError); ok { r1 = rf(reaction) } else { @@ -73,6 +79,10 @@ func (_m *API) AddUserToChannel(channelId string, userID string, asUserId string ret := _m.Called(channelId, userID, asUserId) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, string) (*model.ChannelMember, *model.AppError)); ok { + return rf(channelId, userID, asUserId) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.ChannelMember); ok { r0 = rf(channelId, userID, asUserId) } else { @@ -81,7 +91,6 @@ func (_m *API) AddUserToChannel(channelId string, userID string, asUserId string } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok { r1 = rf(channelId, userID, asUserId) } else { @@ -98,6 +107,10 @@ func (_m *API) CopyFileInfos(userID string, fileIds []string) ([]string, *model. ret := _m.Called(userID, fileIds) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string) ([]string, *model.AppError)); ok { + return rf(userID, fileIds) + } if rf, ok := ret.Get(0).(func(string, []string) []string); ok { r0 = rf(userID, fileIds) } else { @@ -106,7 +119,6 @@ func (_m *API) CopyFileInfos(userID string, fileIds []string) ([]string, *model. } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok { r1 = rf(userID, fileIds) } else { @@ -123,6 +135,10 @@ func (_m *API) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) { ret := _m.Called(bot) var r0 *model.Bot + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Bot) (*model.Bot, *model.AppError)); ok { + return rf(bot) + } if rf, ok := ret.Get(0).(func(*model.Bot) *model.Bot); ok { r0 = rf(bot) } else { @@ -131,7 +147,6 @@ func (_m *API) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Bot) *model.AppError); ok { r1 = rf(bot) } else { @@ -148,6 +163,10 @@ func (_m *API) CreateChannel(channel *model.Channel) (*model.Channel, *model.App ret := _m.Called(channel) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Channel) (*model.Channel, *model.AppError)); ok { + return rf(channel) + } if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok { r0 = rf(channel) } else { @@ -156,7 +175,6 @@ func (_m *API) CreateChannel(channel *model.Channel) (*model.Channel, *model.App } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok { r1 = rf(channel) } else { @@ -173,6 +191,10 @@ func (_m *API) CreateChannelSidebarCategory(userID string, teamID string, newCat ret := _m.Called(userID, teamID, newCategory) var r0 *model.SidebarCategoryWithChannels + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)); ok { + return rf(userID, teamID, newCategory) + } if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) *model.SidebarCategoryWithChannels); ok { r0 = rf(userID, teamID, newCategory) } else { @@ -181,7 +203,6 @@ func (_m *API) CreateChannelSidebarCategory(userID string, teamID string, newCat } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, *model.SidebarCategoryWithChannels) *model.AppError); ok { r1 = rf(userID, teamID, newCategory) } else { @@ -198,6 +219,10 @@ func (_m *API) CreateCommand(cmd *model.Command) (*model.Command, error) { ret := _m.Called(cmd) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(*model.Command) (*model.Command, error)); ok { + return rf(cmd) + } if rf, ok := ret.Get(0).(func(*model.Command) *model.Command); ok { r0 = rf(cmd) } else { @@ -206,7 +231,6 @@ func (_m *API) CreateCommand(cmd *model.Command) (*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Command) error); ok { r1 = rf(cmd) } else { @@ -221,6 +245,10 @@ func (_m *API) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppE ret := _m.Called(app) var r0 *model.OAuthApp + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, *model.AppError)); ok { + return rf(app) + } if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok { r0 = rf(app) } else { @@ -229,7 +257,6 @@ func (_m *API) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppE } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.OAuthApp) *model.AppError); ok { r1 = rf(app) } else { @@ -246,6 +273,10 @@ func (_m *API) CreatePost(post *model.Post) (*model.Post, *model.AppError) { ret := _m.Called(post) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, *model.AppError)); ok { + return rf(post) + } if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { r0 = rf(post) } else { @@ -254,7 +285,6 @@ func (_m *API) CreatePost(post *model.Post) (*model.Post, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok { r1 = rf(post) } else { @@ -271,6 +301,10 @@ func (_m *API) CreateSession(session *model.Session) (*model.Session, *model.App ret := _m.Called(session) var r0 *model.Session + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Session) (*model.Session, *model.AppError)); ok { + return rf(session) + } if rf, ok := ret.Get(0).(func(*model.Session) *model.Session); ok { r0 = rf(session) } else { @@ -279,7 +313,6 @@ func (_m *API) CreateSession(session *model.Session) (*model.Session, *model.App } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Session) *model.AppError); ok { r1 = rf(session) } else { @@ -296,6 +329,10 @@ func (_m *API) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { ret := _m.Called(team) var r0 *model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, *model.AppError)); ok { + return rf(team) + } if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { r0 = rf(team) } else { @@ -304,7 +341,6 @@ func (_m *API) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok { r1 = rf(team) } else { @@ -321,6 +357,10 @@ func (_m *API) CreateTeamMember(teamID string, userID string) (*model.TeamMember ret := _m.Called(teamID, userID) var r0 *model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.TeamMember, *model.AppError)); ok { + return rf(teamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.TeamMember); ok { r0 = rf(teamID, userID) } else { @@ -329,7 +369,6 @@ func (_m *API) CreateTeamMember(teamID string, userID string) (*model.TeamMember } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(teamID, userID) } else { @@ -346,6 +385,10 @@ func (_m *API) CreateTeamMembers(teamID string, userIds []string, requestorId st ret := _m.Called(teamID, userIds, requestorId) var r0 []*model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string, string) ([]*model.TeamMember, *model.AppError)); ok { + return rf(teamID, userIds, requestorId) + } if rf, ok := ret.Get(0).(func(string, []string, string) []*model.TeamMember); ok { r0 = rf(teamID, userIds, requestorId) } else { @@ -354,7 +397,6 @@ func (_m *API) CreateTeamMembers(teamID string, userIds []string, requestorId st } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string, string) *model.AppError); ok { r1 = rf(teamID, userIds, requestorId) } else { @@ -371,6 +413,10 @@ func (_m *API) CreateTeamMembersGracefully(teamID string, userIds []string, requ ret := _m.Called(teamID, userIds, requestorId) var r0 []*model.TeamMemberWithError + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string, string) ([]*model.TeamMemberWithError, *model.AppError)); ok { + return rf(teamID, userIds, requestorId) + } if rf, ok := ret.Get(0).(func(string, []string, string) []*model.TeamMemberWithError); ok { r0 = rf(teamID, userIds, requestorId) } else { @@ -379,7 +425,6 @@ func (_m *API) CreateTeamMembersGracefully(teamID string, userIds []string, requ } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string, string) *model.AppError); ok { r1 = rf(teamID, userIds, requestorId) } else { @@ -396,6 +441,10 @@ func (_m *API) CreateUploadSession(us *model.UploadSession) (*model.UploadSessio ret := _m.Called(us) var r0 *model.UploadSession + var r1 error + if rf, ok := ret.Get(0).(func(*model.UploadSession) (*model.UploadSession, error)); ok { + return rf(us) + } if rf, ok := ret.Get(0).(func(*model.UploadSession) *model.UploadSession); ok { r0 = rf(us) } else { @@ -404,7 +453,6 @@ func (_m *API) CreateUploadSession(us *model.UploadSession) (*model.UploadSessio } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UploadSession) error); ok { r1 = rf(us) } else { @@ -419,6 +467,10 @@ func (_m *API) CreateUser(user *model.User) (*model.User, *model.AppError) { ret := _m.Called(user) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.User) (*model.User, *model.AppError)); ok { + return rf(user) + } if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok { r0 = rf(user) } else { @@ -427,7 +479,6 @@ func (_m *API) CreateUser(user *model.User) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok { r1 = rf(user) } else { @@ -444,6 +495,10 @@ func (_m *API) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserA ret := _m.Called(token) var r0 *model.UserAccessToken + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.UserAccessToken) (*model.UserAccessToken, *model.AppError)); ok { + return rf(token) + } if rf, ok := ret.Get(0).(func(*model.UserAccessToken) *model.UserAccessToken); ok { r0 = rf(token) } else { @@ -452,7 +507,6 @@ func (_m *API) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserA } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.UserAccessToken) *model.AppError); ok { r1 = rf(token) } else { @@ -648,13 +702,16 @@ func (_m *API) EnsureBotUser(bot *model.Bot) (string, error) { ret := _m.Called(bot) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*model.Bot) (string, error)); ok { + return rf(bot) + } if rf, ok := ret.Get(0).(func(*model.Bot) string); ok { r0 = rf(bot) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*model.Bot) error); ok { r1 = rf(bot) } else { @@ -669,6 +726,10 @@ func (_m *API) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.Comma ret := _m.Called(commandArgs) var r0 *model.CommandResponse + var r1 error + if rf, ok := ret.Get(0).(func(*model.CommandArgs) (*model.CommandResponse, error)); ok { + return rf(commandArgs) + } if rf, ok := ret.Get(0).(func(*model.CommandArgs) *model.CommandResponse); ok { r0 = rf(commandArgs) } else { @@ -677,7 +738,6 @@ func (_m *API) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.Comma } } - var r1 error if rf, ok := ret.Get(1).(func(*model.CommandArgs) error); ok { r1 = rf(commandArgs) } else { @@ -708,6 +768,10 @@ func (_m *API) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model ret := _m.Called(botUserId, includeDeleted) var r0 *model.Bot + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, bool) (*model.Bot, *model.AppError)); ok { + return rf(botUserId, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, bool) *model.Bot); ok { r0 = rf(botUserId, includeDeleted) } else { @@ -716,7 +780,6 @@ func (_m *API) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok { r1 = rf(botUserId, includeDeleted) } else { @@ -733,6 +796,10 @@ func (_m *API) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppEr ret := _m.Called(options) var r0 []*model.Bot + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.BotGetOptions) ([]*model.Bot, *model.AppError)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.BotGetOptions) []*model.Bot); ok { r0 = rf(options) } else { @@ -741,7 +808,6 @@ func (_m *API) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppEr } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.BotGetOptions) *model.AppError); ok { r1 = rf(options) } else { @@ -758,13 +824,16 @@ func (_m *API) GetBundlePath() (string, error) { ret := _m.Called() var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -779,6 +848,10 @@ func (_m *API) GetChannel(channelId string) (*model.Channel, *model.AppError) { ret := _m.Called(channelId) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Channel, *model.AppError)); ok { + return rf(channelId) + } if rf, ok := ret.Get(0).(func(string) *model.Channel); ok { r0 = rf(channelId) } else { @@ -787,7 +860,6 @@ func (_m *API) GetChannel(channelId string) (*model.Channel, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(channelId) } else { @@ -804,6 +876,10 @@ func (_m *API) GetChannelByName(teamID string, name string, includeDeleted bool) ret := _m.Called(teamID, name, includeDeleted) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, *model.AppError)); ok { + return rf(teamID, name, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok { r0 = rf(teamID, name, includeDeleted) } else { @@ -812,7 +888,6 @@ func (_m *API) GetChannelByName(teamID string, name string, includeDeleted bool) } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok { r1 = rf(teamID, name, includeDeleted) } else { @@ -829,6 +904,10 @@ func (_m *API) GetChannelByNameForTeamName(teamName string, channelName string, ret := _m.Called(teamName, channelName, includeDeleted) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, *model.AppError)); ok { + return rf(teamName, channelName, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok { r0 = rf(teamName, channelName, includeDeleted) } else { @@ -837,7 +916,6 @@ func (_m *API) GetChannelByNameForTeamName(teamName string, channelName string, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok { r1 = rf(teamName, channelName, includeDeleted) } else { @@ -854,6 +932,10 @@ func (_m *API) GetChannelMember(channelId string, userID string) (*model.Channel ret := _m.Called(channelId, userID) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelMember, *model.AppError)); ok { + return rf(channelId, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok { r0 = rf(channelId, userID) } else { @@ -862,7 +944,6 @@ func (_m *API) GetChannelMember(channelId string, userID string) (*model.Channel } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(channelId, userID) } else { @@ -879,6 +960,10 @@ func (_m *API) GetChannelMembers(channelId string, page int, perPage int) (model ret := _m.Called(channelId, page, perPage) var r0 model.ChannelMembers + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelMembers, *model.AppError)); ok { + return rf(channelId, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelMembers); ok { r0 = rf(channelId, page, perPage) } else { @@ -887,7 +972,6 @@ func (_m *API) GetChannelMembers(channelId string, page int, perPage int) (model } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(channelId, page, perPage) } else { @@ -904,6 +988,10 @@ func (_m *API) GetChannelMembersByIds(channelId string, userIds []string) (model ret := _m.Called(channelId, userIds) var r0 model.ChannelMembers + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string) (model.ChannelMembers, *model.AppError)); ok { + return rf(channelId, userIds) + } if rf, ok := ret.Get(0).(func(string, []string) model.ChannelMembers); ok { r0 = rf(channelId, userIds) } else { @@ -912,7 +1000,6 @@ func (_m *API) GetChannelMembersByIds(channelId string, userIds []string) (model } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok { r1 = rf(channelId, userIds) } else { @@ -929,6 +1016,10 @@ func (_m *API) GetChannelMembersForUser(teamID string, userID string, page int, ret := _m.Called(teamID, userID, page, perPage) var r0 []*model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.ChannelMember, *model.AppError)); ok { + return rf(teamID, userID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.ChannelMember); ok { r0 = rf(teamID, userID, page, perPage) } else { @@ -937,7 +1028,6 @@ func (_m *API) GetChannelMembersForUser(teamID string, userID string, page int, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok { r1 = rf(teamID, userID, page, perPage) } else { @@ -954,6 +1044,10 @@ func (_m *API) GetChannelSidebarCategories(userID string, teamID string) (*model ret := _m.Called(userID, teamID) var r0 *model.OrderedSidebarCategories + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.OrderedSidebarCategories, *model.AppError)); ok { + return rf(userID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) *model.OrderedSidebarCategories); ok { r0 = rf(userID, teamID) } else { @@ -962,7 +1056,6 @@ func (_m *API) GetChannelSidebarCategories(userID string, teamID string) (*model } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(userID, teamID) } else { @@ -979,6 +1072,10 @@ func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.Ap ret := _m.Called(channelId) var r0 *model.ChannelStats + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.ChannelStats, *model.AppError)); ok { + return rf(channelId) + } if rf, ok := ret.Get(0).(func(string) *model.ChannelStats); ok { r0 = rf(channelId) } else { @@ -987,7 +1084,6 @@ func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.Ap } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(channelId) } else { @@ -1004,6 +1100,10 @@ func (_m *API) GetChannelsForTeamForUser(teamID string, userID string, includeDe ret := _m.Called(teamID, userID, includeDeleted) var r0 []*model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, bool) ([]*model.Channel, *model.AppError)); ok { + return rf(teamID, userID, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, bool) []*model.Channel); ok { r0 = rf(teamID, userID, includeDeleted) } else { @@ -1012,7 +1112,6 @@ func (_m *API) GetChannelsForTeamForUser(teamID string, userID string, includeDe } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok { r1 = rf(teamID, userID, includeDeleted) } else { @@ -1029,6 +1128,10 @@ func (_m *API) GetCloudLimits() (*model.ProductLimits, error) { ret := _m.Called() var r0 *model.ProductLimits + var r1 error + if rf, ok := ret.Get(0).(func() (*model.ProductLimits, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *model.ProductLimits); ok { r0 = rf() } else { @@ -1037,7 +1140,6 @@ func (_m *API) GetCloudLimits() (*model.ProductLimits, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -1052,6 +1154,10 @@ func (_m *API) GetCommand(commandID string) (*model.Command, error) { ret := _m.Called(commandID) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Command, error)); ok { + return rf(commandID) + } if rf, ok := ret.Get(0).(func(string) *model.Command); ok { r0 = rf(commandID) } else { @@ -1060,7 +1166,6 @@ func (_m *API) GetCommand(commandID string) (*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(commandID) } else { @@ -1105,6 +1210,10 @@ func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, ret := _m.Called(userId1, userId2) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.Channel, *model.AppError)); ok { + return rf(userId1, userId2) + } if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { r0 = rf(userId1, userId2) } else { @@ -1113,7 +1222,6 @@ func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(userId1, userId2) } else { @@ -1130,6 +1238,10 @@ func (_m *API) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { ret := _m.Called(emojiId) var r0 *model.Emoji + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Emoji, *model.AppError)); ok { + return rf(emojiId) + } if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok { r0 = rf(emojiId) } else { @@ -1138,7 +1250,6 @@ func (_m *API) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(emojiId) } else { @@ -1155,6 +1266,10 @@ func (_m *API) GetEmojiByName(name string) (*model.Emoji, *model.AppError) { ret := _m.Called(name) var r0 *model.Emoji + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Emoji, *model.AppError)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok { r0 = rf(name) } else { @@ -1163,7 +1278,6 @@ func (_m *API) GetEmojiByName(name string) (*model.Emoji, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(name) } else { @@ -1180,6 +1294,11 @@ func (_m *API) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { ret := _m.Called(emojiId) var r0 []byte + var r1 string + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, string, *model.AppError)); ok { + return rf(emojiId) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(emojiId) } else { @@ -1188,14 +1307,12 @@ func (_m *API) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { } } - var r1 string if rf, ok := ret.Get(1).(func(string) string); ok { r1 = rf(emojiId) } else { r1 = ret.Get(1).(string) } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(string) *model.AppError); ok { r2 = rf(emojiId) } else { @@ -1212,6 +1329,10 @@ func (_m *API) GetEmojiList(sortBy string, page int, perPage int) ([]*model.Emoj ret := _m.Called(sortBy, page, perPage) var r0 []*model.Emoji + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Emoji, *model.AppError)); ok { + return rf(sortBy, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Emoji); ok { r0 = rf(sortBy, page, perPage) } else { @@ -1220,7 +1341,6 @@ func (_m *API) GetEmojiList(sortBy string, page int, perPage int) ([]*model.Emoj } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(sortBy, page, perPage) } else { @@ -1237,6 +1357,10 @@ func (_m *API) GetFile(fileId string) ([]byte, *model.AppError) { ret := _m.Called(fileId) var r0 []byte + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok { + return rf(fileId) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(fileId) } else { @@ -1245,7 +1369,6 @@ func (_m *API) GetFile(fileId string) ([]byte, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(fileId) } else { @@ -1262,6 +1385,10 @@ func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { ret := _m.Called(fileId) var r0 *model.FileInfo + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.FileInfo, *model.AppError)); ok { + return rf(fileId) + } if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok { r0 = rf(fileId) } else { @@ -1270,7 +1397,6 @@ func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(fileId) } else { @@ -1287,6 +1413,10 @@ func (_m *API) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOption ret := _m.Called(page, perPage, opt) var r0 []*model.FileInfo + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)); ok { + return rf(page, perPage, opt) + } if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) []*model.FileInfo); ok { r0 = rf(page, perPage, opt) } else { @@ -1295,7 +1425,6 @@ func (_m *API) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOption } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(int, int, *model.GetFileInfosOptions) *model.AppError); ok { r1 = rf(page, perPage, opt) } else { @@ -1312,13 +1441,16 @@ func (_m *API) GetFileLink(fileId string) (string, *model.AppError) { ret := _m.Called(fileId) var r0 string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (string, *model.AppError)); ok { + return rf(fileId) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(fileId) } else { r0 = ret.Get(0).(string) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(fileId) } else { @@ -1335,6 +1467,10 @@ func (_m *API) GetGroup(groupId string) (*model.Group, *model.AppError) { ret := _m.Called(groupId) var r0 *model.Group + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok { + return rf(groupId) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(groupId) } else { @@ -1343,7 +1479,6 @@ func (_m *API) GetGroup(groupId string) (*model.Group, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(groupId) } else { @@ -1360,6 +1495,10 @@ func (_m *API) GetGroupByName(name string) (*model.Group, *model.AppError) { ret := _m.Called(name) var r0 *model.Group + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(name) } else { @@ -1368,7 +1507,6 @@ func (_m *API) GetGroupByName(name string) (*model.Group, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(name) } else { @@ -1385,6 +1523,10 @@ func (_m *API) GetGroupChannel(userIds []string) (*model.Channel, *model.AppErro ret := _m.Called(userIds) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func([]string) (*model.Channel, *model.AppError)); ok { + return rf(userIds) + } if rf, ok := ret.Get(0).(func([]string) *model.Channel); ok { r0 = rf(userIds) } else { @@ -1393,7 +1535,6 @@ func (_m *API) GetGroupChannel(userIds []string) (*model.Channel, *model.AppErro } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok { r1 = rf(userIds) } else { @@ -1410,6 +1551,10 @@ func (_m *API) GetGroupMemberUsers(groupID string, page int, perPage int) ([]*mo ret := _m.Called(groupID, page, perPage) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.User, *model.AppError)); ok { + return rf(groupID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok { r0 = rf(groupID, page, perPage) } else { @@ -1418,7 +1563,6 @@ func (_m *API) GetGroupMemberUsers(groupID string, page int, perPage int) ([]*mo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(groupID, page, perPage) } else { @@ -1435,6 +1579,10 @@ func (_m *API) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, ret := _m.Called(groupSource) var r0 []*model.Group + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(model.GroupSource) ([]*model.Group, *model.AppError)); ok { + return rf(groupSource) + } if rf, ok := ret.Get(0).(func(model.GroupSource) []*model.Group); ok { r0 = rf(groupSource) } else { @@ -1443,7 +1591,6 @@ func (_m *API) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(model.GroupSource) *model.AppError); ok { r1 = rf(groupSource) } else { @@ -1460,6 +1607,10 @@ func (_m *API) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) ret := _m.Called(userID) var r0 []*model.Group + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]*model.Group, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Group); ok { r0 = rf(userID) } else { @@ -1468,7 +1619,6 @@ func (_m *API) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -1485,6 +1635,10 @@ func (_m *API) GetLDAPUserAttributes(userID string, attributes []string) (map[st ret := _m.Called(userID, attributes) var r0 map[string]string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string) (map[string]string, *model.AppError)); ok { + return rf(userID, attributes) + } if rf, ok := ret.Get(0).(func(string, []string) map[string]string); ok { r0 = rf(userID, attributes) } else { @@ -1493,7 +1647,6 @@ func (_m *API) GetLDAPUserAttributes(userID string, attributes []string) (map[st } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok { r1 = rf(userID, attributes) } else { @@ -1526,6 +1679,10 @@ func (_m *API) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) { ret := _m.Called(appID) var r0 *model.OAuthApp + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.OAuthApp, *model.AppError)); ok { + return rf(appID) + } if rf, ok := ret.Get(0).(func(string) *model.OAuthApp); ok { r0 = rf(appID) } else { @@ -1534,7 +1691,6 @@ func (_m *API) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(appID) } else { @@ -1567,6 +1723,10 @@ func (_m *API) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) ret := _m.Called(id) var r0 *model.PluginStatus + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.PluginStatus, *model.AppError)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.PluginStatus); ok { r0 = rf(id) } else { @@ -1575,7 +1735,6 @@ func (_m *API) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(id) } else { @@ -1592,6 +1751,10 @@ func (_m *API) GetPlugins() ([]*model.Manifest, *model.AppError) { ret := _m.Called() var r0 []*model.Manifest + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() ([]*model.Manifest, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Manifest); ok { r0 = rf() } else { @@ -1600,7 +1763,6 @@ func (_m *API) GetPlugins() ([]*model.Manifest, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -1617,6 +1779,10 @@ func (_m *API) GetPost(postId string) (*model.Post, *model.AppError) { ret := _m.Called(postId) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Post, *model.AppError)); ok { + return rf(postId) + } if rf, ok := ret.Get(0).(func(string) *model.Post); ok { r0 = rf(postId) } else { @@ -1625,7 +1791,6 @@ func (_m *API) GetPost(postId string) (*model.Post, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(postId) } else { @@ -1642,6 +1807,10 @@ func (_m *API) GetPostThread(postId string) (*model.PostList, *model.AppError) { ret := _m.Called(postId) var r0 *model.PostList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.PostList, *model.AppError)); ok { + return rf(postId) + } if rf, ok := ret.Get(0).(func(string) *model.PostList); ok { r0 = rf(postId) } else { @@ -1650,7 +1819,6 @@ func (_m *API) GetPostThread(postId string) (*model.PostList, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(postId) } else { @@ -1667,6 +1835,10 @@ func (_m *API) GetPostsAfter(channelId string, postId string, page int, perPage ret := _m.Called(channelId, postId, page, perPage) var r0 *model.PostList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, *model.AppError)); ok { + return rf(channelId, postId, page, perPage) + } if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok { r0 = rf(channelId, postId, page, perPage) } else { @@ -1675,7 +1847,6 @@ func (_m *API) GetPostsAfter(channelId string, postId string, page int, perPage } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok { r1 = rf(channelId, postId, page, perPage) } else { @@ -1692,6 +1863,10 @@ func (_m *API) GetPostsBefore(channelId string, postId string, page int, perPage ret := _m.Called(channelId, postId, page, perPage) var r0 *model.PostList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, *model.AppError)); ok { + return rf(channelId, postId, page, perPage) + } if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok { r0 = rf(channelId, postId, page, perPage) } else { @@ -1700,7 +1875,6 @@ func (_m *API) GetPostsBefore(channelId string, postId string, page int, perPage } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok { r1 = rf(channelId, postId, page, perPage) } else { @@ -1717,6 +1891,10 @@ func (_m *API) GetPostsForChannel(channelId string, page int, perPage int) (*mod ret := _m.Called(channelId, page, perPage) var r0 *model.PostList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (*model.PostList, *model.AppError)); ok { + return rf(channelId, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.PostList); ok { r0 = rf(channelId, page, perPage) } else { @@ -1725,7 +1903,6 @@ func (_m *API) GetPostsForChannel(channelId string, page int, perPage int) (*mod } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(channelId, page, perPage) } else { @@ -1742,6 +1919,10 @@ func (_m *API) GetPostsSince(channelId string, time int64) (*model.PostList, *mo ret := _m.Called(channelId, time) var r0 *model.PostList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int64) (*model.PostList, *model.AppError)); ok { + return rf(channelId, time) + } if rf, ok := ret.Get(0).(func(string, int64) *model.PostList); ok { r0 = rf(channelId, time) } else { @@ -1750,7 +1931,6 @@ func (_m *API) GetPostsSince(channelId string, time int64) (*model.PostList, *mo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int64) *model.AppError); ok { r1 = rf(channelId, time) } else { @@ -1767,6 +1947,10 @@ func (_m *API) GetPreferencesForUser(userID string) ([]model.Preference, *model. ret := _m.Called(userID) var r0 []model.Preference + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]model.Preference, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []model.Preference); ok { r0 = rf(userID) } else { @@ -1775,7 +1959,6 @@ func (_m *API) GetPreferencesForUser(userID string) ([]model.Preference, *model. } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -1792,6 +1975,10 @@ func (_m *API) GetProfileImage(userID string) ([]byte, *model.AppError) { ret := _m.Called(userID) var r0 []byte + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(userID) } else { @@ -1800,7 +1987,6 @@ func (_m *API) GetProfileImage(userID string) ([]byte, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -1817,6 +2003,10 @@ func (_m *API) GetPublicChannelsForTeam(teamID string, page int, perPage int) ([ ret := _m.Called(teamID, page, perPage) var r0 []*model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Channel, *model.AppError)); ok { + return rf(teamID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Channel); ok { r0 = rf(teamID, page, perPage) } else { @@ -1825,7 +2015,6 @@ func (_m *API) GetPublicChannelsForTeam(teamID string, page int, perPage int) ([ } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(teamID, page, perPage) } else { @@ -1842,6 +2031,10 @@ func (_m *API) GetReactions(postId string) ([]*model.Reaction, *model.AppError) ret := _m.Called(postId) var r0 []*model.Reaction + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]*model.Reaction, *model.AppError)); ok { + return rf(postId) + } if rf, ok := ret.Get(0).(func(string) []*model.Reaction); ok { r0 = rf(postId) } else { @@ -1850,7 +2043,6 @@ func (_m *API) GetReactions(postId string) ([]*model.Reaction, *model.AppError) } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(postId) } else { @@ -1881,6 +2073,10 @@ func (_m *API) GetSession(sessionID string) (*model.Session, *model.AppError) { ret := _m.Called(sessionID) var r0 *model.Session + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Session, *model.AppError)); ok { + return rf(sessionID) + } if rf, ok := ret.Get(0).(func(string) *model.Session); ok { r0 = rf(sessionID) } else { @@ -1889,7 +2085,6 @@ func (_m *API) GetSession(sessionID string) (*model.Session, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(sessionID) } else { @@ -1906,13 +2101,16 @@ func (_m *API) GetSystemInstallDate() (int64, *model.AppError) { ret := _m.Called() var r0 int64 + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() (int64, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -1929,6 +2127,10 @@ func (_m *API) GetTeam(teamID string) (*model.Team, *model.AppError) { ret := _m.Called(teamID) var r0 *model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Team, *model.AppError)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(teamID) } else { @@ -1937,7 +2139,6 @@ func (_m *API) GetTeam(teamID string) (*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(teamID) } else { @@ -1954,6 +2155,10 @@ func (_m *API) GetTeamByName(name string) (*model.Team, *model.AppError) { ret := _m.Called(name) var r0 *model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Team, *model.AppError)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(name) } else { @@ -1962,7 +2167,6 @@ func (_m *API) GetTeamByName(name string) (*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(name) } else { @@ -1979,6 +2183,10 @@ func (_m *API) GetTeamIcon(teamID string) ([]byte, *model.AppError) { ret := _m.Called(teamID) var r0 []byte + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(teamID) } else { @@ -1987,7 +2195,6 @@ func (_m *API) GetTeamIcon(teamID string) ([]byte, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(teamID) } else { @@ -2004,6 +2211,10 @@ func (_m *API) GetTeamMember(teamID string, userID string) (*model.TeamMember, * ret := _m.Called(teamID, userID) var r0 *model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.TeamMember, *model.AppError)); ok { + return rf(teamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.TeamMember); ok { r0 = rf(teamID, userID) } else { @@ -2012,7 +2223,6 @@ func (_m *API) GetTeamMember(teamID string, userID string) (*model.TeamMember, * } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(teamID, userID) } else { @@ -2029,6 +2239,10 @@ func (_m *API) GetTeamMembers(teamID string, page int, perPage int) ([]*model.Te ret := _m.Called(teamID, page, perPage) var r0 []*model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.TeamMember, *model.AppError)); ok { + return rf(teamID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.TeamMember); ok { r0 = rf(teamID, page, perPage) } else { @@ -2037,7 +2251,6 @@ func (_m *API) GetTeamMembers(teamID string, page int, perPage int) ([]*model.Te } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(teamID, page, perPage) } else { @@ -2054,6 +2267,10 @@ func (_m *API) GetTeamMembersForUser(userID string, page int, perPage int) ([]*m ret := _m.Called(userID, page, perPage) var r0 []*model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.TeamMember, *model.AppError)); ok { + return rf(userID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.TeamMember); ok { r0 = rf(userID, page, perPage) } else { @@ -2062,7 +2279,6 @@ func (_m *API) GetTeamMembersForUser(userID string, page int, perPage int) ([]*m } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(userID, page, perPage) } else { @@ -2079,6 +2295,10 @@ func (_m *API) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) { ret := _m.Called(teamID) var r0 *model.TeamStats + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.TeamStats, *model.AppError)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) *model.TeamStats); ok { r0 = rf(teamID) } else { @@ -2087,7 +2307,6 @@ func (_m *API) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(teamID) } else { @@ -2104,6 +2323,10 @@ func (_m *API) GetTeams() ([]*model.Team, *model.AppError) { ret := _m.Called() var r0 []*model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() ([]*model.Team, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Team); ok { r0 = rf() } else { @@ -2112,7 +2335,6 @@ func (_m *API) GetTeams() ([]*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -2129,6 +2351,10 @@ func (_m *API) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { ret := _m.Called(userID) var r0 []*model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]*model.Team, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Team); ok { r0 = rf(userID) } else { @@ -2137,7 +2363,6 @@ func (_m *API) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -2154,6 +2379,10 @@ func (_m *API) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model ret := _m.Called(userID) var r0 []*model.TeamUnread + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]*model.TeamUnread, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.TeamUnread); ok { r0 = rf(userID) } else { @@ -2162,7 +2391,6 @@ func (_m *API) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -2209,6 +2437,10 @@ func (_m *API) GetUploadSession(uploadID string) (*model.UploadSession, error) { ret := _m.Called(uploadID) var r0 *model.UploadSession + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.UploadSession, error)); ok { + return rf(uploadID) + } if rf, ok := ret.Get(0).(func(string) *model.UploadSession); ok { r0 = rf(uploadID) } else { @@ -2217,7 +2449,6 @@ func (_m *API) GetUploadSession(uploadID string) (*model.UploadSession, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(uploadID) } else { @@ -2232,6 +2463,10 @@ func (_m *API) GetUser(userID string) (*model.User, *model.AppError) { ret := _m.Called(userID) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(userID) } else { @@ -2240,7 +2475,6 @@ func (_m *API) GetUser(userID string) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -2257,6 +2491,10 @@ func (_m *API) GetUserByEmail(email string) (*model.User, *model.AppError) { ret := _m.Called(email) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok { + return rf(email) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(email) } else { @@ -2265,7 +2503,6 @@ func (_m *API) GetUserByEmail(email string) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(email) } else { @@ -2282,6 +2519,10 @@ func (_m *API) GetUserByUsername(name string) (*model.User, *model.AppError) { ret := _m.Called(name) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(name) } else { @@ -2290,7 +2531,6 @@ func (_m *API) GetUserByUsername(name string) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(name) } else { @@ -2307,6 +2547,10 @@ func (_m *API) GetUserStatus(userID string) (*model.Status, *model.AppError) { ret := _m.Called(userID) var r0 *model.Status + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Status, *model.AppError)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.Status); ok { r0 = rf(userID) } else { @@ -2315,7 +2559,6 @@ func (_m *API) GetUserStatus(userID string) (*model.Status, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(userID) } else { @@ -2332,6 +2575,10 @@ func (_m *API) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.A ret := _m.Called(userIds) var r0 []*model.Status + var r1 *model.AppError + if rf, ok := ret.Get(0).(func([]string) ([]*model.Status, *model.AppError)); ok { + return rf(userIds) + } if rf, ok := ret.Get(0).(func([]string) []*model.Status); ok { r0 = rf(userIds) } else { @@ -2340,7 +2587,6 @@ func (_m *API) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.A } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok { r1 = rf(userIds) } else { @@ -2357,6 +2603,10 @@ func (_m *API) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.Ap ret := _m.Called(options) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, *model.AppError)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -2365,7 +2615,6 @@ func (_m *API) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.Ap } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.UserGetOptions) *model.AppError); ok { r1 = rf(options) } else { @@ -2382,6 +2631,10 @@ func (_m *API) GetUsersByUsernames(usernames []string) ([]*model.User, *model.Ap ret := _m.Called(usernames) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func([]string) ([]*model.User, *model.AppError)); ok { + return rf(usernames) + } if rf, ok := ret.Get(0).(func([]string) []*model.User); ok { r0 = rf(usernames) } else { @@ -2390,7 +2643,6 @@ func (_m *API) GetUsersByUsernames(usernames []string) ([]*model.User, *model.Ap } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok { r1 = rf(usernames) } else { @@ -2407,6 +2659,10 @@ func (_m *API) GetUsersInChannel(channelID string, sortBy string, page int, perP ret := _m.Called(channelID, sortBy, page, perPage) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.User, *model.AppError)); ok { + return rf(channelID, sortBy, page, perPage) + } if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.User); ok { r0 = rf(channelID, sortBy, page, perPage) } else { @@ -2415,7 +2671,6 @@ func (_m *API) GetUsersInChannel(channelID string, sortBy string, page int, perP } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok { r1 = rf(channelID, sortBy, page, perPage) } else { @@ -2432,6 +2687,10 @@ func (_m *API) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.Us ret := _m.Called(teamID, page, perPage) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.User, *model.AppError)); ok { + return rf(teamID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok { r0 = rf(teamID, page, perPage) } else { @@ -2440,7 +2699,6 @@ func (_m *API) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.Us } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(teamID, page, perPage) } else { @@ -2499,6 +2757,10 @@ func (_m *API) InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *mo ret := _m.Called(file, replace) var r0 *model.Manifest + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(io.Reader, bool) (*model.Manifest, *model.AppError)); ok { + return rf(file, replace) + } if rf, ok := ret.Get(0).(func(io.Reader, bool) *model.Manifest); ok { r0 = rf(file, replace) } else { @@ -2507,7 +2769,6 @@ func (_m *API) InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *mo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(io.Reader, bool) *model.AppError); ok { r1 = rf(file, replace) } else { @@ -2538,13 +2799,16 @@ func (_m *API) KVCompareAndDelete(key string, oldValue []byte) (bool, *model.App ret := _m.Called(key, oldValue) var r0 bool + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []byte) (bool, *model.AppError)); ok { + return rf(key, oldValue) + } if rf, ok := ret.Get(0).(func(string, []byte) bool); ok { r0 = rf(key, oldValue) } else { r0 = ret.Get(0).(bool) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []byte) *model.AppError); ok { r1 = rf(key, oldValue) } else { @@ -2561,13 +2825,16 @@ func (_m *API) KVCompareAndSet(key string, oldValue []byte, newValue []byte) (bo ret := _m.Called(key, oldValue, newValue) var r0 bool + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []byte, []byte) (bool, *model.AppError)); ok { + return rf(key, oldValue, newValue) + } if rf, ok := ret.Get(0).(func(string, []byte, []byte) bool); ok { r0 = rf(key, oldValue, newValue) } else { r0 = ret.Get(0).(bool) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []byte, []byte) *model.AppError); ok { r1 = rf(key, oldValue, newValue) } else { @@ -2616,6 +2883,10 @@ func (_m *API) KVGet(key string) ([]byte, *model.AppError) { ret := _m.Called(key) var r0 []byte + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok { + return rf(key) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(key) } else { @@ -2624,7 +2895,6 @@ func (_m *API) KVGet(key string) ([]byte, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(key) } else { @@ -2641,6 +2911,10 @@ func (_m *API) KVList(page int, perPage int) ([]string, *model.AppError) { ret := _m.Called(page, perPage) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(int, int) ([]string, *model.AppError)); ok { + return rf(page, perPage) + } if rf, ok := ret.Get(0).(func(int, int) []string); ok { r0 = rf(page, perPage) } else { @@ -2649,7 +2923,6 @@ func (_m *API) KVList(page int, perPage int) ([]string, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok { r1 = rf(page, perPage) } else { @@ -2698,13 +2971,16 @@ func (_m *API) KVSetWithOptions(key string, value []byte, options model.PluginKV ret := _m.Called(key, value, options) var r0 bool + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []byte, model.PluginKVSetOptions) (bool, *model.AppError)); ok { + return rf(key, value, options) + } if rf, ok := ret.Get(0).(func(string, []byte, model.PluginKVSetOptions) bool); ok { r0 = rf(key, value, options) } else { r0 = ret.Get(0).(bool) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []byte, model.PluginKVSetOptions) *model.AppError); ok { r1 = rf(key, value, options) } else { @@ -2721,6 +2997,10 @@ func (_m *API) ListBuiltInCommands() ([]*model.Command, error) { ret := _m.Called() var r0 []*model.Command + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Command, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Command); ok { r0 = rf() } else { @@ -2729,7 +3009,6 @@ func (_m *API) ListBuiltInCommands() ([]*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -2744,6 +3023,10 @@ func (_m *API) ListCommands(teamID string) ([]*model.Command, error) { ret := _m.Called(teamID) var r0 []*model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.Command); ok { r0 = rf(teamID) } else { @@ -2752,7 +3035,6 @@ func (_m *API) ListCommands(teamID string) ([]*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -2767,6 +3049,10 @@ func (_m *API) ListCustomCommands(teamID string) ([]*model.Command, error) { ret := _m.Called(teamID) var r0 []*model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.Command); ok { r0 = rf(teamID) } else { @@ -2775,7 +3061,6 @@ func (_m *API) ListCustomCommands(teamID string) ([]*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -2790,6 +3075,10 @@ func (_m *API) ListPluginCommands(teamID string) ([]*model.Command, error) { ret := _m.Called(teamID) var r0 []*model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.Command); ok { r0 = rf(teamID) } else { @@ -2798,7 +3087,6 @@ func (_m *API) ListPluginCommands(teamID string) ([]*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -2875,6 +3163,10 @@ func (_m *API) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, ret := _m.Called(botUserId, botPatch) var r0 *model.Bot + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, *model.BotPatch) (*model.Bot, *model.AppError)); ok { + return rf(botUserId, botPatch) + } if rf, ok := ret.Get(0).(func(string, *model.BotPatch) *model.Bot); ok { r0 = rf(botUserId, botPatch) } else { @@ -2883,7 +3175,6 @@ func (_m *API) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, *model.BotPatch) *model.AppError); ok { r1 = rf(botUserId, botPatch) } else { @@ -2967,6 +3258,10 @@ func (_m *API) ReadFile(path string) ([]byte, *model.AppError) { ret := _m.Called(path) var r0 []byte + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(path) } else { @@ -2975,7 +3270,6 @@ func (_m *API) ReadFile(path string) ([]byte, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(path) } else { @@ -3178,6 +3472,10 @@ func (_m *API) SearchChannels(teamID string, term string) ([]*model.Channel, *mo ret := _m.Called(teamID, term) var r0 []*model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) ([]*model.Channel, *model.AppError)); ok { + return rf(teamID, term) + } if rf, ok := ret.Get(0).(func(string, string) []*model.Channel); ok { r0 = rf(teamID, term) } else { @@ -3186,7 +3484,6 @@ func (_m *API) SearchChannels(teamID string, term string) ([]*model.Channel, *mo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(teamID, term) } else { @@ -3203,6 +3500,10 @@ func (_m *API) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams ret := _m.Called(teamID, paramsList) var r0 []*model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []*model.SearchParams) ([]*model.Post, *model.AppError)); ok { + return rf(teamID, paramsList) + } if rf, ok := ret.Get(0).(func(string, []*model.SearchParams) []*model.Post); ok { r0 = rf(teamID, paramsList) } else { @@ -3211,7 +3512,6 @@ func (_m *API) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []*model.SearchParams) *model.AppError); ok { r1 = rf(teamID, paramsList) } else { @@ -3228,6 +3528,10 @@ func (_m *API) SearchPostsInTeamForUser(teamID string, userID string, searchPara ret := _m.Called(teamID, userID, searchParams) var r0 *model.PostSearchResults + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, model.SearchParameter) (*model.PostSearchResults, *model.AppError)); ok { + return rf(teamID, userID, searchParams) + } if rf, ok := ret.Get(0).(func(string, string, model.SearchParameter) *model.PostSearchResults); ok { r0 = rf(teamID, userID, searchParams) } else { @@ -3236,7 +3540,6 @@ func (_m *API) SearchPostsInTeamForUser(teamID string, userID string, searchPara } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, model.SearchParameter) *model.AppError); ok { r1 = rf(teamID, userID, searchParams) } else { @@ -3253,6 +3556,10 @@ func (_m *API) SearchTeams(term string) ([]*model.Team, *model.AppError) { ret := _m.Called(term) var r0 []*model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) ([]*model.Team, *model.AppError)); ok { + return rf(term) + } if rf, ok := ret.Get(0).(func(string) []*model.Team); ok { r0 = rf(term) } else { @@ -3261,7 +3568,6 @@ func (_m *API) SearchTeams(term string) ([]*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(term) } else { @@ -3278,6 +3584,10 @@ func (_m *API) SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppE ret := _m.Called(search) var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.UserSearch) ([]*model.User, *model.AppError)); ok { + return rf(search) + } if rf, ok := ret.Get(0).(func(*model.UserSearch) []*model.User); ok { r0 = rf(search) } else { @@ -3286,7 +3596,6 @@ func (_m *API) SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppE } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.UserSearch) *model.AppError); ok { r1 = rf(search) } else { @@ -3367,6 +3676,10 @@ func (_m *API) SetUserStatusTimedDND(userId string, endtime int64) (*model.Statu ret := _m.Called(userId, endtime) var r0 *model.Status + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int64) (*model.Status, *model.AppError)); ok { + return rf(userId, endtime) + } if rf, ok := ret.Get(0).(func(string, int64) *model.Status); ok { r0 = rf(userId, endtime) } else { @@ -3375,7 +3688,6 @@ func (_m *API) SetUserStatusTimedDND(userId string, endtime int64) (*model.Statu } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int64) *model.AppError); ok { r1 = rf(userId, endtime) } else { @@ -3406,6 +3718,10 @@ func (_m *API) UpdateBotActive(botUserId string, active bool) (*model.Bot, *mode ret := _m.Called(botUserId, active) var r0 *model.Bot + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, bool) (*model.Bot, *model.AppError)); ok { + return rf(botUserId, active) + } if rf, ok := ret.Get(0).(func(string, bool) *model.Bot); ok { r0 = rf(botUserId, active) } else { @@ -3414,7 +3730,6 @@ func (_m *API) UpdateBotActive(botUserId string, active bool) (*model.Bot, *mode } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok { r1 = rf(botUserId, active) } else { @@ -3431,6 +3746,10 @@ func (_m *API) UpdateChannel(channel *model.Channel) (*model.Channel, *model.App ret := _m.Called(channel) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Channel) (*model.Channel, *model.AppError)); ok { + return rf(channel) + } if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok { r0 = rf(channel) } else { @@ -3439,7 +3758,6 @@ func (_m *API) UpdateChannel(channel *model.Channel) (*model.Channel, *model.App } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok { r1 = rf(channel) } else { @@ -3456,6 +3774,10 @@ func (_m *API) UpdateChannelMemberNotifications(channelId string, userID string, ret := _m.Called(channelId, userID, notifications) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, map[string]string) (*model.ChannelMember, *model.AppError)); ok { + return rf(channelId, userID, notifications) + } if rf, ok := ret.Get(0).(func(string, string, map[string]string) *model.ChannelMember); ok { r0 = rf(channelId, userID, notifications) } else { @@ -3464,7 +3786,6 @@ func (_m *API) UpdateChannelMemberNotifications(channelId string, userID string, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, map[string]string) *model.AppError); ok { r1 = rf(channelId, userID, notifications) } else { @@ -3481,6 +3802,10 @@ func (_m *API) UpdateChannelMemberRoles(channelId string, userID string, newRole ret := _m.Called(channelId, userID, newRoles) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, string) (*model.ChannelMember, *model.AppError)); ok { + return rf(channelId, userID, newRoles) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.ChannelMember); ok { r0 = rf(channelId, userID, newRoles) } else { @@ -3489,7 +3814,6 @@ func (_m *API) UpdateChannelMemberRoles(channelId string, userID string, newRole } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok { r1 = rf(channelId, userID, newRoles) } else { @@ -3506,6 +3830,10 @@ func (_m *API) UpdateChannelSidebarCategories(userID string, teamID string, cate ret := _m.Called(userID, teamID, categories) var r0 []*model.SidebarCategoryWithChannels + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError)); ok { + return rf(userID, teamID, categories) + } if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) []*model.SidebarCategoryWithChannels); ok { r0 = rf(userID, teamID, categories) } else { @@ -3514,7 +3842,6 @@ func (_m *API) UpdateChannelSidebarCategories(userID string, teamID string, cate } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, []*model.SidebarCategoryWithChannels) *model.AppError); ok { r1 = rf(userID, teamID, categories) } else { @@ -3531,6 +3858,10 @@ func (_m *API) UpdateCommand(commandID string, updatedCmd *model.Command) (*mode ret := _m.Called(commandID, updatedCmd) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.Command) (*model.Command, error)); ok { + return rf(commandID, updatedCmd) + } if rf, ok := ret.Get(0).(func(string, *model.Command) *model.Command); ok { r0 = rf(commandID, updatedCmd) } else { @@ -3539,7 +3870,6 @@ func (_m *API) UpdateCommand(commandID string, updatedCmd *model.Command) (*mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.Command) error); ok { r1 = rf(commandID, updatedCmd) } else { @@ -3570,6 +3900,10 @@ func (_m *API) UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppE ret := _m.Called(app) var r0 *model.OAuthApp + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, *model.AppError)); ok { + return rf(app) + } if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok { r0 = rf(app) } else { @@ -3578,7 +3912,6 @@ func (_m *API) UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppE } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.OAuthApp) *model.AppError); ok { r1 = rf(app) } else { @@ -3595,6 +3928,10 @@ func (_m *API) UpdatePost(post *model.Post) (*model.Post, *model.AppError) { ret := _m.Called(post) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, *model.AppError)); ok { + return rf(post) + } if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { r0 = rf(post) } else { @@ -3603,7 +3940,6 @@ func (_m *API) UpdatePost(post *model.Post) (*model.Post, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok { r1 = rf(post) } else { @@ -3636,6 +3972,10 @@ func (_m *API) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { ret := _m.Called(team) var r0 *model.Team + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, *model.AppError)); ok { + return rf(team) + } if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { r0 = rf(team) } else { @@ -3644,7 +3984,6 @@ func (_m *API) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok { r1 = rf(team) } else { @@ -3661,6 +4000,10 @@ func (_m *API) UpdateTeamMemberRoles(teamID string, userID string, newRoles stri ret := _m.Called(teamID, userID, newRoles) var r0 *model.TeamMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, string) (*model.TeamMember, *model.AppError)); ok { + return rf(teamID, userID, newRoles) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.TeamMember); ok { r0 = rf(teamID, userID, newRoles) } else { @@ -3669,7 +4012,6 @@ func (_m *API) UpdateTeamMemberRoles(teamID string, userID string, newRoles stri } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok { r1 = rf(teamID, userID, newRoles) } else { @@ -3686,6 +4028,10 @@ func (_m *API) UpdateUser(user *model.User) (*model.User, *model.AppError) { ret := _m.Called(user) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.User) (*model.User, *model.AppError)); ok { + return rf(user) + } if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok { r0 = rf(user) } else { @@ -3694,7 +4040,6 @@ func (_m *API) UpdateUser(user *model.User) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok { r1 = rf(user) } else { @@ -3743,6 +4088,10 @@ func (_m *API) UpdateUserStatus(userID string, status string) (*model.Status, *m ret := _m.Called(userID, status) var r0 *model.Status + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (*model.Status, *model.AppError)); ok { + return rf(userID, status) + } if rf, ok := ret.Get(0).(func(string, string) *model.Status); ok { r0 = rf(userID, status) } else { @@ -3751,7 +4100,6 @@ func (_m *API) UpdateUserStatus(userID string, status string) (*model.Status, *m } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(userID, status) } else { @@ -3768,6 +4116,10 @@ func (_m *API) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInf ret := _m.Called(us, rd) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(*model.UploadSession, io.Reader) (*model.FileInfo, error)); ok { + return rf(us, rd) + } if rf, ok := ret.Get(0).(func(*model.UploadSession, io.Reader) *model.FileInfo); ok { r0 = rf(us, rd) } else { @@ -3776,7 +4128,6 @@ func (_m *API) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInf } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UploadSession, io.Reader) error); ok { r1 = rf(us, rd) } else { @@ -3791,6 +4142,10 @@ func (_m *API) UploadFile(data []byte, channelId string, filename string) (*mode ret := _m.Called(data, channelId, filename) var r0 *model.FileInfo + var r1 *model.AppError + if rf, ok := ret.Get(0).(func([]byte, string, string) (*model.FileInfo, *model.AppError)); ok { + return rf(data, channelId, filename) + } if rf, ok := ret.Get(0).(func([]byte, string, string) *model.FileInfo); ok { r0 = rf(data, channelId, filename) } else { @@ -3799,7 +4154,6 @@ func (_m *API) UploadFile(data []byte, channelId string, filename string) (*mode } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func([]byte, string, string) *model.AppError); ok { r1 = rf(data, channelId, filename) } else { @@ -3810,3 +4164,18 @@ func (_m *API) UploadFile(data []byte, channelId string, filename string) (*mode return r0, r1 } + +type mockConstructorTestingTNewAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewAPI creates a new instance of API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewAPI(t mockConstructorTestingTNewAPI) *API { + mock := &API{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/plugin/plugintest/driver.go b/plugin/plugintest/driver.go index 0c1bf866af..398b334450 100644 --- a/plugin/plugintest/driver.go +++ b/plugin/plugintest/driver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. @@ -22,13 +22,16 @@ func (_m *Driver) Conn(isMaster bool) (string, error) { ret := _m.Called(isMaster) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(bool) (string, error)); ok { + return rf(isMaster) + } if rf, ok := ret.Get(0).(func(bool) string); ok { r0 = rf(isMaster) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(bool) error); ok { r1 = rf(isMaster) } else { @@ -57,13 +60,16 @@ func (_m *Driver) ConnExec(connID string, q string, args []driver.NamedValue) (p ret := _m.Called(connID, q, args) var r0 plugin.ResultContainer + var r1 error + if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) (plugin.ResultContainer, error)); ok { + return rf(connID, q, args) + } if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) plugin.ResultContainer); ok { r0 = rf(connID, q, args) } else { r0 = ret.Get(0).(plugin.ResultContainer) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, []driver.NamedValue) error); ok { r1 = rf(connID, q, args) } else { @@ -92,13 +98,16 @@ func (_m *Driver) ConnQuery(connID string, q string, args []driver.NamedValue) ( ret := _m.Called(connID, q, args) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) (string, error)); ok { + return rf(connID, q, args) + } if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) string); ok { r0 = rf(connID, q, args) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, []driver.NamedValue) error); ok { r1 = rf(connID, q, args) } else { @@ -141,20 +150,23 @@ func (_m *Driver) RowsColumnTypePrecisionScale(rowsID string, index int) (int64, ret := _m.Called(rowsID, index) var r0 int64 + var r1 int64 + var r2 bool + if rf, ok := ret.Get(0).(func(string, int) (int64, int64, bool)); ok { + return rf(rowsID, index) + } if rf, ok := ret.Get(0).(func(string, int) int64); ok { r0 = rf(rowsID, index) } else { r0 = ret.Get(0).(int64) } - var r1 int64 if rf, ok := ret.Get(1).(func(string, int) int64); ok { r1 = rf(rowsID, index) } else { r1 = ret.Get(1).(int64) } - var r2 bool if rf, ok := ret.Get(2).(func(string, int) bool); ok { r2 = rf(rowsID, index) } else { @@ -227,13 +239,16 @@ func (_m *Driver) Stmt(connID string, q string) (string, error) { ret := _m.Called(connID, q) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { + return rf(connID, q) + } if rf, ok := ret.Get(0).(func(string, string) string); ok { r0 = rf(connID, q) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(connID, q) } else { @@ -262,13 +277,16 @@ func (_m *Driver) StmtExec(stID string, args []driver.NamedValue) (plugin.Result ret := _m.Called(stID, args) var r0 plugin.ResultContainer + var r1 error + if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) (plugin.ResultContainer, error)); ok { + return rf(stID, args) + } if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) plugin.ResultContainer); ok { r0 = rf(stID, args) } else { r0 = ret.Get(0).(plugin.ResultContainer) } - var r1 error if rf, ok := ret.Get(1).(func(string, []driver.NamedValue) error); ok { r1 = rf(stID, args) } else { @@ -297,13 +315,16 @@ func (_m *Driver) StmtQuery(stID string, args []driver.NamedValue) (string, erro ret := _m.Called(stID, args) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) (string, error)); ok { + return rf(stID, args) + } if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) string); ok { r0 = rf(stID, args) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, []driver.NamedValue) error); ok { r1 = rf(stID, args) } else { @@ -318,13 +339,16 @@ func (_m *Driver) Tx(connID string, opts driver.TxOptions) (string, error) { ret := _m.Called(connID, opts) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, driver.TxOptions) (string, error)); ok { + return rf(connID, opts) + } if rf, ok := ret.Get(0).(func(string, driver.TxOptions) string); ok { r0 = rf(connID, opts) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, driver.TxOptions) error); ok { r1 = rf(connID, opts) } else { @@ -361,3 +385,18 @@ func (_m *Driver) TxRollback(txID string) error { return r0 } + +type mockConstructorTestingTNewDriver interface { + mock.TestingT + Cleanup(func()) +} + +// NewDriver creates a new instance of Driver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewDriver(t mockConstructorTestingTNewDriver) *Driver { + mock := &Driver{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/plugin/plugintest/hooks.go b/plugin/plugintest/hooks.go index edee8f33e4..d5550e5ba0 100644 --- a/plugin/plugintest/hooks.go +++ b/plugin/plugintest/hooks.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make plugin-mocks`. @@ -30,6 +30,10 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo ret := _m.Called(c, args) var r0 *model.CommandResponse + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.CommandArgs) (*model.CommandResponse, *model.AppError)); ok { + return rf(c, args) + } if rf, ok := ret.Get(0).(func(*plugin.Context, *model.CommandArgs) *model.CommandResponse); ok { r0 = rf(c, args) } else { @@ -38,7 +42,6 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*plugin.Context, *model.CommandArgs) *model.AppError); ok { r1 = rf(c, args) } else { @@ -55,6 +58,10 @@ func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, fil ret := _m.Called(c, info, file, output) var r0 *model.FileInfo + var r1 string + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) (*model.FileInfo, string)); ok { + return rf(c, info, file, output) + } if rf, ok := ret.Get(0).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) *model.FileInfo); ok { r0 = rf(c, info, file, output) } else { @@ -63,7 +70,6 @@ func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, fil } } - var r1 string if rf, ok := ret.Get(1).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) string); ok { r1 = rf(c, info, file, output) } else { @@ -78,6 +84,10 @@ func (_m *Hooks) GetAllCollectionIDsForUser(c *plugin.Context, userID string, co ret := _m.Called(c, userID, collectionType) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) ([]string, error)); ok { + return rf(c, userID, collectionType) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) []string); ok { r0 = rf(c, userID, collectionType) } else { @@ -86,7 +96,6 @@ func (_m *Hooks) GetAllCollectionIDsForUser(c *plugin.Context, userID string, co } } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok { r1 = rf(c, userID, collectionType) } else { @@ -101,6 +110,10 @@ func (_m *Hooks) GetAllUserIdsForCollection(c *plugin.Context, collectionType st ret := _m.Called(c, collectionType, collectionID) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) ([]string, error)); ok { + return rf(c, collectionType, collectionID) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) []string); ok { r0 = rf(c, collectionType, collectionID) } else { @@ -109,7 +122,6 @@ func (_m *Hooks) GetAllUserIdsForCollection(c *plugin.Context, collectionType st } } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok { r1 = rf(c, collectionType, collectionID) } else { @@ -124,6 +136,10 @@ func (_m *Hooks) GetCollectionMetadataByIds(c *plugin.Context, collectionType st ret := _m.Called(c, collectionType, collectionIds) var r0 map[string]*model.CollectionMetadata + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) (map[string]*model.CollectionMetadata, error)); ok { + return rf(c, collectionType, collectionIds) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) map[string]*model.CollectionMetadata); ok { r0 = rf(c, collectionType, collectionIds) } else { @@ -132,7 +148,6 @@ func (_m *Hooks) GetCollectionMetadataByIds(c *plugin.Context, collectionType st } } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, []string) error); ok { r1 = rf(c, collectionType, collectionIds) } else { @@ -147,6 +162,10 @@ func (_m *Hooks) GetTopicMetadataByIds(c *plugin.Context, topicType string, topi ret := _m.Called(c, topicType, topicIds) var r0 map[string]*model.TopicMetadata + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) (map[string]*model.TopicMetadata, error)); ok { + return rf(c, topicType, topicIds) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) map[string]*model.TopicMetadata); ok { r0 = rf(c, topicType, topicIds) } else { @@ -155,7 +174,6 @@ func (_m *Hooks) GetTopicMetadataByIds(c *plugin.Context, topicType string, topi } } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, []string) error); ok { r1 = rf(c, topicType, topicIds) } else { @@ -170,13 +188,16 @@ func (_m *Hooks) GetTopicRedirect(c *plugin.Context, topicType string, topicID s ret := _m.Called(c, topicType, topicID) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) (string, error)); ok { + return rf(c, topicType, topicID) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) string); ok { r0 = rf(c, topicType, topicID) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok { r1 = rf(c, topicType, topicID) } else { @@ -191,6 +212,10 @@ func (_m *Hooks) Implemented() ([]string, error) { ret := _m.Called() var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func() ([]string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() } else { @@ -199,7 +224,6 @@ func (_m *Hooks) Implemented() ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -224,6 +248,10 @@ func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*mode ret := _m.Called(c, post) var r0 *model.Post + var r1 string + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) (*model.Post, string)); ok { + return rf(c, post) + } if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) *model.Post); ok { r0 = rf(c, post) } else { @@ -232,7 +260,6 @@ func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*mode } } - var r1 string if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post) string); ok { r1 = rf(c, post) } else { @@ -247,6 +274,10 @@ func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, ol ret := _m.Called(c, newPost, oldPost) var r0 *model.Post + var r1 string + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) (*model.Post, string)); ok { + return rf(c, newPost, oldPost) + } if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) *model.Post); ok { r0 = rf(c, newPost, oldPost) } else { @@ -255,7 +286,6 @@ func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, ol } } - var r1 string if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post, *model.Post) string); ok { r1 = rf(c, newPost, oldPost) } else { @@ -361,13 +391,16 @@ func (_m *Hooks) RunDataRetention(nowTime int64, batchSize int64) (int64, error) ret := _m.Called(nowTime, batchSize) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok { + return rf(nowTime, batchSize) + } if rf, ok := ret.Get(0).(func(int64, int64) int64); ok { r0 = rf(nowTime, batchSize) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64) error); ok { r1 = rf(nowTime, batchSize) } else { @@ -417,13 +450,16 @@ func (_m *Hooks) UserHasPermissionToCollection(c *plugin.Context, userID string, ret := _m.Called(c, userID, collectionType, collectionId, permission) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*plugin.Context, string, string, string, *model.Permission) (bool, error)); ok { + return rf(c, userID, collectionType, collectionId, permission) + } if rf, ok := ret.Get(0).(func(*plugin.Context, string, string, string, *model.Permission) bool); ok { r0 = rf(c, userID, collectionType, collectionId, permission) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*plugin.Context, string, string, string, *model.Permission) error); ok { r1 = rf(c, userID, collectionType, collectionId, permission) } else { @@ -451,3 +487,18 @@ func (_m *Hooks) UserWillLogIn(c *plugin.Context, user *model.User) string { func (_m *Hooks) WebSocketMessageHasBeenPosted(webConnID string, userID string, req *model.WebSocketRequest) { _m.Called(webConnID, userID, req) } + +type mockConstructorTestingTNewHooks interface { + mock.TestingT + Cleanup(func()) +} + +// NewHooks creates a new instance of Hooks. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewHooks(t mockConstructorTestingTNewHooks) *Hooks { + mock := &Hooks{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/Makefile b/server/Makefile index 7ff02c12bc..87130c4e3e 100644 --- a/server/Makefile +++ b/server/Makefile @@ -318,11 +318,11 @@ i18n-check: ## Exit on empty translation strings and translation source strings $(GOBIN)/mmgotool i18n check-empty-src --portal-dir="" store-mocks: ## Creates mock files. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir channels/store --name ".*Store" --output channels/store/storetest/mocks --note 'Regenerate this file using `make store-mocks`.' telemetry-mocks: ## Creates mock files. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir platform/services/telemetry --all --output platform/services/telemetry/mocks --note 'Regenerate this file using `make telemetry-mocks`.' store-layers: ## Generate layers for the store @@ -340,39 +340,39 @@ new-migration: ## Creates a new migration. Run with make new-migration name=<> $(GOBIN)/morph generate $(name) --driver postgres --dir channels/db/migrations --sequence filestore-mocks: ## Creates mock files. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir platform/shared/filestore --all --output platform/shared/filestore/mocks --note 'Regenerate this file using `make filestore-mocks`.' ldap-mocks: ## Creates mock files for ldap. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir $(BUILD_ENTERPRISE_DIR)/ldap --all --output $(BUILD_ENTERPRISE_DIR)/ldap/mocks --note 'Regenerate this file using `make ldap-mocks`.' plugin-mocks: ## Creates mock files for plugins. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir ../plugin --name API --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.' $(GOBIN)/mockery --dir ../plugin --name Hooks --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.' $(GOBIN)/mockery --dir ../plugin --name Driver --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.' einterfaces-mocks: ## Creates mock files for einterfaces. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir channels/einterfaces --all --output channels/einterfaces/mocks --note 'Regenerate this file using `make einterfaces-mocks`.' searchengine-mocks: ## Creates mock files for searchengines. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir platform/services/searchengine --all --output platform/services/searchengine/mocks --note 'Regenerate this file using `make searchengine-mocks`.' sharedchannel-mocks: ## Creates mock files for shared channels. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir=./platform/services/sharedchannel --name=ServerIface --output=./platform/services/sharedchannel --inpackage --outpkg=sharedchannel --testonly --note 'Regenerate this file using `make sharedchannel-mocks`.' $(GOBIN)/mockery --dir=./platform/services/sharedchannel --name=AppIface --output=./platform/services/sharedchannel --inpackage --outpkg=sharedchannel --testonly --note 'Regenerate this file using `make sharedchannel-mocks`.' misc-mocks: ## Creates mocks for misc interfaces. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir channels/utils --name LicenseValidatorIface --output channels/utils/mocks --note 'Regenerate this file using `make misc-mocks`.' $(GOBIN)/mockery --dir channels/app --name WorkTemplateExecutor --output channels/app/mocks --note 'Regenerate this file using `make misc-mocks`.' email-mocks: ## Creates mocks for misc interfaces. - $(GO) install github.com/vektra/mockery/v2/...@v2.10.4 + $(GO) install github.com/vektra/mockery/v2/...@v2.23.2 $(GOBIN)/mockery --dir channels/app/email --name ServiceInterface --output channels/app/email/mocks --note 'Regenerate this file using `make email-mocks`.' platform-mocks: ## Creates mocks for platform interfaces. diff --git a/server/channels/app/email/mocks/ServiceInterface.go b/server/channels/app/email/mocks/ServiceInterface.go index e4d4011f45..04a6ddbf24 100644 --- a/server/channels/app/email/mocks/ServiceInterface.go +++ b/server/channels/app/email/mocks/ServiceInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make email-mocks`. @@ -44,6 +44,10 @@ func (_m *ServiceInterface) CreateVerifyEmailToken(userID string, newEmail strin ret := _m.Called(userID, newEmail) var r0 *model.Token + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Token, error)); ok { + return rf(userID, newEmail) + } if rf, ok := ret.Get(0).(func(string, string) *model.Token); ok { r0 = rf(userID, newEmail) } else { @@ -52,7 +56,6 @@ func (_m *ServiceInterface) CreateVerifyEmailToken(userID string, newEmail strin } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, newEmail) } else { @@ -326,6 +329,10 @@ func (_m *ServiceInterface) SendInviteEmailsToTeamAndChannels(team *model.Team, ret := _m.Called(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent, isSystemAdmin, isFirstAdmin) var r0 []*model.EmailInviteWithError + var r1 error + if rf, ok := ret.Get(0).(func(*model.Team, []*model.Channel, string, string, []byte, []string, string, *model.TeamInviteReminderData, string, bool, bool, bool) ([]*model.EmailInviteWithError, error)); ok { + return rf(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent, isSystemAdmin, isFirstAdmin) + } if rf, ok := ret.Get(0).(func(*model.Team, []*model.Channel, string, string, []byte, []string, string, *model.TeamInviteReminderData, string, bool, bool, bool) []*model.EmailInviteWithError); ok { r0 = rf(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent, isSystemAdmin, isFirstAdmin) } else { @@ -334,7 +341,6 @@ func (_m *ServiceInterface) SendInviteEmailsToTeamAndChannels(team *model.Team, } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Team, []*model.Channel, string, string, []byte, []string, string, *model.TeamInviteReminderData, string, bool, bool, bool) error); ok { r1 = rf(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent, isSystemAdmin, isFirstAdmin) } else { @@ -433,13 +439,16 @@ func (_m *ServiceInterface) SendPasswordResetEmail(_a0 string, token *model.Toke ret := _m.Called(_a0, token, locale, siteURL) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.Token, string, string) (bool, error)); ok { + return rf(_a0, token, locale, siteURL) + } if rf, ok := ret.Get(0).(func(string, *model.Token, string, string) bool); ok { r0 = rf(_a0, token, locale, siteURL) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.Token, string, string) error); ok { r1 = rf(_a0, token, locale, siteURL) } else { @@ -454,13 +463,16 @@ func (_m *ServiceInterface) SendPaymentFailedEmail(_a0 string, locale string, fa ret := _m.Called(_a0, locale, failedPayment, planName, siteURL) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.FailedPayment, string, string) (bool, error)); ok { + return rf(_a0, locale, failedPayment, planName, siteURL) + } if rf, ok := ret.Get(0).(func(string, string, *model.FailedPayment, string, string) bool); ok { r0 = rf(_a0, locale, failedPayment, planName, siteURL) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.FailedPayment, string, string) error); ok { r1 = rf(_a0, locale, failedPayment, planName, siteURL) } else { @@ -544,3 +556,18 @@ func (_m *ServiceInterface) SendWelcomeEmail(userID string, _a1 string, verified func (_m *ServiceInterface) Stop() { _m.Called() } + +type mockConstructorTestingTNewServiceInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewServiceInterface creates a new instance of ServiceInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewServiceInterface(t mockConstructorTestingTNewServiceInterface) *ServiceInterface { + mock := &ServiceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/app/mocks/WorkTemplateExecutor.go b/server/channels/app/mocks/WorkTemplateExecutor.go index b5fa54fb5a..4d2083d8dc 100644 --- a/server/channels/app/mocks/WorkTemplateExecutor.go +++ b/server/channels/app/mocks/WorkTemplateExecutor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make misc-mocks`. @@ -22,13 +22,16 @@ func (_m *WorkTemplateExecutor) CreateBoard(c *request.Context, wtcr *worktempla ret := _m.Called(c, wtcr, cBoard, linkToChannelID) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateBoard, string) (string, error)); ok { + return rf(c, wtcr, cBoard, linkToChannelID) + } if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateBoard, string) string); ok { r0 = rf(c, wtcr, cBoard, linkToChannelID) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateBoard, string) error); ok { r1 = rf(c, wtcr, cBoard, linkToChannelID) } else { @@ -43,13 +46,16 @@ func (_m *WorkTemplateExecutor) CreateChannel(c *request.Context, wtcr *worktemp ret := _m.Called(c, wtcr, cChannel) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateChannel) (string, error)); ok { + return rf(c, wtcr, cChannel) + } if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateChannel) string); ok { r0 = rf(c, wtcr, cChannel) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplateChannel) error); ok { r1 = rf(c, wtcr, cChannel) } else { @@ -64,13 +70,16 @@ func (_m *WorkTemplateExecutor) CreatePlaybook(c *request.Context, wtcr *worktem ret := _m.Called(c, wtcr, playbook, channel) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplatePlaybook, model.WorkTemplateChannel) (string, error)); ok { + return rf(c, wtcr, playbook, channel) + } if rf, ok := ret.Get(0).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplatePlaybook, model.WorkTemplateChannel) string); ok { r0 = rf(c, wtcr, playbook, channel) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*request.Context, *worktemplates.ExecutionRequest, *model.WorkTemplatePlaybook, model.WorkTemplateChannel) error); ok { r1 = rf(c, wtcr, playbook, channel) } else { @@ -93,3 +102,18 @@ func (_m *WorkTemplateExecutor) InstallPlugin(c *request.Context, wtcr *worktemp return r0 } + +type mockConstructorTestingTNewWorkTemplateExecutor interface { + mock.TestingT + Cleanup(func()) +} + +// NewWorkTemplateExecutor creates a new instance of WorkTemplateExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewWorkTemplateExecutor(t mockConstructorTestingTNewWorkTemplateExecutor) *WorkTemplateExecutor { + mock := &WorkTemplateExecutor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/AccountMigrationInterface.go b/server/channels/einterfaces/mocks/AccountMigrationInterface.go index 566ee171f9..d8d9209476 100644 --- a/server/channels/einterfaces/mocks/AccountMigrationInterface.go +++ b/server/channels/einterfaces/mocks/AccountMigrationInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *AccountMigrationInterface) MigrateToSaml(fromAuthService string, users return r0 } + +type mockConstructorTestingTNewAccountMigrationInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewAccountMigrationInterface creates a new instance of AccountMigrationInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewAccountMigrationInterface(t mockConstructorTestingTNewAccountMigrationInterface) *AccountMigrationInterface { + mock := &AccountMigrationInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/CloudInterface.go b/server/channels/einterfaces/mocks/CloudInterface.go index 2dd2711650..f84300dbec 100644 --- a/server/channels/einterfaces/mocks/CloudInterface.go +++ b/server/channels/einterfaces/mocks/CloudInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -19,6 +19,10 @@ func (_m *CloudInterface) BootstrapSelfHostedSignup(req model.BootstrapSelfHoste ret := _m.Called(req) var r0 *model.BootstrapSelfHostedSignupResponse + var r1 error + if rf, ok := ret.Get(0).(func(model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error)); ok { + return rf(req) + } if rf, ok := ret.Get(0).(func(model.BootstrapSelfHostedSignupRequest) *model.BootstrapSelfHostedSignupResponse); ok { r0 = rf(req) } else { @@ -27,7 +31,6 @@ func (_m *CloudInterface) BootstrapSelfHostedSignup(req model.BootstrapSelfHoste } } - var r1 error if rf, ok := ret.Get(1).(func(model.BootstrapSelfHostedSignupRequest) error); ok { r1 = rf(req) } else { @@ -42,6 +45,10 @@ func (_m *CloudInterface) ChangeSubscription(userID string, subscriptionID strin ret := _m.Called(userID, subscriptionID, subscriptionChange) var r0 *model.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.SubscriptionChange) (*model.Subscription, error)); ok { + return rf(userID, subscriptionID, subscriptionChange) + } if rf, ok := ret.Get(0).(func(string, string, *model.SubscriptionChange) *model.Subscription); ok { r0 = rf(userID, subscriptionID, subscriptionChange) } else { @@ -50,7 +57,6 @@ func (_m *CloudInterface) ChangeSubscription(userID string, subscriptionID strin } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.SubscriptionChange) error); ok { r1 = rf(userID, subscriptionID, subscriptionChange) } else { @@ -93,6 +99,10 @@ func (_m *CloudInterface) ConfirmSelfHostedSignup(req model.SelfHostedConfirmPay ret := _m.Called(req, requesterEmail) var r0 *model.SelfHostedSignupConfirmResponse + var r1 error + if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) (*model.SelfHostedSignupConfirmResponse, error)); ok { + return rf(req, requesterEmail) + } if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) *model.SelfHostedSignupConfirmResponse); ok { r0 = rf(req, requesterEmail) } else { @@ -101,7 +111,6 @@ func (_m *CloudInterface) ConfirmSelfHostedSignup(req model.SelfHostedConfirmPay } } - var r1 error if rf, ok := ret.Get(1).(func(model.SelfHostedConfirmPaymentMethodRequest, string) error); ok { r1 = rf(req, requesterEmail) } else { @@ -130,6 +139,10 @@ func (_m *CloudInterface) CreateCustomerPayment(userID string) (*model.StripeSet ret := _m.Called(userID) var r0 *model.StripeSetupIntent + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.StripeSetupIntent, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.StripeSetupIntent); ok { r0 = rf(userID) } else { @@ -138,7 +151,6 @@ func (_m *CloudInterface) CreateCustomerPayment(userID string) (*model.StripeSet } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -153,6 +165,10 @@ func (_m *CloudInterface) CreateCustomerSelfHostedSignup(req model.SelfHostedCus ret := _m.Called(req, requesterEmail) var r0 *model.SelfHostedSignupCustomerResponse + var r1 error + if rf, ok := ret.Get(0).(func(model.SelfHostedCustomerForm, string) (*model.SelfHostedSignupCustomerResponse, error)); ok { + return rf(req, requesterEmail) + } if rf, ok := ret.Get(0).(func(model.SelfHostedCustomerForm, string) *model.SelfHostedSignupCustomerResponse); ok { r0 = rf(req, requesterEmail) } else { @@ -161,7 +177,6 @@ func (_m *CloudInterface) CreateCustomerSelfHostedSignup(req model.SelfHostedCus } } - var r1 error if rf, ok := ret.Get(1).(func(model.SelfHostedCustomerForm, string) error); ok { r1 = rf(req, requesterEmail) } else { @@ -176,6 +191,10 @@ func (_m *CloudInterface) CreateOrUpdateSubscriptionHistoryEvent(userID string, ret := _m.Called(userID, userCount) var r0 *model.SubscriptionHistory + var r1 error + if rf, ok := ret.Get(0).(func(string, int) (*model.SubscriptionHistory, error)); ok { + return rf(userID, userCount) + } if rf, ok := ret.Get(0).(func(string, int) *model.SubscriptionHistory); ok { r0 = rf(userID, userCount) } else { @@ -184,7 +203,6 @@ func (_m *CloudInterface) CreateOrUpdateSubscriptionHistoryEvent(userID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, int) error); ok { r1 = rf(userID, userCount) } else { @@ -199,6 +217,10 @@ func (_m *CloudInterface) GetCloudCustomer(userID string) (*model.CloudCustomer, ret := _m.Called(userID) var r0 *model.CloudCustomer + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.CloudCustomer, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.CloudCustomer); ok { r0 = rf(userID) } else { @@ -207,7 +229,6 @@ func (_m *CloudInterface) GetCloudCustomer(userID string) (*model.CloudCustomer, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -222,6 +243,10 @@ func (_m *CloudInterface) GetCloudLimits(userID string) (*model.ProductLimits, e ret := _m.Called(userID) var r0 *model.ProductLimits + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.ProductLimits, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.ProductLimits); ok { r0 = rf(userID) } else { @@ -230,7 +255,6 @@ func (_m *CloudInterface) GetCloudLimits(userID string) (*model.ProductLimits, e } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -245,6 +269,10 @@ func (_m *CloudInterface) GetCloudProduct(userID string, productID string) (*mod ret := _m.Called(userID, productID) var r0 *model.Product + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Product, error)); ok { + return rf(userID, productID) + } if rf, ok := ret.Get(0).(func(string, string) *model.Product); ok { r0 = rf(userID, productID) } else { @@ -253,7 +281,6 @@ func (_m *CloudInterface) GetCloudProduct(userID string, productID string) (*mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, productID) } else { @@ -268,6 +295,10 @@ func (_m *CloudInterface) GetCloudProducts(userID string, includeLegacyProducts ret := _m.Called(userID, includeLegacyProducts) var r0 []*model.Product + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) ([]*model.Product, error)); ok { + return rf(userID, includeLegacyProducts) + } if rf, ok := ret.Get(0).(func(string, bool) []*model.Product); ok { r0 = rf(userID, includeLegacyProducts) } else { @@ -276,7 +307,6 @@ func (_m *CloudInterface) GetCloudProducts(userID string, includeLegacyProducts } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(userID, includeLegacyProducts) } else { @@ -291,6 +321,11 @@ func (_m *CloudInterface) GetInvoicePDF(userID string, invoiceID string) ([]byte ret := _m.Called(userID, invoiceID) var r0 []byte + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(string, string) ([]byte, string, error)); ok { + return rf(userID, invoiceID) + } if rf, ok := ret.Get(0).(func(string, string) []byte); ok { r0 = rf(userID, invoiceID) } else { @@ -299,14 +334,12 @@ func (_m *CloudInterface) GetInvoicePDF(userID string, invoiceID string) ([]byte } } - var r1 string if rf, ok := ret.Get(1).(func(string, string) string); ok { r1 = rf(userID, invoiceID) } else { r1 = ret.Get(1).(string) } - var r2 error if rf, ok := ret.Get(2).(func(string, string) error); ok { r2 = rf(userID, invoiceID) } else { @@ -321,6 +354,10 @@ func (_m *CloudInterface) GetInvoicesForSubscription(userID string) ([]*model.In ret := _m.Called(userID) var r0 []*model.Invoice + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Invoice, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Invoice); ok { r0 = rf(userID) } else { @@ -329,7 +366,6 @@ func (_m *CloudInterface) GetInvoicesForSubscription(userID string) ([]*model.In } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -344,6 +380,10 @@ func (_m *CloudInterface) GetLicenseSelfServeStatus(userID string, token string) ret := _m.Called(userID, token) var r0 *model.SubscriptionLicenseSelfServeStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.SubscriptionLicenseSelfServeStatusResponse, error)); ok { + return rf(userID, token) + } if rf, ok := ret.Get(0).(func(string, string) *model.SubscriptionLicenseSelfServeStatusResponse); ok { r0 = rf(userID, token) } else { @@ -352,7 +392,6 @@ func (_m *CloudInterface) GetLicenseSelfServeStatus(userID string, token string) } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, token) } else { @@ -367,6 +406,11 @@ func (_m *CloudInterface) GetSelfHostedInvoicePDF(invoiceID string) ([]byte, str ret := _m.Called(invoiceID) var r0 []byte + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(string) ([]byte, string, error)); ok { + return rf(invoiceID) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(invoiceID) } else { @@ -375,14 +419,12 @@ func (_m *CloudInterface) GetSelfHostedInvoicePDF(invoiceID string) ([]byte, str } } - var r1 string if rf, ok := ret.Get(1).(func(string) string); ok { r1 = rf(invoiceID) } else { r1 = ret.Get(1).(string) } - var r2 error if rf, ok := ret.Get(2).(func(string) error); ok { r2 = rf(invoiceID) } else { @@ -397,6 +439,10 @@ func (_m *CloudInterface) GetSelfHostedInvoices() ([]*model.Invoice, error) { ret := _m.Called() var r0 []*model.Invoice + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Invoice, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Invoice); ok { r0 = rf() } else { @@ -405,7 +451,6 @@ func (_m *CloudInterface) GetSelfHostedInvoices() ([]*model.Invoice, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -420,6 +465,10 @@ func (_m *CloudInterface) GetSelfHostedProducts(userID string) ([]*model.Product ret := _m.Called(userID) var r0 []*model.Product + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Product, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Product); ok { r0 = rf(userID) } else { @@ -428,7 +477,6 @@ func (_m *CloudInterface) GetSelfHostedProducts(userID string) ([]*model.Product } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -443,6 +491,10 @@ func (_m *CloudInterface) GetSubscription(userID string) (*model.Subscription, e ret := _m.Called(userID) var r0 *model.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Subscription, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.Subscription); ok { r0 = rf(userID) } else { @@ -451,7 +503,6 @@ func (_m *CloudInterface) GetSubscription(userID string) (*model.Subscription, e } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -494,6 +545,10 @@ func (_m *CloudInterface) RequestCloudTrial(userID string, subscriptionID string ret := _m.Called(userID, subscriptionID, newValidBusinessEmail) var r0 *model.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (*model.Subscription, error)); ok { + return rf(userID, subscriptionID, newValidBusinessEmail) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.Subscription); ok { r0 = rf(userID, subscriptionID, newValidBusinessEmail) } else { @@ -502,7 +557,6 @@ func (_m *CloudInterface) RequestCloudTrial(userID string, subscriptionID string } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(userID, subscriptionID, newValidBusinessEmail) } else { @@ -559,6 +613,10 @@ func (_m *CloudInterface) UpdateCloudCustomer(userID string, customerInfo *model ret := _m.Called(userID, customerInfo) var r0 *model.CloudCustomer + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.CloudCustomerInfo) (*model.CloudCustomer, error)); ok { + return rf(userID, customerInfo) + } if rf, ok := ret.Get(0).(func(string, *model.CloudCustomerInfo) *model.CloudCustomer); ok { r0 = rf(userID, customerInfo) } else { @@ -567,7 +625,6 @@ func (_m *CloudInterface) UpdateCloudCustomer(userID string, customerInfo *model } } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.CloudCustomerInfo) error); ok { r1 = rf(userID, customerInfo) } else { @@ -582,6 +639,10 @@ func (_m *CloudInterface) UpdateCloudCustomerAddress(userID string, address *mod ret := _m.Called(userID, address) var r0 *model.CloudCustomer + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.Address) (*model.CloudCustomer, error)); ok { + return rf(userID, address) + } if rf, ok := ret.Get(0).(func(string, *model.Address) *model.CloudCustomer); ok { r0 = rf(userID, address) } else { @@ -590,7 +651,6 @@ func (_m *CloudInterface) UpdateCloudCustomerAddress(userID string, address *mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.Address) error); ok { r1 = rf(userID, address) } else { @@ -613,3 +673,18 @@ func (_m *CloudInterface) ValidateBusinessEmail(userID string, email string) err return r0 } + +type mockConstructorTestingTNewCloudInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewCloudInterface creates a new instance of CloudInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCloudInterface(t mockConstructorTestingTNewCloudInterface) *CloudInterface { + mock := &CloudInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/CloudJobInterface.go b/server/channels/einterfaces/mocks/CloudJobInterface.go index bd3c9bc224..5e08488c1b 100644 --- a/server/channels/einterfaces/mocks/CloudJobInterface.go +++ b/server/channels/einterfaces/mocks/CloudJobInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *CloudJobInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewCloudJobInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewCloudJobInterface creates a new instance of CloudJobInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCloudJobInterface(t mockConstructorTestingTNewCloudJobInterface) *CloudJobInterface { + mock := &CloudJobInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/ClusterInterface.go b/server/channels/einterfaces/mocks/ClusterInterface.go index 1ae18cbaa7..e957a860d2 100644 --- a/server/channels/einterfaces/mocks/ClusterInterface.go +++ b/server/channels/einterfaces/mocks/ClusterInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -67,6 +67,10 @@ func (_m *ClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model.App ret := _m.Called() var r0 []*model.ClusterStats + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() ([]*model.ClusterStats, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.ClusterStats); ok { r0 = rf() } else { @@ -75,7 +79,6 @@ func (_m *ClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model.App } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -92,6 +95,10 @@ func (_m *ClusterInterface) GetLogs(page int, perPage int) ([]string, *model.App ret := _m.Called(page, perPage) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(int, int) ([]string, *model.AppError)); ok { + return rf(page, perPage) + } if rf, ok := ret.Get(0).(func(int, int) []string); ok { r0 = rf(page, perPage) } else { @@ -100,7 +107,6 @@ func (_m *ClusterInterface) GetLogs(page int, perPage int) ([]string, *model.App } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok { r1 = rf(page, perPage) } else { @@ -133,6 +139,10 @@ func (_m *ClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.Ap ret := _m.Called() var r0 model.PluginStatuses + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() (model.PluginStatuses, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() model.PluginStatuses); ok { r0 = rf() } else { @@ -141,7 +151,6 @@ func (_m *ClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.Ap } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -191,6 +200,10 @@ func (_m *ClusterInterface) QueryLogs(page int, perPage int) (map[string][]strin ret := _m.Called(page, perPage) var r0 map[string][]string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(int, int) (map[string][]string, *model.AppError)); ok { + return rf(page, perPage) + } if rf, ok := ret.Get(0).(func(int, int) map[string][]string); ok { r0 = rf(page, perPage) } else { @@ -199,7 +212,6 @@ func (_m *ClusterInterface) QueryLogs(page int, perPage int) (map[string][]strin } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok { r1 = rf(page, perPage) } else { @@ -244,3 +256,18 @@ func (_m *ClusterInterface) StartInterNodeCommunication() { func (_m *ClusterInterface) StopInterNodeCommunication() { _m.Called() } + +type mockConstructorTestingTNewClusterInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewClusterInterface creates a new instance of ClusterInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClusterInterface(t mockConstructorTestingTNewClusterInterface) *ClusterInterface { + mock := &ClusterInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/ClusterMessageHandler.go b/server/channels/einterfaces/mocks/ClusterMessageHandler.go index 26508ba142..b29eb7ce1b 100644 --- a/server/channels/einterfaces/mocks/ClusterMessageHandler.go +++ b/server/channels/einterfaces/mocks/ClusterMessageHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -18,3 +18,18 @@ type ClusterMessageHandler struct { func (_m *ClusterMessageHandler) Execute(msg *model.ClusterMessage) { _m.Called(msg) } + +type mockConstructorTestingTNewClusterMessageHandler interface { + mock.TestingT + Cleanup(func()) +} + +// NewClusterMessageHandler creates a new instance of ClusterMessageHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClusterMessageHandler(t mockConstructorTestingTNewClusterMessageHandler) *ClusterMessageHandler { + mock := &ClusterMessageHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/ComplianceInterface.go b/server/channels/einterfaces/mocks/ComplianceInterface.go index 460d2b54d9..ae4f1f772b 100644 --- a/server/channels/einterfaces/mocks/ComplianceInterface.go +++ b/server/channels/einterfaces/mocks/ComplianceInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -34,3 +34,18 @@ func (_m *ComplianceInterface) RunComplianceJob(job *model.Compliance) *model.Ap func (_m *ComplianceInterface) StartComplianceDailyJob() { _m.Called() } + +type mockConstructorTestingTNewComplianceInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewComplianceInterface creates a new instance of ComplianceInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewComplianceInterface(t mockConstructorTestingTNewComplianceInterface) *ComplianceInterface { + mock := &ComplianceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/DataRetentionInterface.go b/server/channels/einterfaces/mocks/DataRetentionInterface.go index 8e6e2b86f6..5d5932b9ff 100644 --- a/server/channels/einterfaces/mocks/DataRetentionInterface.go +++ b/server/channels/einterfaces/mocks/DataRetentionInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -51,6 +51,10 @@ func (_m *DataRetentionInterface) CreatePolicy(policy *model.RetentionPolicyWith ret := _m.Called(policy) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError)); ok { + return rf(policy) + } if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(policy) } else { @@ -59,7 +63,6 @@ func (_m *DataRetentionInterface) CreatePolicy(policy *model.RetentionPolicyWith } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.AppError); ok { r1 = rf(policy) } else { @@ -92,6 +95,10 @@ func (_m *DataRetentionInterface) GetChannelPoliciesForUser(userID string, offse ret := _m.Called(userID, offset, limit) var r0 *model.RetentionPolicyForChannelList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (*model.RetentionPolicyForChannelList, *model.AppError)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.RetentionPolicyForChannelList); ok { r0 = rf(userID, offset, limit) } else { @@ -100,7 +107,6 @@ func (_m *DataRetentionInterface) GetChannelPoliciesForUser(userID string, offse } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(userID, offset, limit) } else { @@ -117,6 +123,10 @@ func (_m *DataRetentionInterface) GetChannelsForPolicy(policyID string, offset i ret := _m.Called(policyID, offset, limit) var r0 *model.ChannelsWithCount + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (*model.ChannelsWithCount, *model.AppError)); ok { + return rf(policyID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.ChannelsWithCount); ok { r0 = rf(policyID, offset, limit) } else { @@ -125,7 +135,6 @@ func (_m *DataRetentionInterface) GetChannelsForPolicy(policyID string, offset i } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(policyID, offset, limit) } else { @@ -142,6 +151,10 @@ func (_m *DataRetentionInterface) GetGlobalPolicy() (*model.GlobalRetentionPolic ret := _m.Called() var r0 *model.GlobalRetentionPolicy + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() (*model.GlobalRetentionPolicy, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *model.GlobalRetentionPolicy); ok { r0 = rf() } else { @@ -150,7 +163,6 @@ func (_m *DataRetentionInterface) GetGlobalPolicy() (*model.GlobalRetentionPolic } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -167,6 +179,10 @@ func (_m *DataRetentionInterface) GetPolicies(offset int, limit int) (*model.Ret ret := _m.Called(offset, limit) var r0 *model.RetentionPolicyWithTeamAndChannelCountsList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(int, int) (*model.RetentionPolicyWithTeamAndChannelCountsList, *model.AppError)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) *model.RetentionPolicyWithTeamAndChannelCountsList); ok { r0 = rf(offset, limit) } else { @@ -175,7 +191,6 @@ func (_m *DataRetentionInterface) GetPolicies(offset int, limit int) (*model.Ret } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok { r1 = rf(offset, limit) } else { @@ -192,13 +207,16 @@ func (_m *DataRetentionInterface) GetPoliciesCount() (int64, *model.AppError) { ret := _m.Called() var r0 int64 + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() (int64, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -215,6 +233,10 @@ func (_m *DataRetentionInterface) GetPolicy(policyID string) (*model.RetentionPo ret := _m.Called(policyID) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError)); ok { + return rf(policyID) + } if rf, ok := ret.Get(0).(func(string) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(policyID) } else { @@ -223,7 +245,6 @@ func (_m *DataRetentionInterface) GetPolicy(policyID string) (*model.RetentionPo } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(policyID) } else { @@ -240,6 +261,10 @@ func (_m *DataRetentionInterface) GetTeamPoliciesForUser(userID string, offset i ret := _m.Called(userID, offset, limit) var r0 *model.RetentionPolicyForTeamList + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (*model.RetentionPolicyForTeamList, *model.AppError)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.RetentionPolicyForTeamList); ok { r0 = rf(userID, offset, limit) } else { @@ -248,7 +273,6 @@ func (_m *DataRetentionInterface) GetTeamPoliciesForUser(userID string, offset i } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(userID, offset, limit) } else { @@ -265,6 +289,10 @@ func (_m *DataRetentionInterface) GetTeamsForPolicy(policyID string, offset int, ret := _m.Called(policyID, offset, limit) var r0 *model.TeamsWithCount + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) (*model.TeamsWithCount, *model.AppError)); ok { + return rf(policyID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.TeamsWithCount); ok { r0 = rf(policyID, offset, limit) } else { @@ -273,7 +301,6 @@ func (_m *DataRetentionInterface) GetTeamsForPolicy(policyID string, offset int, } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(policyID, offset, limit) } else { @@ -290,6 +317,10 @@ func (_m *DataRetentionInterface) PatchPolicy(patch *model.RetentionPolicyWithTe ret := _m.Called(patch) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError)); ok { + return rf(patch) + } if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(patch) } else { @@ -298,7 +329,6 @@ func (_m *DataRetentionInterface) PatchPolicy(patch *model.RetentionPolicyWithTe } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.AppError); ok { r1 = rf(patch) } else { @@ -341,3 +371,18 @@ func (_m *DataRetentionInterface) RemoveTeamsFromPolicy(policyID string, teamIDs return r0 } + +type mockConstructorTestingTNewDataRetentionInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewDataRetentionInterface creates a new instance of DataRetentionInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewDataRetentionInterface(t mockConstructorTestingTNewDataRetentionInterface) *DataRetentionInterface { + mock := &DataRetentionInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/DataRetentionJobInterface.go b/server/channels/einterfaces/mocks/DataRetentionJobInterface.go index ff4ef6710f..7e6d4769c3 100644 --- a/server/channels/einterfaces/mocks/DataRetentionJobInterface.go +++ b/server/channels/einterfaces/mocks/DataRetentionJobInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *DataRetentionJobInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewDataRetentionJobInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewDataRetentionJobInterface creates a new instance of DataRetentionJobInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewDataRetentionJobInterface(t mockConstructorTestingTNewDataRetentionJobInterface) *DataRetentionJobInterface { + mock := &DataRetentionJobInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/ElasticsearchAggregatorInterface.go b/server/channels/einterfaces/mocks/ElasticsearchAggregatorInterface.go index 65bdc56b1e..3c821c7603 100644 --- a/server/channels/einterfaces/mocks/ElasticsearchAggregatorInterface.go +++ b/server/channels/einterfaces/mocks/ElasticsearchAggregatorInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *ElasticsearchAggregatorInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewElasticsearchAggregatorInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewElasticsearchAggregatorInterface creates a new instance of ElasticsearchAggregatorInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewElasticsearchAggregatorInterface(t mockConstructorTestingTNewElasticsearchAggregatorInterface) *ElasticsearchAggregatorInterface { + mock := &ElasticsearchAggregatorInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/ElasticsearchIndexerInterface.go b/server/channels/einterfaces/mocks/ElasticsearchIndexerInterface.go index 1190a1ecef..eea9855926 100644 --- a/server/channels/einterfaces/mocks/ElasticsearchIndexerInterface.go +++ b/server/channels/einterfaces/mocks/ElasticsearchIndexerInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -29,3 +29,18 @@ func (_m *ElasticsearchIndexerInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewElasticsearchIndexerInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewElasticsearchIndexerInterface creates a new instance of ElasticsearchIndexerInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewElasticsearchIndexerInterface(t mockConstructorTestingTNewElasticsearchIndexerInterface) *ElasticsearchIndexerInterface { + mock := &ElasticsearchIndexerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/IndexerJobInterface.go b/server/channels/einterfaces/mocks/IndexerJobInterface.go index de748168dd..b040153342 100644 --- a/server/channels/einterfaces/mocks/IndexerJobInterface.go +++ b/server/channels/einterfaces/mocks/IndexerJobInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -29,3 +29,18 @@ func (_m *IndexerJobInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewIndexerJobInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewIndexerJobInterface creates a new instance of IndexerJobInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewIndexerJobInterface(t mockConstructorTestingTNewIndexerJobInterface) *IndexerJobInterface { + mock := &IndexerJobInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/LdapInterface.go b/server/channels/einterfaces/mocks/LdapInterface.go index 16570eae60..fa6173fb42 100644 --- a/server/channels/einterfaces/mocks/LdapInterface.go +++ b/server/channels/einterfaces/mocks/LdapInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -66,6 +66,10 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string) ret := _m.Called(c, id, password) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*request.Context, string, string) (*model.User, *model.AppError)); ok { + return rf(c, id, password) + } if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.User); ok { r0 = rf(c, id, password) } else { @@ -74,7 +78,6 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string) } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*request.Context, string, string) *model.AppError); ok { r1 = rf(c, id, password) } else { @@ -121,6 +124,11 @@ func (_m *LdapInterface) GetAllGroupsPage(page int, perPage int, opts model.Ldap ret := _m.Called(page, perPage, opts) var r0 []*model.Group + var r1 int + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(int, int, model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)); ok { + return rf(page, perPage, opts) + } if rf, ok := ret.Get(0).(func(int, int, model.LdapGroupSearchOpts) []*model.Group); ok { r0 = rf(page, perPage, opts) } else { @@ -129,14 +137,12 @@ func (_m *LdapInterface) GetAllGroupsPage(page int, perPage int, opts model.Ldap } } - var r1 int if rf, ok := ret.Get(1).(func(int, int, model.LdapGroupSearchOpts) int); ok { r1 = rf(page, perPage, opts) } else { r1 = ret.Get(1).(int) } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(int, int, model.LdapGroupSearchOpts) *model.AppError); ok { r2 = rf(page, perPage, opts) } else { @@ -153,6 +159,10 @@ func (_m *LdapInterface) GetAllLdapUsers() ([]*model.User, *model.AppError) { ret := _m.Called() var r0 []*model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() ([]*model.User, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.User); ok { r0 = rf() } else { @@ -161,7 +171,6 @@ func (_m *LdapInterface) GetAllLdapUsers() ([]*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -178,6 +187,10 @@ func (_m *LdapInterface) GetGroup(groupUID string) (*model.Group, *model.AppErro ret := _m.Called(groupUID) var r0 *model.Group + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok { + return rf(groupUID) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(groupUID) } else { @@ -186,7 +199,6 @@ func (_m *LdapInterface) GetGroup(groupUID string) (*model.Group, *model.AppErro } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(groupUID) } else { @@ -217,6 +229,10 @@ func (_m *LdapInterface) GetUser(id string) (*model.User, *model.AppError) { ret := _m.Called(id) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(id) } else { @@ -225,7 +241,6 @@ func (_m *LdapInterface) GetUser(id string) (*model.User, *model.AppError) { } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(id) } else { @@ -242,6 +257,10 @@ func (_m *LdapInterface) GetUserAttributes(id string, attributes []string) (map[ ret := _m.Called(id, attributes) var r0 map[string]string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string) (map[string]string, *model.AppError)); ok { + return rf(id, attributes) + } if rf, ok := ret.Get(0).(func(string, []string) map[string]string); ok { r0 = rf(id, attributes) } else { @@ -250,7 +269,6 @@ func (_m *LdapInterface) GetUserAttributes(id string, attributes []string) (map[ } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok { r1 = rf(id, attributes) } else { @@ -267,13 +285,16 @@ func (_m *LdapInterface) GetVendorNameAndVendorVersion() (string, string) { ret := _m.Called() var r0 string + var r1 string + if rf, ok := ret.Get(0).(func() (string, string)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func() string); ok { r1 = rf() } else { @@ -318,6 +339,10 @@ func (_m *LdapInterface) StartSynchronizeJob(waitForJobToFinish bool, includeRem ret := _m.Called(waitForJobToFinish, includeRemovedMembers) var r0 *model.Job + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(bool, bool) (*model.Job, *model.AppError)); ok { + return rf(waitForJobToFinish, includeRemovedMembers) + } if rf, ok := ret.Get(0).(func(bool, bool) *model.Job); ok { r0 = rf(waitForJobToFinish, includeRemovedMembers) } else { @@ -326,7 +351,6 @@ func (_m *LdapInterface) StartSynchronizeJob(waitForJobToFinish bool, includeRem } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(bool, bool) *model.AppError); ok { r1 = rf(waitForJobToFinish, includeRemovedMembers) } else { @@ -358,3 +382,18 @@ func (_m *LdapInterface) SwitchToLdap(userID string, ldapID string, ldapPassword func (_m *LdapInterface) UpdateProfilePictureIfNecessary(_a0 request.CTX, _a1 model.User, _a2 model.Session) { _m.Called(_a0, _a1, _a2) } + +type mockConstructorTestingTNewLdapInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewLdapInterface creates a new instance of LdapInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLdapInterface(t mockConstructorTestingTNewLdapInterface) *LdapInterface { + mock := &LdapInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/LdapSyncInterface.go b/server/channels/einterfaces/mocks/LdapSyncInterface.go index 803ed3eaf3..078cbe105f 100644 --- a/server/channels/einterfaces/mocks/LdapSyncInterface.go +++ b/server/channels/einterfaces/mocks/LdapSyncInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *LdapSyncInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewLdapSyncInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewLdapSyncInterface creates a new instance of LdapSyncInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLdapSyncInterface(t mockConstructorTestingTNewLdapSyncInterface) *LdapSyncInterface { + mock := &LdapSyncInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/LicenseInterface.go b/server/channels/einterfaces/mocks/LicenseInterface.go index 35a884ca5b..e7aa66322f 100644 --- a/server/channels/einterfaces/mocks/LicenseInterface.go +++ b/server/channels/einterfaces/mocks/LicenseInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -19,13 +19,16 @@ func (_m *LicenseInterface) CanStartTrial() (bool, error) { ret := _m.Called() var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -40,6 +43,10 @@ func (_m *LicenseInterface) GetPrevTrial() (*model.License, error) { ret := _m.Called() var r0 *model.License + var r1 error + if rf, ok := ret.Get(0).(func() (*model.License, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *model.License); ok { r0 = rf() } else { @@ -48,7 +55,6 @@ func (_m *LicenseInterface) GetPrevTrial() (*model.License, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -57,3 +63,18 @@ func (_m *LicenseInterface) GetPrevTrial() (*model.License, error) { return r0, r1 } + +type mockConstructorTestingTNewLicenseInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewLicenseInterface creates a new instance of LicenseInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLicenseInterface(t mockConstructorTestingTNewLicenseInterface) *LicenseInterface { + mock := &LicenseInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/MessageExportInterface.go b/server/channels/einterfaces/mocks/MessageExportInterface.go index a3767eb93a..229aa48f13 100644 --- a/server/channels/einterfaces/mocks/MessageExportInterface.go +++ b/server/channels/einterfaces/mocks/MessageExportInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -22,13 +22,16 @@ func (_m *MessageExportInterface) RunExport(format string, since int64, limit in ret := _m.Called(format, since, limit) var r0 int64 + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int64, int) (int64, *model.AppError)); ok { + return rf(format, since, limit) + } if rf, ok := ret.Get(0).(func(string, int64, int) int64); ok { r0 = rf(format, since, limit) } else { r0 = ret.Get(0).(int64) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int64, int) *model.AppError); ok { r1 = rf(format, since, limit) } else { @@ -45,6 +48,10 @@ func (_m *MessageExportInterface) StartSynchronizeJob(ctx context.Context, expor ret := _m.Called(ctx, exportFromTimestamp) var r0 *model.Job + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(context.Context, int64) (*model.Job, *model.AppError)); ok { + return rf(ctx, exportFromTimestamp) + } if rf, ok := ret.Get(0).(func(context.Context, int64) *model.Job); ok { r0 = rf(ctx, exportFromTimestamp) } else { @@ -53,7 +60,6 @@ func (_m *MessageExportInterface) StartSynchronizeJob(ctx context.Context, expor } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(context.Context, int64) *model.AppError); ok { r1 = rf(ctx, exportFromTimestamp) } else { @@ -64,3 +70,18 @@ func (_m *MessageExportInterface) StartSynchronizeJob(ctx context.Context, expor return r0, r1 } + +type mockConstructorTestingTNewMessageExportInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMessageExportInterface creates a new instance of MessageExportInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMessageExportInterface(t mockConstructorTestingTNewMessageExportInterface) *MessageExportInterface { + mock := &MessageExportInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/MessageExportJobInterface.go b/server/channels/einterfaces/mocks/MessageExportJobInterface.go index 62f7e9ede7..50b3763035 100644 --- a/server/channels/einterfaces/mocks/MessageExportJobInterface.go +++ b/server/channels/einterfaces/mocks/MessageExportJobInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -45,3 +45,18 @@ func (_m *MessageExportJobInterface) MakeWorker() model.Worker { return r0 } + +type mockConstructorTestingTNewMessageExportJobInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMessageExportJobInterface creates a new instance of MessageExportJobInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMessageExportJobInterface(t mockConstructorTestingTNewMessageExportJobInterface) *MessageExportJobInterface { + mock := &MessageExportJobInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/MetricsInterface.go b/server/channels/einterfaces/mocks/MetricsInterface.go index 9eb7d06b13..6d98d3607e 100644 --- a/server/channels/einterfaces/mocks/MetricsInterface.go +++ b/server/channels/einterfaces/mocks/MetricsInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -318,3 +318,18 @@ func (_m *MetricsInterface) SetReplicaLagAbsolute(node string, value float64) { func (_m *MetricsInterface) SetReplicaLagTime(node string, value float64) { _m.Called(node, value) } + +type mockConstructorTestingTNewMetricsInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMetricsInterface creates a new instance of MetricsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMetricsInterface(t mockConstructorTestingTNewMetricsInterface) *MetricsInterface { + mock := &MetricsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/MfaInterface.go b/server/channels/einterfaces/mocks/MfaInterface.go index 4f66e5d4e8..3df6e4bb67 100644 --- a/server/channels/einterfaces/mocks/MfaInterface.go +++ b/server/channels/einterfaces/mocks/MfaInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -51,13 +51,17 @@ func (_m *MfaInterface) GenerateSecret(user *model.User) (string, []byte, *model ret := _m.Called(user) var r0 string + var r1 []byte + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(*model.User) (string, []byte, *model.AppError)); ok { + return rf(user) + } if rf, ok := ret.Get(0).(func(*model.User) string); ok { r0 = rf(user) } else { r0 = ret.Get(0).(string) } - var r1 []byte if rf, ok := ret.Get(1).(func(*model.User) []byte); ok { r1 = rf(user) } else { @@ -66,7 +70,6 @@ func (_m *MfaInterface) GenerateSecret(user *model.User) (string, []byte, *model } } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(*model.User) *model.AppError); ok { r2 = rf(user) } else { @@ -83,13 +86,16 @@ func (_m *MfaInterface) ValidateToken(secret string, token string) (bool, *model ret := _m.Called(secret, token) var r0 bool + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string) (bool, *model.AppError)); ok { + return rf(secret, token) + } if rf, ok := ret.Get(0).(func(string, string) bool); ok { r0 = rf(secret, token) } else { r0 = ret.Get(0).(bool) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { r1 = rf(secret, token) } else { @@ -100,3 +106,18 @@ func (_m *MfaInterface) ValidateToken(secret string, token string) (bool, *model return r0, r1 } + +type mockConstructorTestingTNewMfaInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMfaInterface creates a new instance of MfaInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMfaInterface(t mockConstructorTestingTNewMfaInterface) *MfaInterface { + mock := &MfaInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/NotificationInterface.go b/server/channels/einterfaces/mocks/NotificationInterface.go index ca9a7163b6..2c67239fca 100644 --- a/server/channels/einterfaces/mocks/NotificationInterface.go +++ b/server/channels/einterfaces/mocks/NotificationInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -35,6 +35,10 @@ func (_m *NotificationInterface) GetNotificationMessage(ack *model.PushNotificat ret := _m.Called(ack, userID) var r0 *model.PushNotification + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*model.PushNotificationAck, string) (*model.PushNotification, *model.AppError)); ok { + return rf(ack, userID) + } if rf, ok := ret.Get(0).(func(*model.PushNotificationAck, string) *model.PushNotification); ok { r0 = rf(ack, userID) } else { @@ -43,7 +47,6 @@ func (_m *NotificationInterface) GetNotificationMessage(ack *model.PushNotificat } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*model.PushNotificationAck, string) *model.AppError); ok { r1 = rf(ack, userID) } else { @@ -54,3 +57,18 @@ func (_m *NotificationInterface) GetNotificationMessage(ack *model.PushNotificat return r0, r1 } + +type mockConstructorTestingTNewNotificationInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewNotificationInterface creates a new instance of NotificationInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNotificationInterface(t mockConstructorTestingTNewNotificationInterface) *NotificationInterface { + mock := &NotificationInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/OAuthProvider.go b/server/channels/einterfaces/mocks/OAuthProvider.go index d49778f55f..5568ebd5a3 100644 --- a/server/channels/einterfaces/mocks/OAuthProvider.go +++ b/server/channels/einterfaces/mocks/OAuthProvider.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -21,6 +21,10 @@ func (_m *OAuthProvider) GetSSOSettings(config *model.Config, service string) (* ret := _m.Called(config, service) var r0 *model.SSOSettings + var r1 error + if rf, ok := ret.Get(0).(func(*model.Config, string) (*model.SSOSettings, error)); ok { + return rf(config, service) + } if rf, ok := ret.Get(0).(func(*model.Config, string) *model.SSOSettings); ok { r0 = rf(config, service) } else { @@ -29,7 +33,6 @@ func (_m *OAuthProvider) GetSSOSettings(config *model.Config, service string) (* } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Config, string) error); ok { r1 = rf(config, service) } else { @@ -44,6 +47,10 @@ func (_m *OAuthProvider) GetUserFromIdToken(idToken string) (*model.User, error) ret := _m.Called(idToken) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { + return rf(idToken) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(idToken) } else { @@ -52,7 +59,6 @@ func (_m *OAuthProvider) GetUserFromIdToken(idToken string) (*model.User, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(idToken) } else { @@ -67,6 +73,10 @@ func (_m *OAuthProvider) GetUserFromJSON(data io.Reader, tokenUser *model.User) ret := _m.Called(data, tokenUser) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(io.Reader, *model.User) (*model.User, error)); ok { + return rf(data, tokenUser) + } if rf, ok := ret.Get(0).(func(io.Reader, *model.User) *model.User); ok { r0 = rf(data, tokenUser) } else { @@ -75,7 +85,6 @@ func (_m *OAuthProvider) GetUserFromJSON(data io.Reader, tokenUser *model.User) } } - var r1 error if rf, ok := ret.Get(1).(func(io.Reader, *model.User) error); ok { r1 = rf(data, tokenUser) } else { @@ -98,3 +107,18 @@ func (_m *OAuthProvider) IsSameUser(dbUser *model.User, oAuthUser *model.User) b return r0 } + +type mockConstructorTestingTNewOAuthProvider interface { + mock.TestingT + Cleanup(func()) +} + +// NewOAuthProvider creates a new instance of OAuthProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewOAuthProvider(t mockConstructorTestingTNewOAuthProvider) *OAuthProvider { + mock := &OAuthProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/einterfaces/mocks/SamlInterface.go b/server/channels/einterfaces/mocks/SamlInterface.go index 7b8a341b0e..f7908898c9 100644 --- a/server/channels/einterfaces/mocks/SamlInterface.go +++ b/server/channels/einterfaces/mocks/SamlInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make einterfaces-mocks`. @@ -20,6 +20,10 @@ func (_m *SamlInterface) BuildRequest(relayState string) (*model.SamlAuthRequest ret := _m.Called(relayState) var r0 *model.SamlAuthRequest + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (*model.SamlAuthRequest, *model.AppError)); ok { + return rf(relayState) + } if rf, ok := ret.Get(0).(func(string) *model.SamlAuthRequest); ok { r0 = rf(relayState) } else { @@ -28,7 +32,6 @@ func (_m *SamlInterface) BuildRequest(relayState string) (*model.SamlAuthRequest } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(relayState) } else { @@ -73,6 +76,10 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta ret := _m.Called(c, encodedXML, relayState) var r0 *model.User + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) (*model.User, *model.AppError)); ok { + return rf(c, encodedXML, relayState) + } if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) *model.User); ok { r0 = rf(c, encodedXML, relayState) } else { @@ -81,7 +88,6 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*request.Context, string, map[string]string) *model.AppError); ok { r1 = rf(c, encodedXML, relayState) } else { @@ -98,13 +104,16 @@ func (_m *SamlInterface) GetMetadata() (string, *model.AppError) { ret := _m.Called() var r0 string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func() (string, *model.AppError)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 *model.AppError if rf, ok := ret.Get(1).(func() *model.AppError); ok { r1 = rf() } else { @@ -115,3 +124,18 @@ func (_m *SamlInterface) GetMetadata() (string, *model.AppError) { return r0, r1 } + +type mockConstructorTestingTNewSamlInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewSamlInterface creates a new instance of SamlInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSamlInterface(t mockConstructorTestingTNewSamlInterface) *SamlInterface { + mock := &SamlInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/AuditStore.go b/server/channels/store/storetest/mocks/AuditStore.go index e91b4ac544..a5d6e361c5 100644 --- a/server/channels/store/storetest/mocks/AuditStore.go +++ b/server/channels/store/storetest/mocks/AuditStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits, ret := _m.Called(user_id, offset, limit) var r0 model.Audits + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.Audits, error)); ok { + return rf(user_id, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.Audits); ok { r0 = rf(user_id, offset, limit) } else { @@ -27,7 +31,6 @@ func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits, } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(user_id, offset, limit) } else { @@ -64,3 +67,18 @@ func (_m *AuditStore) Save(audit *model.Audit) error { return r0 } + +type mockConstructorTestingTNewAuditStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewAuditStore creates a new instance of AuditStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewAuditStore(t mockConstructorTestingTNewAuditStore) *AuditStore { + mock := &AuditStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/BotStore.go b/server/channels/store/storetest/mocks/BotStore.go index 8b58a5767e..857405adc3 100644 --- a/server/channels/store/storetest/mocks/BotStore.go +++ b/server/channels/store/storetest/mocks/BotStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *BotStore) Get(userID string, includeDeleted bool) (*model.Bot, error) ret := _m.Called(userID, includeDeleted) var r0 *model.Bot + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (*model.Bot, error)); ok { + return rf(userID, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, bool) *model.Bot); ok { r0 = rf(userID, includeDeleted) } else { @@ -27,7 +31,6 @@ func (_m *BotStore) Get(userID string, includeDeleted bool) (*model.Bot, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(userID, includeDeleted) } else { @@ -42,6 +45,10 @@ func (_m *BotStore) GetAll(options *model.BotGetOptions) ([]*model.Bot, error) { ret := _m.Called(options) var r0 []*model.Bot + var r1 error + if rf, ok := ret.Get(0).(func(*model.BotGetOptions) ([]*model.Bot, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.BotGetOptions) []*model.Bot); ok { r0 = rf(options) } else { @@ -50,7 +57,6 @@ func (_m *BotStore) GetAll(options *model.BotGetOptions) ([]*model.Bot, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.BotGetOptions) error); ok { r1 = rf(options) } else { @@ -79,6 +85,10 @@ func (_m *BotStore) Save(bot *model.Bot) (*model.Bot, error) { ret := _m.Called(bot) var r0 *model.Bot + var r1 error + if rf, ok := ret.Get(0).(func(*model.Bot) (*model.Bot, error)); ok { + return rf(bot) + } if rf, ok := ret.Get(0).(func(*model.Bot) *model.Bot); ok { r0 = rf(bot) } else { @@ -87,7 +97,6 @@ func (_m *BotStore) Save(bot *model.Bot) (*model.Bot, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Bot) error); ok { r1 = rf(bot) } else { @@ -102,6 +111,10 @@ func (_m *BotStore) Update(bot *model.Bot) (*model.Bot, error) { ret := _m.Called(bot) var r0 *model.Bot + var r1 error + if rf, ok := ret.Get(0).(func(*model.Bot) (*model.Bot, error)); ok { + return rf(bot) + } if rf, ok := ret.Get(0).(func(*model.Bot) *model.Bot); ok { r0 = rf(bot) } else { @@ -110,7 +123,6 @@ func (_m *BotStore) Update(bot *model.Bot) (*model.Bot, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Bot) error); ok { r1 = rf(bot) } else { @@ -119,3 +131,18 @@ func (_m *BotStore) Update(bot *model.Bot) (*model.Bot, error) { return r0, r1 } + +type mockConstructorTestingTNewBotStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewBotStore creates a new instance of BotStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBotStore(t mockConstructorTestingTNewBotStore) *BotStore { + mock := &BotStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ChannelMemberHistoryStore.go b/server/channels/store/storetest/mocks/ChannelMemberHistoryStore.go index dcd0f172a8..6835c8c94e 100644 --- a/server/channels/store/storetest/mocks/ChannelMemberHistoryStore.go +++ b/server/channels/store/storetest/mocks/ChannelMemberHistoryStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *ChannelMemberHistoryStore) DeleteOrphanedRows(limit int) (int64, error ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -40,6 +43,10 @@ func (_m *ChannelMemberHistoryStore) GetChannelsLeftSince(userID string, since i ret := _m.Called(userID, since) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, int64) ([]string, error)); ok { + return rf(userID, since) + } if rf, ok := ret.Get(0).(func(string, int64) []string); ok { r0 = rf(userID, since) } else { @@ -48,7 +55,6 @@ func (_m *ChannelMemberHistoryStore) GetChannelsLeftSince(userID string, since i } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64) error); ok { r1 = rf(userID, since) } else { @@ -63,6 +69,10 @@ func (_m *ChannelMemberHistoryStore) GetUsersInChannelDuring(startTime int64, en ret := _m.Called(startTime, endTime, channelID) var r0 []*model.ChannelMemberHistoryResult + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64, string) ([]*model.ChannelMemberHistoryResult, error)); ok { + return rf(startTime, endTime, channelID) + } if rf, ok := ret.Get(0).(func(int64, int64, string) []*model.ChannelMemberHistoryResult); ok { r0 = rf(startTime, endTime, channelID) } else { @@ -71,7 +81,6 @@ func (_m *ChannelMemberHistoryStore) GetUsersInChannelDuring(startTime int64, en } } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64, string) error); ok { r1 = rf(startTime, endTime, channelID) } else { @@ -114,13 +123,16 @@ func (_m *ChannelMemberHistoryStore) PermanentDeleteBatch(endTime int64, limit i ret := _m.Called(endTime, limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok { + return rf(endTime, limit) + } if rf, ok := ret.Get(0).(func(int64, int64) int64); ok { r0 = rf(endTime, limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64) error); ok { r1 = rf(endTime, limit) } else { @@ -135,20 +147,23 @@ func (_m *ChannelMemberHistoryStore) PermanentDeleteBatchForRetentionPolicies(no ret := _m.Called(now, globalPolicyEndTime, limit, cursor) var r0 int64 + var r1 model.RetentionPolicyCursor + var r2 error + if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok { + return rf(now, globalPolicyEndTime, limit, cursor) + } if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) int64); ok { r0 = rf(now, globalPolicyEndTime, limit, cursor) } else { r0 = ret.Get(0).(int64) } - var r1 model.RetentionPolicyCursor if rf, ok := ret.Get(1).(func(int64, int64, int64, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok { r1 = rf(now, globalPolicyEndTime, limit, cursor) } else { r1 = ret.Get(1).(model.RetentionPolicyCursor) } - var r2 error if rf, ok := ret.Get(2).(func(int64, int64, int64, model.RetentionPolicyCursor) error); ok { r2 = rf(now, globalPolicyEndTime, limit, cursor) } else { @@ -157,3 +172,18 @@ func (_m *ChannelMemberHistoryStore) PermanentDeleteBatchForRetentionPolicies(no return r0, r1, r2 } + +type mockConstructorTestingTNewChannelMemberHistoryStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewChannelMemberHistoryStore creates a new instance of ChannelMemberHistoryStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewChannelMemberHistoryStore(t mockConstructorTestingTNewChannelMemberHistoryStore) *ChannelMemberHistoryStore { + mock := &ChannelMemberHistoryStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ChannelStore.go b/server/channels/store/storetest/mocks/ChannelStore.go index f5345f0b58..97160c46c6 100644 --- a/server/channels/store/storetest/mocks/ChannelStore.go +++ b/server/channels/store/storetest/mocks/ChannelStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -25,13 +25,16 @@ func (_m *ChannelStore) AnalyticsDeletedTypeCount(teamID string, channelType mod ret := _m.Called(teamID, channelType) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, model.ChannelType) (int64, error)); ok { + return rf(teamID, channelType) + } if rf, ok := ret.Get(0).(func(string, model.ChannelType) int64); ok { r0 = rf(teamID, channelType) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, model.ChannelType) error); ok { r1 = rf(teamID, channelType) } else { @@ -46,13 +49,16 @@ func (_m *ChannelStore) AnalyticsTypeCount(teamID string, channelType model.Chan ret := _m.Called(teamID, channelType) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, model.ChannelType) (int64, error)); ok { + return rf(teamID, channelType) + } if rf, ok := ret.Get(0).(func(string, model.ChannelType) int64); ok { r0 = rf(teamID, channelType) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, model.ChannelType) error); ok { r1 = rf(teamID, channelType) } else { @@ -67,6 +73,10 @@ func (_m *ChannelStore) Autocomplete(userID string, term string, includeDeleted ret := _m.Called(userID, term, includeDeleted, isGuest) var r0 model.ChannelListWithTeamData + var r1 error + if rf, ok := ret.Get(0).(func(string, string, bool, bool) (model.ChannelListWithTeamData, error)); ok { + return rf(userID, term, includeDeleted, isGuest) + } if rf, ok := ret.Get(0).(func(string, string, bool, bool) model.ChannelListWithTeamData); ok { r0 = rf(userID, term, includeDeleted, isGuest) } else { @@ -75,7 +85,6 @@ func (_m *ChannelStore) Autocomplete(userID string, term string, includeDeleted } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, bool, bool) error); ok { r1 = rf(userID, term, includeDeleted, isGuest) } else { @@ -90,6 +99,10 @@ func (_m *ChannelStore) AutocompleteInTeam(teamID string, userID string, term st ret := _m.Called(teamID, userID, term, includeDeleted, isGuest) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, bool, bool) (model.ChannelList, error)); ok { + return rf(teamID, userID, term, includeDeleted, isGuest) + } if rf, ok := ret.Get(0).(func(string, string, string, bool, bool) model.ChannelList); ok { r0 = rf(teamID, userID, term, includeDeleted, isGuest) } else { @@ -98,7 +111,6 @@ func (_m *ChannelStore) AutocompleteInTeam(teamID string, userID string, term st } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, bool, bool) error); ok { r1 = rf(teamID, userID, term, includeDeleted, isGuest) } else { @@ -113,6 +125,10 @@ func (_m *ChannelStore) AutocompleteInTeamForSearch(teamID string, userID string ret := _m.Called(teamID, userID, term, includeDeleted) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, bool) (model.ChannelList, error)); ok { + return rf(teamID, userID, term, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, string, bool) model.ChannelList); ok { r0 = rf(teamID, userID, term, includeDeleted) } else { @@ -121,7 +137,6 @@ func (_m *ChannelStore) AutocompleteInTeamForSearch(teamID string, userID string } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok { r1 = rf(teamID, userID, term, includeDeleted) } else { @@ -174,20 +189,23 @@ func (_m *ChannelStore) CountPostsAfter(channelID string, timestamp int64, userI ret := _m.Called(channelID, timestamp, userID) var r0 int + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(string, int64, string) (int, int, error)); ok { + return rf(channelID, timestamp, userID) + } if rf, ok := ret.Get(0).(func(string, int64, string) int); ok { r0 = rf(channelID, timestamp, userID) } else { r0 = ret.Get(0).(int) } - var r1 int if rf, ok := ret.Get(1).(func(string, int64, string) int); ok { r1 = rf(channelID, timestamp, userID) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(string, int64, string) error); ok { r2 = rf(channelID, timestamp, userID) } else { @@ -202,13 +220,16 @@ func (_m *ChannelStore) CountUrgentPostsAfter(channelID string, timestamp int64, ret := _m.Called(channelID, timestamp, userID) var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, string) (int, error)); ok { + return rf(channelID, timestamp, userID) + } if rf, ok := ret.Get(0).(func(string, int64, string) int); ok { r0 = rf(channelID, timestamp, userID) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, string) error); ok { r1 = rf(channelID, timestamp, userID) } else { @@ -230,6 +251,10 @@ func (_m *ChannelStore) CreateDirectChannel(userID *model.User, otherUserID *mod ret := _m.Called(_ca...) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(*model.User, *model.User, ...model.ChannelOption) (*model.Channel, error)); ok { + return rf(userID, otherUserID, channelOptions...) + } if rf, ok := ret.Get(0).(func(*model.User, *model.User, ...model.ChannelOption) *model.Channel); ok { r0 = rf(userID, otherUserID, channelOptions...) } else { @@ -238,7 +263,6 @@ func (_m *ChannelStore) CreateDirectChannel(userID *model.User, otherUserID *mod } } - var r1 error if rf, ok := ret.Get(1).(func(*model.User, *model.User, ...model.ChannelOption) error); ok { r1 = rf(userID, otherUserID, channelOptions...) } else { @@ -253,6 +277,10 @@ func (_m *ChannelStore) CreateInitialSidebarCategories(userID string, opts *stor ret := _m.Called(userID, opts) var r0 *model.OrderedSidebarCategories + var r1 error + if rf, ok := ret.Get(0).(func(string, *store.SidebarCategorySearchOpts) (*model.OrderedSidebarCategories, error)); ok { + return rf(userID, opts) + } if rf, ok := ret.Get(0).(func(string, *store.SidebarCategorySearchOpts) *model.OrderedSidebarCategories); ok { r0 = rf(userID, opts) } else { @@ -261,7 +289,6 @@ func (_m *ChannelStore) CreateInitialSidebarCategories(userID string, opts *stor } } - var r1 error if rf, ok := ret.Get(1).(func(string, *store.SidebarCategorySearchOpts) error); ok { r1 = rf(userID, opts) } else { @@ -276,6 +303,10 @@ func (_m *ChannelStore) CreateSidebarCategory(userID string, teamID string, newC ret := _m.Called(userID, teamID, newCategory) var r0 *model.SidebarCategoryWithChannels + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, error)); ok { + return rf(userID, teamID, newCategory) + } if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) *model.SidebarCategoryWithChannels); ok { r0 = rf(userID, teamID, newCategory) } else { @@ -284,7 +315,6 @@ func (_m *ChannelStore) CreateSidebarCategory(userID string, teamID string, newC } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.SidebarCategoryWithChannels) error); ok { r1 = rf(userID, teamID, newCategory) } else { @@ -341,6 +371,10 @@ func (_m *ChannelStore) Get(id string, allowFromCache bool) (*model.Channel, err ret := _m.Called(id, allowFromCache) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (*model.Channel, error)); ok { + return rf(id, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) *model.Channel); ok { r0 = rf(id, allowFromCache) } else { @@ -349,7 +383,6 @@ func (_m *ChannelStore) Get(id string, allowFromCache bool) (*model.Channel, err } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(id, allowFromCache) } else { @@ -364,6 +397,10 @@ func (_m *ChannelStore) GetAll(teamID string) ([]*model.Channel, error) { ret := _m.Called(teamID) var r0 []*model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Channel, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.Channel); ok { r0 = rf(teamID) } else { @@ -372,7 +409,6 @@ func (_m *ChannelStore) GetAll(teamID string) ([]*model.Channel, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -387,6 +423,10 @@ func (_m *ChannelStore) GetAllChannelMembersById(id string) ([]string, error) { ret := _m.Called(id) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(id) } else { @@ -395,7 +435,6 @@ func (_m *ChannelStore) GetAllChannelMembersById(id string) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -410,6 +449,10 @@ func (_m *ChannelStore) GetAllChannelMembersForUser(userID string, allowFromCach ret := _m.Called(userID, allowFromCache, includeDeleted) var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, bool) (map[string]string, error)); ok { + return rf(userID, allowFromCache, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, bool, bool) map[string]string); ok { r0 = rf(userID, allowFromCache, includeDeleted) } else { @@ -418,7 +461,6 @@ func (_m *ChannelStore) GetAllChannelMembersForUser(userID string, allowFromCach } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, bool) error); ok { r1 = rf(userID, allowFromCache, includeDeleted) } else { @@ -433,6 +475,10 @@ func (_m *ChannelStore) GetAllChannelMembersNotifyPropsForChannel(channelID stri ret := _m.Called(channelID, allowFromCache) var r0 map[string]model.StringMap + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (map[string]model.StringMap, error)); ok { + return rf(channelID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) map[string]model.StringMap); ok { r0 = rf(channelID, allowFromCache) } else { @@ -441,7 +487,6 @@ func (_m *ChannelStore) GetAllChannelMembersNotifyPropsForChannel(channelID stri } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(channelID, allowFromCache) } else { @@ -456,6 +501,10 @@ func (_m *ChannelStore) GetAllChannels(page int, perPage int, opts store.Channel ret := _m.Called(page, perPage, opts) var r0 model.ChannelListWithTeamData + var r1 error + if rf, ok := ret.Get(0).(func(int, int, store.ChannelSearchOpts) (model.ChannelListWithTeamData, error)); ok { + return rf(page, perPage, opts) + } if rf, ok := ret.Get(0).(func(int, int, store.ChannelSearchOpts) model.ChannelListWithTeamData); ok { r0 = rf(page, perPage, opts) } else { @@ -464,7 +513,6 @@ func (_m *ChannelStore) GetAllChannels(page int, perPage int, opts store.Channel } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, store.ChannelSearchOpts) error); ok { r1 = rf(page, perPage, opts) } else { @@ -479,13 +527,16 @@ func (_m *ChannelStore) GetAllChannelsCount(opts store.ChannelSearchOpts) (int64 ret := _m.Called(opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(store.ChannelSearchOpts) (int64, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(store.ChannelSearchOpts) int64); ok { r0 = rf(opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(store.ChannelSearchOpts) error); ok { r1 = rf(opts) } else { @@ -500,6 +551,10 @@ func (_m *ChannelStore) GetAllChannelsForExportAfter(limit int, afterID string) ret := _m.Called(limit, afterID) var r0 []*model.ChannelForExport + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.ChannelForExport, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.ChannelForExport); ok { r0 = rf(limit, afterID) } else { @@ -508,7 +563,6 @@ func (_m *ChannelStore) GetAllChannelsForExportAfter(limit int, afterID string) } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -523,6 +577,10 @@ func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterID st ret := _m.Called(limit, afterID) var r0 []*model.DirectChannelForExport + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.DirectChannelForExport, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.DirectChannelForExport); ok { r0 = rf(limit, afterID) } else { @@ -531,7 +589,6 @@ func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterID st } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -546,6 +603,10 @@ func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bo ret := _m.Called(team_id, name, allowFromCache) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, error)); ok { + return rf(team_id, name, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok { r0 = rf(team_id, name, allowFromCache) } else { @@ -554,7 +615,6 @@ func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bo } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, bool) error); ok { r1 = rf(team_id, name, allowFromCache) } else { @@ -569,6 +629,10 @@ func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, all ret := _m.Called(team_id, name, allowFromCache) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, error)); ok { + return rf(team_id, name, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok { r0 = rf(team_id, name, allowFromCache) } else { @@ -577,7 +641,6 @@ func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, all } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, bool) error); ok { r1 = rf(team_id, name, allowFromCache) } else { @@ -592,6 +655,10 @@ func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCach ret := _m.Called(team_id, names, allowFromCache) var r0 []*model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, bool) ([]*model.Channel, error)); ok { + return rf(team_id, names, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, []string, bool) []*model.Channel); ok { r0 = rf(team_id, names, allowFromCache) } else { @@ -600,7 +667,6 @@ func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCach } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, bool) error); ok { r1 = rf(team_id, names, allowFromCache) } else { @@ -615,6 +681,10 @@ func (_m *ChannelStore) GetChannelCounts(teamID string, userID string) (*model.C ret := _m.Called(teamID, userID) var r0 *model.ChannelCounts + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelCounts, error)); ok { + return rf(teamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ChannelCounts); ok { r0 = rf(teamID, userID) } else { @@ -623,7 +693,6 @@ func (_m *ChannelStore) GetChannelCounts(teamID string, userID string) (*model.C } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(teamID, userID) } else { @@ -638,6 +707,10 @@ func (_m *ChannelStore) GetChannelMembersForExport(userID string, teamID string) ret := _m.Called(userID, teamID) var r0 []*model.ChannelMemberForExport + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.ChannelMemberForExport, error)); ok { + return rf(userID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.ChannelMemberForExport); ok { r0 = rf(userID, teamID) } else { @@ -646,7 +719,6 @@ func (_m *ChannelStore) GetChannelMembersForExport(userID string, teamID string) } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, teamID) } else { @@ -661,6 +733,10 @@ func (_m *ChannelStore) GetChannelMembersTimezones(channelID string) ([]model.St ret := _m.Called(channelID) var r0 []model.StringMap + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]model.StringMap, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) []model.StringMap); ok { r0 = rf(channelID) } else { @@ -669,7 +745,6 @@ func (_m *ChannelStore) GetChannelMembersTimezones(channelID string) ([]model.St } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -684,6 +759,10 @@ func (_m *ChannelStore) GetChannelUnread(channelID string, userID string) (*mode ret := _m.Called(channelID, userID) var r0 *model.ChannelUnread + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelUnread, error)); ok { + return rf(channelID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ChannelUnread); ok { r0 = rf(channelID, userID) } else { @@ -692,7 +771,6 @@ func (_m *ChannelStore) GetChannelUnread(channelID string, userID string) (*mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(channelID, userID) } else { @@ -707,6 +785,10 @@ func (_m *ChannelStore) GetChannels(teamID string, userID string, opts *model.Ch ret := _m.Called(teamID, userID, opts) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.ChannelSearchOpts) (model.ChannelList, error)); ok { + return rf(teamID, userID, opts) + } if rf, ok := ret.Get(0).(func(string, string, *model.ChannelSearchOpts) model.ChannelList); ok { r0 = rf(teamID, userID, opts) } else { @@ -715,7 +797,6 @@ func (_m *ChannelStore) GetChannels(teamID string, userID string, opts *model.Ch } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.ChannelSearchOpts) error); ok { r1 = rf(teamID, userID, opts) } else { @@ -730,6 +811,10 @@ func (_m *ChannelStore) GetChannelsBatchForIndexing(startTime int64, startChanne ret := _m.Called(startTime, startChannelID, limit) var r0 []*model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(int64, string, int) ([]*model.Channel, error)); ok { + return rf(startTime, startChannelID, limit) + } if rf, ok := ret.Get(0).(func(int64, string, int) []*model.Channel); ok { r0 = rf(startTime, startChannelID, limit) } else { @@ -738,7 +823,6 @@ func (_m *ChannelStore) GetChannelsBatchForIndexing(startTime int64, startChanne } } - var r1 error if rf, ok := ret.Get(1).(func(int64, string, int) error); ok { r1 = rf(startTime, startChannelID, limit) } else { @@ -753,6 +837,10 @@ func (_m *ChannelStore) GetChannelsByIds(channelIds []string, includeDeleted boo ret := _m.Called(channelIds, includeDeleted) var r0 []*model.Channel + var r1 error + if rf, ok := ret.Get(0).(func([]string, bool) ([]*model.Channel, error)); ok { + return rf(channelIds, includeDeleted) + } if rf, ok := ret.Get(0).(func([]string, bool) []*model.Channel); ok { r0 = rf(channelIds, includeDeleted) } else { @@ -761,7 +849,6 @@ func (_m *ChannelStore) GetChannelsByIds(channelIds []string, includeDeleted boo } } - var r1 error if rf, ok := ret.Get(1).(func([]string, bool) error); ok { r1 = rf(channelIds, includeDeleted) } else { @@ -776,6 +863,10 @@ func (_m *ChannelStore) GetChannelsByScheme(schemeID string, offset int, limit i ret := _m.Called(schemeID, offset, limit) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelList, error)); ok { + return rf(schemeID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelList); ok { r0 = rf(schemeID, offset, limit) } else { @@ -784,7 +875,6 @@ func (_m *ChannelStore) GetChannelsByScheme(schemeID string, offset int, limit i } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(schemeID, offset, limit) } else { @@ -799,6 +889,10 @@ func (_m *ChannelStore) GetChannelsByUser(userID string, includeDeleted bool, la ret := _m.Called(userID, includeDeleted, lastDeleteAt, pageSize, fromChannelID) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, int, int, string) (model.ChannelList, error)); ok { + return rf(userID, includeDeleted, lastDeleteAt, pageSize, fromChannelID) + } if rf, ok := ret.Get(0).(func(string, bool, int, int, string) model.ChannelList); ok { r0 = rf(userID, includeDeleted, lastDeleteAt, pageSize, fromChannelID) } else { @@ -807,7 +901,6 @@ func (_m *ChannelStore) GetChannelsByUser(userID string, includeDeleted bool, la } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, int, int, string) error); ok { r1 = rf(userID, includeDeleted, lastDeleteAt, pageSize, fromChannelID) } else { @@ -822,6 +915,10 @@ func (_m *ChannelStore) GetChannelsWithCursor(teamId string, userId string, opts ret := _m.Called(teamId, userId, opts, afterChannelID) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.ChannelSearchOpts, string) (model.ChannelList, error)); ok { + return rf(teamId, userId, opts, afterChannelID) + } if rf, ok := ret.Get(0).(func(string, string, *model.ChannelSearchOpts, string) model.ChannelList); ok { r0 = rf(teamId, userId, opts, afterChannelID) } else { @@ -830,7 +927,6 @@ func (_m *ChannelStore) GetChannelsWithCursor(teamId string, userId string, opts } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.ChannelSearchOpts, string) error); ok { r1 = rf(teamId, userId, opts, afterChannelID) } else { @@ -845,6 +941,10 @@ func (_m *ChannelStore) GetChannelsWithTeamDataByIds(channelIds []string, includ ret := _m.Called(channelIds, includeDeleted) var r0 []*model.ChannelWithTeamData + var r1 error + if rf, ok := ret.Get(0).(func([]string, bool) ([]*model.ChannelWithTeamData, error)); ok { + return rf(channelIds, includeDeleted) + } if rf, ok := ret.Get(0).(func([]string, bool) []*model.ChannelWithTeamData); ok { r0 = rf(channelIds, includeDeleted) } else { @@ -853,7 +953,6 @@ func (_m *ChannelStore) GetChannelsWithTeamDataByIds(channelIds []string, includ } } - var r1 error if rf, ok := ret.Get(1).(func([]string, bool) error); ok { r1 = rf(channelIds, includeDeleted) } else { @@ -868,6 +967,10 @@ func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID ret := _m.Called(team_id, offset, limit, userID) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, string) (model.ChannelList, error)); ok { + return rf(team_id, offset, limit, userID) + } if rf, ok := ret.Get(0).(func(string, int, int, string) model.ChannelList); ok { r0 = rf(team_id, offset, limit, userID) } else { @@ -876,7 +979,6 @@ func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, string) error); ok { r1 = rf(team_id, offset, limit, userID) } else { @@ -891,6 +993,10 @@ func (_m *ChannelStore) GetDeletedByName(team_id string, name string) (*model.Ch ret := _m.Called(team_id, name) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Channel, error)); ok { + return rf(team_id, name) + } if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { r0 = rf(team_id, name) } else { @@ -899,7 +1005,6 @@ func (_m *ChannelStore) GetDeletedByName(team_id string, name string) (*model.Ch } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(team_id, name) } else { @@ -914,13 +1019,16 @@ func (_m *ChannelStore) GetFileCount(channelID string) (int64, error) { ret := _m.Called(channelID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(channelID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -935,6 +1043,10 @@ func (_m *ChannelStore) GetForPost(postID string) (*model.Channel, error) { ret := _m.Called(postID) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Channel, error)); ok { + return rf(postID) + } if rf, ok := ret.Get(0).(func(string) *model.Channel); ok { r0 = rf(postID) } else { @@ -943,7 +1055,6 @@ func (_m *ChannelStore) GetForPost(postID string) (*model.Channel, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postID) } else { @@ -958,13 +1069,16 @@ func (_m *ChannelStore) GetGuestCount(channelID string, allowFromCache bool) (in ret := _m.Called(channelID, allowFromCache) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok { + return rf(channelID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) int64); ok { r0 = rf(channelID, allowFromCache) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(channelID, allowFromCache) } else { @@ -979,6 +1093,10 @@ func (_m *ChannelStore) GetMany(ids []string, allowFromCache bool) (model.Channe ret := _m.Called(ids, allowFromCache) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func([]string, bool) (model.ChannelList, error)); ok { + return rf(ids, allowFromCache) + } if rf, ok := ret.Get(0).(func([]string, bool) model.ChannelList); ok { r0 = rf(ids, allowFromCache) } else { @@ -987,7 +1105,6 @@ func (_m *ChannelStore) GetMany(ids []string, allowFromCache bool) (model.Channe } } - var r1 error if rf, ok := ret.Get(1).(func([]string, bool) error); ok { r1 = rf(ids, allowFromCache) } else { @@ -1002,6 +1119,10 @@ func (_m *ChannelStore) GetMember(ctx context.Context, channelID string, userID ret := _m.Called(ctx, channelID, userID) var r0 *model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*model.ChannelMember, error)); ok { + return rf(ctx, channelID, userID) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.ChannelMember); ok { r0 = rf(ctx, channelID, userID) } else { @@ -1010,7 +1131,6 @@ func (_m *ChannelStore) GetMember(ctx context.Context, channelID string, userID } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, channelID, userID) } else { @@ -1025,13 +1145,16 @@ func (_m *ChannelStore) GetMemberCount(channelID string, allowFromCache bool) (i ret := _m.Called(channelID, allowFromCache) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok { + return rf(channelID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) int64); ok { r0 = rf(channelID, allowFromCache) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(channelID, allowFromCache) } else { @@ -1060,6 +1183,10 @@ func (_m *ChannelStore) GetMemberCountsByGroup(ctx context.Context, channelID st ret := _m.Called(ctx, channelID, includeTimezones) var r0 []*model.ChannelMemberCountByGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool) ([]*model.ChannelMemberCountByGroup, error)); ok { + return rf(ctx, channelID, includeTimezones) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool) []*model.ChannelMemberCountByGroup); ok { r0 = rf(ctx, channelID, includeTimezones) } else { @@ -1068,7 +1195,6 @@ func (_m *ChannelStore) GetMemberCountsByGroup(ctx context.Context, channelID st } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { r1 = rf(ctx, channelID, includeTimezones) } else { @@ -1083,6 +1209,10 @@ func (_m *ChannelStore) GetMemberForPost(postID string, userID string) (*model.C ret := _m.Called(postID, userID) var r0 *model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelMember, error)); ok { + return rf(postID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok { r0 = rf(postID, userID) } else { @@ -1091,7 +1221,6 @@ func (_m *ChannelStore) GetMemberForPost(postID string, userID string) (*model.C } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(postID, userID) } else { @@ -1106,6 +1235,10 @@ func (_m *ChannelStore) GetMembers(channelID string, offset int, limit int) (mod ret := _m.Called(channelID, offset, limit) var r0 model.ChannelMembers + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelMembers, error)); ok { + return rf(channelID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelMembers); ok { r0 = rf(channelID, offset, limit) } else { @@ -1114,7 +1247,6 @@ func (_m *ChannelStore) GetMembers(channelID string, offset int, limit int) (mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(channelID, offset, limit) } else { @@ -1129,6 +1261,10 @@ func (_m *ChannelStore) GetMembersByChannelIds(channelIds []string, userID strin ret := _m.Called(channelIds, userID) var r0 model.ChannelMembers + var r1 error + if rf, ok := ret.Get(0).(func([]string, string) (model.ChannelMembers, error)); ok { + return rf(channelIds, userID) + } if rf, ok := ret.Get(0).(func([]string, string) model.ChannelMembers); ok { r0 = rf(channelIds, userID) } else { @@ -1137,7 +1273,6 @@ func (_m *ChannelStore) GetMembersByChannelIds(channelIds []string, userID strin } } - var r1 error if rf, ok := ret.Get(1).(func([]string, string) error); ok { r1 = rf(channelIds, userID) } else { @@ -1152,6 +1287,10 @@ func (_m *ChannelStore) GetMembersByIds(channelID string, userIds []string) (mod ret := _m.Called(channelID, userIds) var r0 model.ChannelMembers + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (model.ChannelMembers, error)); ok { + return rf(channelID, userIds) + } if rf, ok := ret.Get(0).(func(string, []string) model.ChannelMembers); ok { r0 = rf(channelID, userIds) } else { @@ -1160,7 +1299,6 @@ func (_m *ChannelStore) GetMembersByIds(channelID string, userIds []string) (mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(channelID, userIds) } else { @@ -1175,6 +1313,10 @@ func (_m *ChannelStore) GetMembersForUser(teamID string, userID string) (model.C ret := _m.Called(teamID, userID) var r0 model.ChannelMembers + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (model.ChannelMembers, error)); ok { + return rf(teamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) model.ChannelMembers); ok { r0 = rf(teamID, userID) } else { @@ -1183,7 +1325,6 @@ func (_m *ChannelStore) GetMembersForUser(teamID string, userID string) (model.C } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(teamID, userID) } else { @@ -1198,6 +1339,10 @@ func (_m *ChannelStore) GetMembersForUserWithCursor(userID string, teamID string ret := _m.Called(userID, teamID, opts) var r0 model.ChannelMembers + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *store.ChannelMemberGraphQLSearchOpts) (model.ChannelMembers, error)); ok { + return rf(userID, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, *store.ChannelMemberGraphQLSearchOpts) model.ChannelMembers); ok { r0 = rf(userID, teamID, opts) } else { @@ -1206,7 +1351,6 @@ func (_m *ChannelStore) GetMembersForUserWithCursor(userID string, teamID string } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *store.ChannelMemberGraphQLSearchOpts) error); ok { r1 = rf(userID, teamID, opts) } else { @@ -1221,6 +1365,10 @@ func (_m *ChannelStore) GetMembersForUserWithPagination(userID string, page int, ret := _m.Called(userID, page, perPage) var r0 model.ChannelMembersWithTeamData + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelMembersWithTeamData, error)); ok { + return rf(userID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelMembersWithTeamData); ok { r0 = rf(userID, page, perPage) } else { @@ -1229,7 +1377,6 @@ func (_m *ChannelStore) GetMembersForUserWithPagination(userID string, page int, } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, page, perPage) } else { @@ -1244,6 +1391,10 @@ func (_m *ChannelStore) GetMembersInfoByChannelIds(channelIDs []string) (map[str ret := _m.Called(channelIDs) var r0 map[string][]*model.User + var r1 error + if rf, ok := ret.Get(0).(func([]string) (map[string][]*model.User, error)); ok { + return rf(channelIDs) + } if rf, ok := ret.Get(0).(func([]string) map[string][]*model.User); ok { r0 = rf(channelIDs) } else { @@ -1252,7 +1403,6 @@ func (_m *ChannelStore) GetMembersInfoByChannelIds(channelIDs []string) (map[str } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(channelIDs) } else { @@ -1267,6 +1417,10 @@ func (_m *ChannelStore) GetMoreChannels(teamID string, userID string, offset int ret := _m.Called(teamID, userID, offset, limit) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) (model.ChannelList, error)); ok { + return rf(teamID, userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) model.ChannelList); ok { r0 = rf(teamID, userID, offset, limit) } else { @@ -1275,7 +1429,6 @@ func (_m *ChannelStore) GetMoreChannels(teamID string, userID string, offset int } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(teamID, userID, offset, limit) } else { @@ -1290,13 +1443,16 @@ func (_m *ChannelStore) GetPinnedPostCount(channelID string, allowFromCache bool ret := _m.Called(channelID, allowFromCache) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok { + return rf(channelID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) int64); ok { r0 = rf(channelID, allowFromCache) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(channelID, allowFromCache) } else { @@ -1311,6 +1467,10 @@ func (_m *ChannelStore) GetPinnedPosts(channelID string) (*model.PostList, error ret := _m.Called(channelID) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.PostList, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) *model.PostList); ok { r0 = rf(channelID) } else { @@ -1319,7 +1479,6 @@ func (_m *ChannelStore) GetPinnedPosts(channelID string) (*model.PostList, error } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -1334,6 +1493,10 @@ func (_m *ChannelStore) GetPrivateChannelsForTeam(teamID string, offset int, lim ret := _m.Called(teamID, offset, limit) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelList, error)); ok { + return rf(teamID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelList); ok { r0 = rf(teamID, offset, limit) } else { @@ -1342,7 +1505,6 @@ func (_m *ChannelStore) GetPrivateChannelsForTeam(teamID string, offset int, lim } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(teamID, offset, limit) } else { @@ -1357,6 +1519,10 @@ func (_m *ChannelStore) GetPublicChannelsByIdsForTeam(teamID string, channelIds ret := _m.Called(teamID, channelIds) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (model.ChannelList, error)); ok { + return rf(teamID, channelIds) + } if rf, ok := ret.Get(0).(func(string, []string) model.ChannelList); ok { r0 = rf(teamID, channelIds) } else { @@ -1365,7 +1531,6 @@ func (_m *ChannelStore) GetPublicChannelsByIdsForTeam(teamID string, channelIds } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(teamID, channelIds) } else { @@ -1380,6 +1545,10 @@ func (_m *ChannelStore) GetPublicChannelsForTeam(teamID string, offset int, limi ret := _m.Called(teamID, offset, limit) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelList, error)); ok { + return rf(teamID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelList); ok { r0 = rf(teamID, offset, limit) } else { @@ -1388,7 +1557,6 @@ func (_m *ChannelStore) GetPublicChannelsForTeam(teamID string, offset int, limi } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(teamID, offset, limit) } else { @@ -1403,6 +1571,10 @@ func (_m *ChannelStore) GetSidebarCategories(userID string, opts *store.SidebarC ret := _m.Called(userID, opts) var r0 *model.OrderedSidebarCategories + var r1 error + if rf, ok := ret.Get(0).(func(string, *store.SidebarCategorySearchOpts) (*model.OrderedSidebarCategories, error)); ok { + return rf(userID, opts) + } if rf, ok := ret.Get(0).(func(string, *store.SidebarCategorySearchOpts) *model.OrderedSidebarCategories); ok { r0 = rf(userID, opts) } else { @@ -1411,7 +1583,6 @@ func (_m *ChannelStore) GetSidebarCategories(userID string, opts *store.SidebarC } } - var r1 error if rf, ok := ret.Get(1).(func(string, *store.SidebarCategorySearchOpts) error); ok { r1 = rf(userID, opts) } else { @@ -1426,6 +1597,10 @@ func (_m *ChannelStore) GetSidebarCategoriesForTeamForUser(userID string, teamID ret := _m.Called(userID, teamID) var r0 *model.OrderedSidebarCategories + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.OrderedSidebarCategories, error)); ok { + return rf(userID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) *model.OrderedSidebarCategories); ok { r0 = rf(userID, teamID) } else { @@ -1434,7 +1609,6 @@ func (_m *ChannelStore) GetSidebarCategoriesForTeamForUser(userID string, teamID } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, teamID) } else { @@ -1449,6 +1623,10 @@ func (_m *ChannelStore) GetSidebarCategory(categoryID string) (*model.SidebarCat ret := _m.Called(categoryID) var r0 *model.SidebarCategoryWithChannels + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.SidebarCategoryWithChannels, error)); ok { + return rf(categoryID) + } if rf, ok := ret.Get(0).(func(string) *model.SidebarCategoryWithChannels); ok { r0 = rf(categoryID) } else { @@ -1457,7 +1635,6 @@ func (_m *ChannelStore) GetSidebarCategory(categoryID string) (*model.SidebarCat } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(categoryID) } else { @@ -1472,6 +1649,10 @@ func (_m *ChannelStore) GetSidebarCategoryOrder(userID string, teamID string) ([ ret := _m.Called(userID, teamID) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]string, error)); ok { + return rf(userID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) []string); ok { r0 = rf(userID, teamID) } else { @@ -1480,7 +1661,6 @@ func (_m *ChannelStore) GetSidebarCategoryOrder(userID string, teamID string) ([ } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, teamID) } else { @@ -1495,6 +1675,10 @@ func (_m *ChannelStore) GetTeamChannels(teamID string) (model.ChannelList, error ret := _m.Called(teamID) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string) (model.ChannelList, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) model.ChannelList); ok { r0 = rf(teamID) } else { @@ -1503,7 +1687,6 @@ func (_m *ChannelStore) GetTeamChannels(teamID string) (model.ChannelList, error } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -1518,6 +1701,10 @@ func (_m *ChannelStore) GetTeamForChannel(channelID string) (*model.Team, error) ret := _m.Called(channelID) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Team, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(channelID) } else { @@ -1526,7 +1713,6 @@ func (_m *ChannelStore) GetTeamForChannel(channelID string) (*model.Team, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -1541,6 +1727,10 @@ func (_m *ChannelStore) GetTeamMembersForChannel(channelID string) ([]string, er ret := _m.Called(channelID) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(channelID) } else { @@ -1549,7 +1739,6 @@ func (_m *ChannelStore) GetTeamMembersForChannel(channelID string) ([]string, er } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -1564,6 +1753,10 @@ func (_m *ChannelStore) GetTopChannelsForTeamSince(teamID string, userID string, ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopChannelList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopChannelList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -1572,7 +1765,6 @@ func (_m *ChannelStore) GetTopChannelsForTeamSince(teamID string, userID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -1587,6 +1779,10 @@ func (_m *ChannelStore) GetTopChannelsForUserSince(userID string, teamID string, ret := _m.Called(userID, teamID, since, offset, limit) var r0 *model.TopChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopChannelList, error)); ok { + return rf(userID, teamID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopChannelList); ok { r0 = rf(userID, teamID, since, offset, limit) } else { @@ -1595,7 +1791,6 @@ func (_m *ChannelStore) GetTopChannelsForUserSince(userID string, teamID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(userID, teamID, since, offset, limit) } else { @@ -1610,6 +1805,10 @@ func (_m *ChannelStore) GetTopInactiveChannelsForTeamSince(teamID string, userID ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopInactiveChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopInactiveChannelList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopInactiveChannelList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -1618,7 +1817,6 @@ func (_m *ChannelStore) GetTopInactiveChannelsForTeamSince(teamID string, userID } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -1633,6 +1831,10 @@ func (_m *ChannelStore) GetTopInactiveChannelsForUserSince(teamID string, userID ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopInactiveChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopInactiveChannelList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopInactiveChannelList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -1641,7 +1843,6 @@ func (_m *ChannelStore) GetTopInactiveChannelsForUserSince(teamID string, userID } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -1656,13 +1857,16 @@ func (_m *ChannelStore) GroupSyncedChannelCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -1740,6 +1944,10 @@ func (_m *ChannelStore) MigrateChannelMembers(fromChannelID string, fromUserID s ret := _m.Called(fromChannelID, fromUserID) var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (map[string]string, error)); ok { + return rf(fromChannelID, fromUserID) + } if rf, ok := ret.Get(0).(func(string, string) map[string]string); ok { r0 = rf(fromChannelID, fromUserID) } else { @@ -1748,7 +1956,6 @@ func (_m *ChannelStore) MigrateChannelMembers(fromChannelID string, fromUserID s } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(fromChannelID, fromUserID) } else { @@ -1819,6 +2026,10 @@ func (_m *ChannelStore) PostCountsByDuration(channelIDs []string, sinceUnixMilli ret := _m.Called(channelIDs, sinceUnixMillis, userID, duration, groupingLocation) var r0 []*model.DurationPostCount + var r1 error + if rf, ok := ret.Get(0).(func([]string, int64, *string, model.PostCountGrouping, *time.Location) ([]*model.DurationPostCount, error)); ok { + return rf(channelIDs, sinceUnixMillis, userID, duration, groupingLocation) + } if rf, ok := ret.Get(0).(func([]string, int64, *string, model.PostCountGrouping, *time.Location) []*model.DurationPostCount); ok { r0 = rf(channelIDs, sinceUnixMillis, userID, duration, groupingLocation) } else { @@ -1827,7 +2038,6 @@ func (_m *ChannelStore) PostCountsByDuration(channelIDs []string, sinceUnixMilli } } - var r1 error if rf, ok := ret.Get(1).(func([]string, int64, *string, model.PostCountGrouping, *time.Location) error); ok { r1 = rf(channelIDs, sinceUnixMillis, userID, duration, groupingLocation) } else { @@ -1912,6 +2122,10 @@ func (_m *ChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) ( ret := _m.Called(channel, maxChannelsPerTeam) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(*model.Channel, int64) (*model.Channel, error)); ok { + return rf(channel, maxChannelsPerTeam) + } if rf, ok := ret.Get(0).(func(*model.Channel, int64) *model.Channel); ok { r0 = rf(channel, maxChannelsPerTeam) } else { @@ -1920,7 +2134,6 @@ func (_m *ChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) ( } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Channel, int64) error); ok { r1 = rf(channel, maxChannelsPerTeam) } else { @@ -1935,6 +2148,10 @@ func (_m *ChannelStore) SaveDirectChannel(channel *model.Channel, member1 *model ret := _m.Called(channel, member1, member2) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(*model.Channel, *model.ChannelMember, *model.ChannelMember) (*model.Channel, error)); ok { + return rf(channel, member1, member2) + } if rf, ok := ret.Get(0).(func(*model.Channel, *model.ChannelMember, *model.ChannelMember) *model.Channel); ok { r0 = rf(channel, member1, member2) } else { @@ -1943,7 +2160,6 @@ func (_m *ChannelStore) SaveDirectChannel(channel *model.Channel, member1 *model } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Channel, *model.ChannelMember, *model.ChannelMember) error); ok { r1 = rf(channel, member1, member2) } else { @@ -1958,6 +2174,10 @@ func (_m *ChannelStore) SaveMember(member *model.ChannelMember) (*model.ChannelM ret := _m.Called(member) var r0 *model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(*model.ChannelMember) (*model.ChannelMember, error)); ok { + return rf(member) + } if rf, ok := ret.Get(0).(func(*model.ChannelMember) *model.ChannelMember); ok { r0 = rf(member) } else { @@ -1966,7 +2186,6 @@ func (_m *ChannelStore) SaveMember(member *model.ChannelMember) (*model.ChannelM } } - var r1 error if rf, ok := ret.Get(1).(func(*model.ChannelMember) error); ok { r1 = rf(member) } else { @@ -1981,6 +2200,10 @@ func (_m *ChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]* ret := _m.Called(members) var r0 []*model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func([]*model.ChannelMember) ([]*model.ChannelMember, error)); ok { + return rf(members) + } if rf, ok := ret.Get(0).(func([]*model.ChannelMember) []*model.ChannelMember); ok { r0 = rf(members) } else { @@ -1989,7 +2212,6 @@ func (_m *ChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]* } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.ChannelMember) error); ok { r1 = rf(members) } else { @@ -2004,6 +2226,11 @@ func (_m *ChannelStore) SearchAllChannels(term string, opts store.ChannelSearchO ret := _m.Called(term, opts) var r0 model.ChannelListWithTeamData + var r1 int64 + var r2 error + if rf, ok := ret.Get(0).(func(string, store.ChannelSearchOpts) (model.ChannelListWithTeamData, int64, error)); ok { + return rf(term, opts) + } if rf, ok := ret.Get(0).(func(string, store.ChannelSearchOpts) model.ChannelListWithTeamData); ok { r0 = rf(term, opts) } else { @@ -2012,14 +2239,12 @@ func (_m *ChannelStore) SearchAllChannels(term string, opts store.ChannelSearchO } } - var r1 int64 if rf, ok := ret.Get(1).(func(string, store.ChannelSearchOpts) int64); ok { r1 = rf(term, opts) } else { r1 = ret.Get(1).(int64) } - var r2 error if rf, ok := ret.Get(2).(func(string, store.ChannelSearchOpts) error); ok { r2 = rf(term, opts) } else { @@ -2034,6 +2259,10 @@ func (_m *ChannelStore) SearchArchivedInTeam(teamID string, term string, userID ret := _m.Called(teamID, term, userID) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (model.ChannelList, error)); ok { + return rf(teamID, term, userID) + } if rf, ok := ret.Get(0).(func(string, string, string) model.ChannelList); ok { r0 = rf(teamID, term, userID) } else { @@ -2042,7 +2271,6 @@ func (_m *ChannelStore) SearchArchivedInTeam(teamID string, term string, userID } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(teamID, term, userID) } else { @@ -2057,6 +2285,10 @@ func (_m *ChannelStore) SearchForUserInTeam(userID string, teamID string, term s ret := _m.Called(userID, teamID, term, includeDeleted) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, bool) (model.ChannelList, error)); ok { + return rf(userID, teamID, term, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, string, bool) model.ChannelList); ok { r0 = rf(userID, teamID, term, includeDeleted) } else { @@ -2065,7 +2297,6 @@ func (_m *ChannelStore) SearchForUserInTeam(userID string, teamID string, term s } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok { r1 = rf(userID, teamID, term, includeDeleted) } else { @@ -2080,6 +2311,10 @@ func (_m *ChannelStore) SearchGroupChannels(userID string, term string) (model.C ret := _m.Called(userID, term) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (model.ChannelList, error)); ok { + return rf(userID, term) + } if rf, ok := ret.Get(0).(func(string, string) model.ChannelList); ok { r0 = rf(userID, term) } else { @@ -2088,7 +2323,6 @@ func (_m *ChannelStore) SearchGroupChannels(userID string, term string) (model.C } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, term) } else { @@ -2103,6 +2337,10 @@ func (_m *ChannelStore) SearchInTeam(teamID string, term string, includeDeleted ret := _m.Called(teamID, term, includeDeleted) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, bool) (model.ChannelList, error)); ok { + return rf(teamID, term, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, bool) model.ChannelList); ok { r0 = rf(teamID, term, includeDeleted) } else { @@ -2111,7 +2349,6 @@ func (_m *ChannelStore) SearchInTeam(teamID string, term string, includeDeleted } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, bool) error); ok { r1 = rf(teamID, term, includeDeleted) } else { @@ -2126,6 +2363,10 @@ func (_m *ChannelStore) SearchMore(userID string, teamID string, term string) (m ret := _m.Called(userID, teamID, term) var r0 model.ChannelList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (model.ChannelList, error)); ok { + return rf(userID, teamID, term) + } if rf, ok := ret.Get(0).(func(string, string, string) model.ChannelList); ok { r0 = rf(userID, teamID, term) } else { @@ -2134,7 +2375,6 @@ func (_m *ChannelStore) SearchMore(userID string, teamID string, term string) (m } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(userID, teamID, term) } else { @@ -2177,6 +2417,10 @@ func (_m *ChannelStore) Update(channel *model.Channel) (*model.Channel, error) { ret := _m.Called(channel) var r0 *model.Channel + var r1 error + if rf, ok := ret.Get(0).(func(*model.Channel) (*model.Channel, error)); ok { + return rf(channel) + } if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok { r0 = rf(channel) } else { @@ -2185,7 +2429,6 @@ func (_m *ChannelStore) Update(channel *model.Channel) (*model.Channel, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Channel) error); ok { r1 = rf(channel) } else { @@ -2200,6 +2443,10 @@ func (_m *ChannelStore) UpdateLastViewedAt(channelIds []string, userID string) ( ret := _m.Called(channelIds, userID) var r0 map[string]int64 + var r1 error + if rf, ok := ret.Get(0).(func([]string, string) (map[string]int64, error)); ok { + return rf(channelIds, userID) + } if rf, ok := ret.Get(0).(func([]string, string) map[string]int64); ok { r0 = rf(channelIds, userID) } else { @@ -2208,7 +2455,6 @@ func (_m *ChannelStore) UpdateLastViewedAt(channelIds []string, userID string) ( } } - var r1 error if rf, ok := ret.Get(1).(func([]string, string) error); ok { r1 = rf(channelIds, userID) } else { @@ -2223,6 +2469,10 @@ func (_m *ChannelStore) UpdateLastViewedAtPost(unreadPost *model.Post, userID st ret := _m.Called(unreadPost, userID, mentionCount, mentionCountRoot, urgentMentionCount, setUnreadCountRoot) var r0 *model.ChannelUnreadAt + var r1 error + if rf, ok := ret.Get(0).(func(*model.Post, string, int, int, int, bool) (*model.ChannelUnreadAt, error)); ok { + return rf(unreadPost, userID, mentionCount, mentionCountRoot, urgentMentionCount, setUnreadCountRoot) + } if rf, ok := ret.Get(0).(func(*model.Post, string, int, int, int, bool) *model.ChannelUnreadAt); ok { r0 = rf(unreadPost, userID, mentionCount, mentionCountRoot, urgentMentionCount, setUnreadCountRoot) } else { @@ -2231,7 +2481,6 @@ func (_m *ChannelStore) UpdateLastViewedAtPost(unreadPost *model.Post, userID st } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Post, string, int, int, int, bool) error); ok { r1 = rf(unreadPost, userID, mentionCount, mentionCountRoot, urgentMentionCount, setUnreadCountRoot) } else { @@ -2246,6 +2495,10 @@ func (_m *ChannelStore) UpdateMember(member *model.ChannelMember) (*model.Channe ret := _m.Called(member) var r0 *model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(*model.ChannelMember) (*model.ChannelMember, error)); ok { + return rf(member) + } if rf, ok := ret.Get(0).(func(*model.ChannelMember) *model.ChannelMember); ok { r0 = rf(member) } else { @@ -2254,7 +2507,6 @@ func (_m *ChannelStore) UpdateMember(member *model.ChannelMember) (*model.Channe } } - var r1 error if rf, ok := ret.Get(1).(func(*model.ChannelMember) error); ok { r1 = rf(member) } else { @@ -2269,6 +2521,10 @@ func (_m *ChannelStore) UpdateMemberNotifyProps(channelID string, userID string, ret := _m.Called(channelID, userID, props) var r0 *model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(string, string, map[string]string) (*model.ChannelMember, error)); ok { + return rf(channelID, userID, props) + } if rf, ok := ret.Get(0).(func(string, string, map[string]string) *model.ChannelMember); ok { r0 = rf(channelID, userID, props) } else { @@ -2277,7 +2533,6 @@ func (_m *ChannelStore) UpdateMemberNotifyProps(channelID string, userID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, map[string]string) error); ok { r1 = rf(channelID, userID, props) } else { @@ -2306,6 +2561,10 @@ func (_m *ChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([ ret := _m.Called(members) var r0 []*model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func([]*model.ChannelMember) ([]*model.ChannelMember, error)); ok { + return rf(members) + } if rf, ok := ret.Get(0).(func([]*model.ChannelMember) []*model.ChannelMember); ok { r0 = rf(members) } else { @@ -2314,7 +2573,6 @@ func (_m *ChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([ } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.ChannelMember) error); ok { r1 = rf(members) } else { @@ -2329,6 +2587,11 @@ func (_m *ChannelStore) UpdateSidebarCategories(userID string, teamID string, ca ret := _m.Called(userID, teamID, categories) var r0 []*model.SidebarCategoryWithChannels + var r1 []*model.SidebarCategoryWithChannels + var r2 error + if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, []*model.SidebarCategoryWithChannels, error)); ok { + return rf(userID, teamID, categories) + } if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) []*model.SidebarCategoryWithChannels); ok { r0 = rf(userID, teamID, categories) } else { @@ -2337,7 +2600,6 @@ func (_m *ChannelStore) UpdateSidebarCategories(userID string, teamID string, ca } } - var r1 []*model.SidebarCategoryWithChannels if rf, ok := ret.Get(1).(func(string, string, []*model.SidebarCategoryWithChannels) []*model.SidebarCategoryWithChannels); ok { r1 = rf(userID, teamID, categories) } else { @@ -2346,7 +2608,6 @@ func (_m *ChannelStore) UpdateSidebarCategories(userID string, teamID string, ca } } - var r2 error if rf, ok := ret.Get(2).(func(string, string, []*model.SidebarCategoryWithChannels) error); ok { r2 = rf(userID, teamID, categories) } else { @@ -2403,13 +2664,16 @@ func (_m *ChannelStore) UserBelongsToChannels(userID string, channelIds []string ret := _m.Called(userID, channelIds) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (bool, error)); ok { + return rf(userID, channelIds) + } if rf, ok := ret.Get(0).(func(string, []string) bool); ok { r0 = rf(userID, channelIds) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(userID, channelIds) } else { @@ -2418,3 +2682,18 @@ func (_m *ChannelStore) UserBelongsToChannels(userID string, channelIds []string return r0, r1 } + +type mockConstructorTestingTNewChannelStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewChannelStore creates a new instance of ChannelStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewChannelStore(t mockConstructorTestingTNewChannelStore) *ChannelStore { + mock := &ChannelStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ClusterDiscoveryStore.go b/server/channels/store/storetest/mocks/ClusterDiscoveryStore.go index 0d0e2c6206..4616e646ed 100644 --- a/server/channels/store/storetest/mocks/ClusterDiscoveryStore.go +++ b/server/channels/store/storetest/mocks/ClusterDiscoveryStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,13 +33,16 @@ func (_m *ClusterDiscoveryStore) Delete(discovery *model.ClusterDiscovery) (bool ret := _m.Called(discovery) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) (bool, error)); ok { + return rf(discovery) + } if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) bool); ok { r0 = rf(discovery) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*model.ClusterDiscovery) error); ok { r1 = rf(discovery) } else { @@ -54,13 +57,16 @@ func (_m *ClusterDiscoveryStore) Exists(discovery *model.ClusterDiscovery) (bool ret := _m.Called(discovery) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) (bool, error)); ok { + return rf(discovery) + } if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) bool); ok { r0 = rf(discovery) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*model.ClusterDiscovery) error); ok { r1 = rf(discovery) } else { @@ -75,6 +81,10 @@ func (_m *ClusterDiscoveryStore) GetAll(discoveryType string, clusterName string ret := _m.Called(discoveryType, clusterName) var r0 []*model.ClusterDiscovery + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.ClusterDiscovery, error)); ok { + return rf(discoveryType, clusterName) + } if rf, ok := ret.Get(0).(func(string, string) []*model.ClusterDiscovery); ok { r0 = rf(discoveryType, clusterName) } else { @@ -83,7 +93,6 @@ func (_m *ClusterDiscoveryStore) GetAll(discoveryType string, clusterName string } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(discoveryType, clusterName) } else { @@ -120,3 +129,18 @@ func (_m *ClusterDiscoveryStore) SetLastPingAt(discovery *model.ClusterDiscovery return r0 } + +type mockConstructorTestingTNewClusterDiscoveryStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewClusterDiscoveryStore creates a new instance of ClusterDiscoveryStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClusterDiscoveryStore(t mockConstructorTestingTNewClusterDiscoveryStore) *ClusterDiscoveryStore { + mock := &ClusterDiscoveryStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/CommandStore.go b/server/channels/store/storetest/mocks/CommandStore.go index 146f89deb8..9b5f365ab5 100644 --- a/server/channels/store/storetest/mocks/CommandStore.go +++ b/server/channels/store/storetest/mocks/CommandStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *CommandStore) AnalyticsCommandCount(teamID string) (int64, error) { ret := _m.Called(teamID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(teamID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -54,6 +57,10 @@ func (_m *CommandStore) Get(id string) (*model.Command, error) { ret := _m.Called(id) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Command, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.Command); ok { r0 = rf(id) } else { @@ -62,7 +69,6 @@ func (_m *CommandStore) Get(id string) (*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -77,6 +83,10 @@ func (_m *CommandStore) GetByTeam(teamID string) ([]*model.Command, error) { ret := _m.Called(teamID) var r0 []*model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.Command); ok { r0 = rf(teamID) } else { @@ -85,7 +95,6 @@ func (_m *CommandStore) GetByTeam(teamID string) ([]*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -100,6 +109,10 @@ func (_m *CommandStore) GetByTrigger(teamID string, trigger string) (*model.Comm ret := _m.Called(teamID, trigger) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Command, error)); ok { + return rf(teamID, trigger) + } if rf, ok := ret.Get(0).(func(string, string) *model.Command); ok { r0 = rf(teamID, trigger) } else { @@ -108,7 +121,6 @@ func (_m *CommandStore) GetByTrigger(teamID string, trigger string) (*model.Comm } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(teamID, trigger) } else { @@ -151,6 +163,10 @@ func (_m *CommandStore) Save(webhook *model.Command) (*model.Command, error) { ret := _m.Called(webhook) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(*model.Command) (*model.Command, error)); ok { + return rf(webhook) + } if rf, ok := ret.Get(0).(func(*model.Command) *model.Command); ok { r0 = rf(webhook) } else { @@ -159,7 +175,6 @@ func (_m *CommandStore) Save(webhook *model.Command) (*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Command) error); ok { r1 = rf(webhook) } else { @@ -174,6 +189,10 @@ func (_m *CommandStore) Update(hook *model.Command) (*model.Command, error) { ret := _m.Called(hook) var r0 *model.Command + var r1 error + if rf, ok := ret.Get(0).(func(*model.Command) (*model.Command, error)); ok { + return rf(hook) + } if rf, ok := ret.Get(0).(func(*model.Command) *model.Command); ok { r0 = rf(hook) } else { @@ -182,7 +201,6 @@ func (_m *CommandStore) Update(hook *model.Command) (*model.Command, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Command) error); ok { r1 = rf(hook) } else { @@ -191,3 +209,18 @@ func (_m *CommandStore) Update(hook *model.Command) (*model.Command, error) { return r0, r1 } + +type mockConstructorTestingTNewCommandStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewCommandStore creates a new instance of CommandStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCommandStore(t mockConstructorTestingTNewCommandStore) *CommandStore { + mock := &CommandStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/CommandWebhookStore.go b/server/channels/store/storetest/mocks/CommandWebhookStore.go index 69639cf440..09cae9b925 100644 --- a/server/channels/store/storetest/mocks/CommandWebhookStore.go +++ b/server/channels/store/storetest/mocks/CommandWebhookStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -24,6 +24,10 @@ func (_m *CommandWebhookStore) Get(id string) (*model.CommandWebhook, error) { ret := _m.Called(id) var r0 *model.CommandWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.CommandWebhook, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.CommandWebhook); ok { r0 = rf(id) } else { @@ -32,7 +36,6 @@ func (_m *CommandWebhookStore) Get(id string) (*model.CommandWebhook, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -47,6 +50,10 @@ func (_m *CommandWebhookStore) Save(webhook *model.CommandWebhook) (*model.Comma ret := _m.Called(webhook) var r0 *model.CommandWebhook + var r1 error + if rf, ok := ret.Get(0).(func(*model.CommandWebhook) (*model.CommandWebhook, error)); ok { + return rf(webhook) + } if rf, ok := ret.Get(0).(func(*model.CommandWebhook) *model.CommandWebhook); ok { r0 = rf(webhook) } else { @@ -55,7 +62,6 @@ func (_m *CommandWebhookStore) Save(webhook *model.CommandWebhook) (*model.Comma } } - var r1 error if rf, ok := ret.Get(1).(func(*model.CommandWebhook) error); ok { r1 = rf(webhook) } else { @@ -78,3 +84,18 @@ func (_m *CommandWebhookStore) TryUse(id string, limit int) error { return r0 } + +type mockConstructorTestingTNewCommandWebhookStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewCommandWebhookStore creates a new instance of CommandWebhookStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCommandWebhookStore(t mockConstructorTestingTNewCommandWebhookStore) *CommandWebhookStore { + mock := &CommandWebhookStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ComplianceStore.go b/server/channels/store/storetest/mocks/ComplianceStore.go index a1041e3bae..f2e91037e7 100644 --- a/server/channels/store/storetest/mocks/ComplianceStore.go +++ b/server/channels/store/storetest/mocks/ComplianceStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -21,6 +21,11 @@ func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance, cursor ret := _m.Called(compliance, cursor, limit) var r0 []*model.CompliancePost + var r1 model.ComplianceExportCursor + var r2 error + if rf, ok := ret.Get(0).(func(*model.Compliance, model.ComplianceExportCursor, int) ([]*model.CompliancePost, model.ComplianceExportCursor, error)); ok { + return rf(compliance, cursor, limit) + } if rf, ok := ret.Get(0).(func(*model.Compliance, model.ComplianceExportCursor, int) []*model.CompliancePost); ok { r0 = rf(compliance, cursor, limit) } else { @@ -29,14 +34,12 @@ func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance, cursor } } - var r1 model.ComplianceExportCursor if rf, ok := ret.Get(1).(func(*model.Compliance, model.ComplianceExportCursor, int) model.ComplianceExportCursor); ok { r1 = rf(compliance, cursor, limit) } else { r1 = ret.Get(1).(model.ComplianceExportCursor) } - var r2 error if rf, ok := ret.Get(2).(func(*model.Compliance, model.ComplianceExportCursor, int) error); ok { r2 = rf(compliance, cursor, limit) } else { @@ -51,6 +54,10 @@ func (_m *ComplianceStore) Get(id string) (*model.Compliance, error) { ret := _m.Called(id) var r0 *model.Compliance + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Compliance, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.Compliance); ok { r0 = rf(id) } else { @@ -59,7 +66,6 @@ func (_m *ComplianceStore) Get(id string) (*model.Compliance, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -74,6 +80,10 @@ func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, err ret := _m.Called(offset, limit) var r0 model.Compliances + var r1 error + if rf, ok := ret.Get(0).(func(int, int) (model.Compliances, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) model.Compliances); ok { r0 = rf(offset, limit) } else { @@ -82,7 +92,6 @@ func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, err } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -97,6 +106,11 @@ func (_m *ComplianceStore) MessageExport(ctx context.Context, cursor model.Messa ret := _m.Called(ctx, cursor, limit) var r0 []*model.MessageExport + var r1 model.MessageExportCursor + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, model.MessageExportCursor, int) ([]*model.MessageExport, model.MessageExportCursor, error)); ok { + return rf(ctx, cursor, limit) + } if rf, ok := ret.Get(0).(func(context.Context, model.MessageExportCursor, int) []*model.MessageExport); ok { r0 = rf(ctx, cursor, limit) } else { @@ -105,14 +119,12 @@ func (_m *ComplianceStore) MessageExport(ctx context.Context, cursor model.Messa } } - var r1 model.MessageExportCursor if rf, ok := ret.Get(1).(func(context.Context, model.MessageExportCursor, int) model.MessageExportCursor); ok { r1 = rf(ctx, cursor, limit) } else { r1 = ret.Get(1).(model.MessageExportCursor) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, model.MessageExportCursor, int) error); ok { r2 = rf(ctx, cursor, limit) } else { @@ -127,6 +139,10 @@ func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance ret := _m.Called(compliance) var r0 *model.Compliance + var r1 error + if rf, ok := ret.Get(0).(func(*model.Compliance) (*model.Compliance, error)); ok { + return rf(compliance) + } if rf, ok := ret.Get(0).(func(*model.Compliance) *model.Compliance); ok { r0 = rf(compliance) } else { @@ -135,7 +151,6 @@ func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok { r1 = rf(compliance) } else { @@ -150,6 +165,10 @@ func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Complian ret := _m.Called(compliance) var r0 *model.Compliance + var r1 error + if rf, ok := ret.Get(0).(func(*model.Compliance) (*model.Compliance, error)); ok { + return rf(compliance) + } if rf, ok := ret.Get(0).(func(*model.Compliance) *model.Compliance); ok { r0 = rf(compliance) } else { @@ -158,7 +177,6 @@ func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Complian } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok { r1 = rf(compliance) } else { @@ -167,3 +185,18 @@ func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Complian return r0, r1 } + +type mockConstructorTestingTNewComplianceStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewComplianceStore creates a new instance of ComplianceStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewComplianceStore(t mockConstructorTestingTNewComplianceStore) *ComplianceStore { + mock := &ComplianceStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/DraftStore.go b/server/channels/store/storetest/mocks/DraftStore.go index 924bb49883..d7236b44a0 100644 --- a/server/channels/store/storetest/mocks/DraftStore.go +++ b/server/channels/store/storetest/mocks/DraftStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,6 +33,10 @@ func (_m *DraftStore) Get(userID string, channelID string, rootID string, includ ret := _m.Called(userID, channelID, rootID, includeDeleted) var r0 *model.Draft + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, bool) (*model.Draft, error)); ok { + return rf(userID, channelID, rootID, includeDeleted) + } if rf, ok := ret.Get(0).(func(string, string, string, bool) *model.Draft); ok { r0 = rf(userID, channelID, rootID, includeDeleted) } else { @@ -41,7 +45,6 @@ func (_m *DraftStore) Get(userID string, channelID string, rootID string, includ } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok { r1 = rf(userID, channelID, rootID, includeDeleted) } else { @@ -56,6 +59,10 @@ func (_m *DraftStore) GetDraftsForUser(userID string, teamID string) ([]*model.D ret := _m.Called(userID, teamID) var r0 []*model.Draft + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.Draft, error)); ok { + return rf(userID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.Draft); ok { r0 = rf(userID, teamID) } else { @@ -64,7 +71,6 @@ func (_m *DraftStore) GetDraftsForUser(userID string, teamID string) ([]*model.D } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, teamID) } else { @@ -79,6 +85,10 @@ func (_m *DraftStore) Upsert(d *model.Draft) (*model.Draft, error) { ret := _m.Called(d) var r0 *model.Draft + var r1 error + if rf, ok := ret.Get(0).(func(*model.Draft) (*model.Draft, error)); ok { + return rf(d) + } if rf, ok := ret.Get(0).(func(*model.Draft) *model.Draft); ok { r0 = rf(d) } else { @@ -87,7 +97,6 @@ func (_m *DraftStore) Upsert(d *model.Draft) (*model.Draft, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Draft) error); ok { r1 = rf(d) } else { @@ -96,3 +105,18 @@ func (_m *DraftStore) Upsert(d *model.Draft) (*model.Draft, error) { return r0, r1 } + +type mockConstructorTestingTNewDraftStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewDraftStore creates a new instance of DraftStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewDraftStore(t mockConstructorTestingTNewDraftStore) *DraftStore { + mock := &DraftStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/EmojiStore.go b/server/channels/store/storetest/mocks/EmojiStore.go index 116ac6daa3..fc0fbf71e1 100644 --- a/server/channels/store/storetest/mocks/EmojiStore.go +++ b/server/channels/store/storetest/mocks/EmojiStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -35,6 +35,10 @@ func (_m *EmojiStore) Get(ctx context.Context, id string, allowFromCache bool) ( ret := _m.Called(ctx, id, allowFromCache) var r0 *model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool) (*model.Emoji, error)); ok { + return rf(ctx, id, allowFromCache) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool) *model.Emoji); ok { r0 = rf(ctx, id, allowFromCache) } else { @@ -43,7 +47,6 @@ func (_m *EmojiStore) Get(ctx context.Context, id string, allowFromCache bool) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { r1 = rf(ctx, id, allowFromCache) } else { @@ -58,6 +61,10 @@ func (_m *EmojiStore) GetByName(ctx context.Context, name string, allowFromCache ret := _m.Called(ctx, name, allowFromCache) var r0 *model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool) (*model.Emoji, error)); ok { + return rf(ctx, name, allowFromCache) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool) *model.Emoji); ok { r0 = rf(ctx, name, allowFromCache) } else { @@ -66,7 +73,6 @@ func (_m *EmojiStore) GetByName(ctx context.Context, name string, allowFromCache } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { r1 = rf(ctx, name, allowFromCache) } else { @@ -81,6 +87,10 @@ func (_m *EmojiStore) GetList(offset int, limit int, sort string) ([]*model.Emoj ret := _m.Called(offset, limit, sort) var r0 []*model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func(int, int, string) ([]*model.Emoji, error)); ok { + return rf(offset, limit, sort) + } if rf, ok := ret.Get(0).(func(int, int, string) []*model.Emoji); ok { r0 = rf(offset, limit, sort) } else { @@ -89,7 +99,6 @@ func (_m *EmojiStore) GetList(offset int, limit int, sort string) ([]*model.Emoj } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, string) error); ok { r1 = rf(offset, limit, sort) } else { @@ -104,6 +113,10 @@ func (_m *EmojiStore) GetMultipleByName(names []string) ([]*model.Emoji, error) ret := _m.Called(names) var r0 []*model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Emoji, error)); ok { + return rf(names) + } if rf, ok := ret.Get(0).(func([]string) []*model.Emoji); ok { r0 = rf(names) } else { @@ -112,7 +125,6 @@ func (_m *EmojiStore) GetMultipleByName(names []string) ([]*model.Emoji, error) } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(names) } else { @@ -127,6 +139,10 @@ func (_m *EmojiStore) Save(emoji *model.Emoji) (*model.Emoji, error) { ret := _m.Called(emoji) var r0 *model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func(*model.Emoji) (*model.Emoji, error)); ok { + return rf(emoji) + } if rf, ok := ret.Get(0).(func(*model.Emoji) *model.Emoji); ok { r0 = rf(emoji) } else { @@ -135,7 +151,6 @@ func (_m *EmojiStore) Save(emoji *model.Emoji) (*model.Emoji, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Emoji) error); ok { r1 = rf(emoji) } else { @@ -150,6 +165,10 @@ func (_m *EmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model. ret := _m.Called(name, prefixOnly, limit) var r0 []*model.Emoji + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, int) ([]*model.Emoji, error)); ok { + return rf(name, prefixOnly, limit) + } if rf, ok := ret.Get(0).(func(string, bool, int) []*model.Emoji); ok { r0 = rf(name, prefixOnly, limit) } else { @@ -158,7 +177,6 @@ func (_m *EmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model. } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, int) error); ok { r1 = rf(name, prefixOnly, limit) } else { @@ -167,3 +185,18 @@ func (_m *EmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model. return r0, r1 } + +type mockConstructorTestingTNewEmojiStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewEmojiStore creates a new instance of EmojiStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEmojiStore(t mockConstructorTestingTNewEmojiStore) *EmojiStore { + mock := &EmojiStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/FileInfoStore.go b/server/channels/store/storetest/mocks/FileInfoStore.go index 5ea9700707..f9529ca258 100644 --- a/server/channels/store/storetest/mocks/FileInfoStore.go +++ b/server/channels/store/storetest/mocks/FileInfoStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -38,13 +38,16 @@ func (_m *FileInfoStore) CountAll() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -59,13 +62,16 @@ func (_m *FileInfoStore) DeleteForPost(postID string) (string, error) { ret := _m.Called(postID) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(postID) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(postID) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postID) } else { @@ -80,6 +86,10 @@ func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) { ret := _m.Called(id) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.FileInfo, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok { r0 = rf(id) } else { @@ -88,7 +98,6 @@ func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -103,6 +112,10 @@ func (_m *FileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) { ret := _m.Called(ids) var r0 []*model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.FileInfo, error)); ok { + return rf(ids) + } if rf, ok := ret.Get(0).(func([]string) []*model.FileInfo); ok { r0 = rf(ids) } else { @@ -111,7 +124,6 @@ func (_m *FileInfoStore) GetByIds(ids []string) ([]*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(ids) } else { @@ -126,6 +138,10 @@ func (_m *FileInfoStore) GetByPath(path string) (*model.FileInfo, error) { ret := _m.Called(path) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.FileInfo, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok { r0 = rf(path) } else { @@ -134,7 +150,6 @@ func (_m *FileInfoStore) GetByPath(path string) (*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -149,6 +164,10 @@ func (_m *FileInfoStore) GetFilesBatchForIndexing(startTime int64, startFileID s ret := _m.Called(startTime, startFileID, limit) var r0 []*model.FileForIndexing + var r1 error + if rf, ok := ret.Get(0).(func(int64, string, int) ([]*model.FileForIndexing, error)); ok { + return rf(startTime, startFileID, limit) + } if rf, ok := ret.Get(0).(func(int64, string, int) []*model.FileForIndexing); ok { r0 = rf(startTime, startFileID, limit) } else { @@ -157,7 +176,6 @@ func (_m *FileInfoStore) GetFilesBatchForIndexing(startTime int64, startFileID s } } - var r1 error if rf, ok := ret.Get(1).(func(int64, string, int) error); ok { r1 = rf(startTime, startFileID, limit) } else { @@ -172,6 +190,10 @@ func (_m *FileInfoStore) GetForPost(postID string, readFromMaster bool, includeD ret := _m.Called(postID, readFromMaster, includeDeleted, allowFromCache) var r0 []*model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, bool, bool) ([]*model.FileInfo, error)); ok { + return rf(postID, readFromMaster, includeDeleted, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool, bool, bool) []*model.FileInfo); ok { r0 = rf(postID, readFromMaster, includeDeleted, allowFromCache) } else { @@ -180,7 +202,6 @@ func (_m *FileInfoStore) GetForPost(postID string, readFromMaster bool, includeD } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, bool, bool) error); ok { r1 = rf(postID, readFromMaster, includeDeleted, allowFromCache) } else { @@ -195,6 +216,10 @@ func (_m *FileInfoStore) GetForUser(userID string) ([]*model.FileInfo, error) { ret := _m.Called(userID) var r0 []*model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.FileInfo, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.FileInfo); ok { r0 = rf(userID) } else { @@ -203,7 +228,6 @@ func (_m *FileInfoStore) GetForUser(userID string) ([]*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -218,6 +242,10 @@ func (_m *FileInfoStore) GetFromMaster(id string) (*model.FileInfo, error) { ret := _m.Called(id) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.FileInfo, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok { r0 = rf(id) } else { @@ -226,7 +254,6 @@ func (_m *FileInfoStore) GetFromMaster(id string) (*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -241,13 +268,16 @@ func (_m *FileInfoStore) GetStorageUsage(allowFromCache bool, includeDeleted boo ret := _m.Called(allowFromCache, includeDeleted) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(bool, bool) (int64, error)); ok { + return rf(allowFromCache, includeDeleted) + } if rf, ok := ret.Get(0).(func(bool, bool) int64); ok { r0 = rf(allowFromCache, includeDeleted) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(bool, bool) error); ok { r1 = rf(allowFromCache, includeDeleted) } else { @@ -262,13 +292,16 @@ func (_m *FileInfoStore) GetUptoNSizeFileTime(n int64) (int64, error) { ret := _m.Called(n) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64) (int64, error)); ok { + return rf(n) + } if rf, ok := ret.Get(0).(func(int64) int64); ok { r0 = rf(n) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(n) } else { @@ -283,6 +316,10 @@ func (_m *FileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFil ret := _m.Called(page, perPage, opt) var r0 []*model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) ([]*model.FileInfo, error)); ok { + return rf(page, perPage, opt) + } if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) []*model.FileInfo); ok { r0 = rf(page, perPage, opt) } else { @@ -291,7 +328,6 @@ func (_m *FileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFil } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, *model.GetFileInfosOptions) error); ok { r1 = rf(page, perPage, opt) } else { @@ -325,13 +361,16 @@ func (_m *FileInfoStore) PermanentDeleteBatch(endTime int64, limit int64) (int64 ret := _m.Called(endTime, limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok { + return rf(endTime, limit) + } if rf, ok := ret.Get(0).(func(int64, int64) int64); ok { r0 = rf(endTime, limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64) error); ok { r1 = rf(endTime, limit) } else { @@ -346,13 +385,16 @@ func (_m *FileInfoStore) PermanentDeleteByUser(userID string) (int64, error) { ret := _m.Called(userID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(userID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -367,6 +409,10 @@ func (_m *FileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, error) { ret := _m.Called(info) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(*model.FileInfo) (*model.FileInfo, error)); ok { + return rf(info) + } if rf, ok := ret.Get(0).(func(*model.FileInfo) *model.FileInfo); ok { r0 = rf(info) } else { @@ -375,7 +421,6 @@ func (_m *FileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.FileInfo) error); ok { r1 = rf(info) } else { @@ -390,6 +435,10 @@ func (_m *FileInfoStore) Search(paramsList []*model.SearchParams, userID string, ret := _m.Called(paramsList, userID, teamID, page, perPage) var r0 *model.FileInfoList + var r1 error + if rf, ok := ret.Get(0).(func([]*model.SearchParams, string, string, int, int) (*model.FileInfoList, error)); ok { + return rf(paramsList, userID, teamID, page, perPage) + } if rf, ok := ret.Get(0).(func([]*model.SearchParams, string, string, int, int) *model.FileInfoList); ok { r0 = rf(paramsList, userID, teamID, page, perPage) } else { @@ -398,7 +447,6 @@ func (_m *FileInfoStore) Search(paramsList []*model.SearchParams, userID string, } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.SearchParams, string, string, int, int) error); ok { r1 = rf(paramsList, userID, teamID, page, perPage) } else { @@ -427,6 +475,10 @@ func (_m *FileInfoStore) Upsert(info *model.FileInfo) (*model.FileInfo, error) { ret := _m.Called(info) var r0 *model.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(*model.FileInfo) (*model.FileInfo, error)); ok { + return rf(info) + } if rf, ok := ret.Get(0).(func(*model.FileInfo) *model.FileInfo); ok { r0 = rf(info) } else { @@ -435,7 +487,6 @@ func (_m *FileInfoStore) Upsert(info *model.FileInfo) (*model.FileInfo, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.FileInfo) error); ok { r1 = rf(info) } else { @@ -444,3 +495,18 @@ func (_m *FileInfoStore) Upsert(info *model.FileInfo) (*model.FileInfo, error) { return r0, r1 } + +type mockConstructorTestingTNewFileInfoStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewFileInfoStore creates a new instance of FileInfoStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewFileInfoStore(t mockConstructorTestingTNewFileInfoStore) *FileInfoStore { + mock := &FileInfoStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/GroupStore.go b/server/channels/store/storetest/mocks/GroupStore.go index e77e2a8628..65bfbf2703 100644 --- a/server/channels/store/storetest/mocks/GroupStore.go +++ b/server/channels/store/storetest/mocks/GroupStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *GroupStore) AdminRoleGroupsForSyncableMember(userID string, syncableID ret := _m.Called(userID, syncableID, syncableType) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) ([]string, error)); ok { + return rf(userID, syncableID, syncableType) + } if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) []string); ok { r0 = rf(userID, syncableID, syncableType) } else { @@ -27,7 +31,6 @@ func (_m *GroupStore) AdminRoleGroupsForSyncableMember(userID string, syncableID } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GroupSyncableType) error); ok { r1 = rf(userID, syncableID, syncableType) } else { @@ -42,6 +45,10 @@ func (_m *GroupStore) ChannelMembersMinusGroupMembers(channelID string, groupIDs ret := _m.Called(channelID, groupIDs, page, perPage) var r0 []*model.UserWithGroups + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, int, int) ([]*model.UserWithGroups, error)); ok { + return rf(channelID, groupIDs, page, perPage) + } if rf, ok := ret.Get(0).(func(string, []string, int, int) []*model.UserWithGroups); ok { r0 = rf(channelID, groupIDs, page, perPage) } else { @@ -50,7 +57,6 @@ func (_m *GroupStore) ChannelMembersMinusGroupMembers(channelID string, groupIDs } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, int, int) error); ok { r1 = rf(channelID, groupIDs, page, perPage) } else { @@ -65,6 +71,10 @@ func (_m *GroupStore) ChannelMembersToAdd(since int64, channelID *string, includ ret := _m.Called(since, channelID, includeRemovedMembers) var r0 []*model.UserChannelIDPair + var r1 error + if rf, ok := ret.Get(0).(func(int64, *string, bool) ([]*model.UserChannelIDPair, error)); ok { + return rf(since, channelID, includeRemovedMembers) + } if rf, ok := ret.Get(0).(func(int64, *string, bool) []*model.UserChannelIDPair); ok { r0 = rf(since, channelID, includeRemovedMembers) } else { @@ -73,7 +83,6 @@ func (_m *GroupStore) ChannelMembersToAdd(since int64, channelID *string, includ } } - var r1 error if rf, ok := ret.Get(1).(func(int64, *string, bool) error); ok { r1 = rf(since, channelID, includeRemovedMembers) } else { @@ -88,6 +97,10 @@ func (_m *GroupStore) ChannelMembersToRemove(channelID *string) ([]*model.Channe ret := _m.Called(channelID) var r0 []*model.ChannelMember + var r1 error + if rf, ok := ret.Get(0).(func(*string) ([]*model.ChannelMember, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(*string) []*model.ChannelMember); ok { r0 = rf(channelID) } else { @@ -96,7 +109,6 @@ func (_m *GroupStore) ChannelMembersToRemove(channelID *string) ([]*model.Channe } } - var r1 error if rf, ok := ret.Get(1).(func(*string) error); ok { r1 = rf(channelID) } else { @@ -111,13 +123,16 @@ func (_m *GroupStore) CountChannelMembersMinusGroupMembers(channelID string, gro ret := _m.Called(channelID, groupIDs) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (int64, error)); ok { + return rf(channelID, groupIDs) + } if rf, ok := ret.Get(0).(func(string, []string) int64); ok { r0 = rf(channelID, groupIDs) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(channelID, groupIDs) } else { @@ -132,13 +147,16 @@ func (_m *GroupStore) CountGroupsByChannel(channelID string, opts model.GroupSea ret := _m.Called(channelID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) (int64, error)); ok { + return rf(channelID, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) int64); ok { r0 = rf(channelID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(channelID, opts) } else { @@ -153,13 +171,16 @@ func (_m *GroupStore) CountGroupsByTeam(teamID string, opts model.GroupSearchOpt ret := _m.Called(teamID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) (int64, error)); ok { + return rf(teamID, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) int64); ok { r0 = rf(teamID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(teamID, opts) } else { @@ -174,13 +195,16 @@ func (_m *GroupStore) CountTeamMembersMinusGroupMembers(teamID string, groupIDs ret := _m.Called(teamID, groupIDs) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (int64, error)); ok { + return rf(teamID, groupIDs) + } if rf, ok := ret.Get(0).(func(string, []string) int64); ok { r0 = rf(teamID, groupIDs) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(teamID, groupIDs) } else { @@ -195,6 +219,10 @@ func (_m *GroupStore) Create(group *model.Group) (*model.Group, error) { ret := _m.Called(group) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(*model.Group) (*model.Group, error)); ok { + return rf(group) + } if rf, ok := ret.Get(0).(func(*model.Group) *model.Group); ok { r0 = rf(group) } else { @@ -203,7 +231,6 @@ func (_m *GroupStore) Create(group *model.Group) (*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Group) error); ok { r1 = rf(group) } else { @@ -218,6 +245,10 @@ func (_m *GroupStore) CreateGroupSyncable(groupSyncable *model.GroupSyncable) (* ret := _m.Called(groupSyncable) var r0 *model.GroupSyncable + var r1 error + if rf, ok := ret.Get(0).(func(*model.GroupSyncable) (*model.GroupSyncable, error)); ok { + return rf(groupSyncable) + } if rf, ok := ret.Get(0).(func(*model.GroupSyncable) *model.GroupSyncable); ok { r0 = rf(groupSyncable) } else { @@ -226,7 +257,6 @@ func (_m *GroupStore) CreateGroupSyncable(groupSyncable *model.GroupSyncable) (* } } - var r1 error if rf, ok := ret.Get(1).(func(*model.GroupSyncable) error); ok { r1 = rf(groupSyncable) } else { @@ -241,6 +271,10 @@ func (_m *GroupStore) CreateWithUserIds(group *model.GroupWithUserIds) (*model.G ret := _m.Called(group) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(*model.GroupWithUserIds) (*model.Group, error)); ok { + return rf(group) + } if rf, ok := ret.Get(0).(func(*model.GroupWithUserIds) *model.Group); ok { r0 = rf(group) } else { @@ -249,7 +283,6 @@ func (_m *GroupStore) CreateWithUserIds(group *model.GroupWithUserIds) (*model.G } } - var r1 error if rf, ok := ret.Get(1).(func(*model.GroupWithUserIds) error); ok { r1 = rf(group) } else { @@ -264,6 +297,10 @@ func (_m *GroupStore) Delete(groupID string) (*model.Group, error) { ret := _m.Called(groupID) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Group, error)); ok { + return rf(groupID) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(groupID) } else { @@ -272,7 +309,6 @@ func (_m *GroupStore) Delete(groupID string) (*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(groupID) } else { @@ -287,6 +323,10 @@ func (_m *GroupStore) DeleteGroupSyncable(groupID string, syncableID string, syn ret := _m.Called(groupID, syncableID, syncableType) var r0 *model.GroupSyncable + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) (*model.GroupSyncable, error)); ok { + return rf(groupID, syncableID, syncableType) + } if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) *model.GroupSyncable); ok { r0 = rf(groupID, syncableID, syncableType) } else { @@ -295,7 +335,6 @@ func (_m *GroupStore) DeleteGroupSyncable(groupID string, syncableID string, syn } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GroupSyncableType) error); ok { r1 = rf(groupID, syncableID, syncableType) } else { @@ -310,6 +349,10 @@ func (_m *GroupStore) DeleteMember(groupID string, userID string) (*model.GroupM ret := _m.Called(groupID, userID) var r0 *model.GroupMember + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.GroupMember, error)); ok { + return rf(groupID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.GroupMember); ok { r0 = rf(groupID, userID) } else { @@ -318,7 +361,6 @@ func (_m *GroupStore) DeleteMember(groupID string, userID string) (*model.GroupM } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(groupID, userID) } else { @@ -333,6 +375,10 @@ func (_m *GroupStore) DeleteMembers(groupID string, userIDs []string) ([]*model. ret := _m.Called(groupID, userIDs) var r0 []*model.GroupMember + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) ([]*model.GroupMember, error)); ok { + return rf(groupID, userIDs) + } if rf, ok := ret.Get(0).(func(string, []string) []*model.GroupMember); ok { r0 = rf(groupID, userIDs) } else { @@ -341,7 +387,6 @@ func (_m *GroupStore) DeleteMembers(groupID string, userIDs []string) ([]*model. } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(groupID, userIDs) } else { @@ -356,13 +401,16 @@ func (_m *GroupStore) DistinctGroupMemberCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -377,13 +425,16 @@ func (_m *GroupStore) DistinctGroupMemberCountForSource(source model.GroupSource ret := _m.Called(source) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(model.GroupSource) (int64, error)); ok { + return rf(source) + } if rf, ok := ret.Get(0).(func(model.GroupSource) int64); ok { r0 = rf(source) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(model.GroupSource) error); ok { r1 = rf(source) } else { @@ -398,6 +449,10 @@ func (_m *GroupStore) Get(groupID string) (*model.Group, error) { ret := _m.Called(groupID) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Group, error)); ok { + return rf(groupID) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(groupID) } else { @@ -406,7 +461,6 @@ func (_m *GroupStore) Get(groupID string) (*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(groupID) } else { @@ -421,6 +475,10 @@ func (_m *GroupStore) GetAllBySource(groupSource model.GroupSource) ([]*model.Gr ret := _m.Called(groupSource) var r0 []*model.Group + var r1 error + if rf, ok := ret.Get(0).(func(model.GroupSource) ([]*model.Group, error)); ok { + return rf(groupSource) + } if rf, ok := ret.Get(0).(func(model.GroupSource) []*model.Group); ok { r0 = rf(groupSource) } else { @@ -429,7 +487,6 @@ func (_m *GroupStore) GetAllBySource(groupSource model.GroupSource) ([]*model.Gr } } - var r1 error if rf, ok := ret.Get(1).(func(model.GroupSource) error); ok { r1 = rf(groupSource) } else { @@ -444,6 +501,10 @@ func (_m *GroupStore) GetAllGroupSyncablesByGroupId(groupID string, syncableType ret := _m.Called(groupID, syncableType) var r0 []*model.GroupSyncable + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) ([]*model.GroupSyncable, error)); ok { + return rf(groupID, syncableType) + } if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) []*model.GroupSyncable); ok { r0 = rf(groupID, syncableType) } else { @@ -452,7 +513,6 @@ func (_m *GroupStore) GetAllGroupSyncablesByGroupId(groupID string, syncableType } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSyncableType) error); ok { r1 = rf(groupID, syncableType) } else { @@ -467,6 +527,10 @@ func (_m *GroupStore) GetByIDs(groupIDs []string) ([]*model.Group, error) { ret := _m.Called(groupIDs) var r0 []*model.Group + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Group, error)); ok { + return rf(groupIDs) + } if rf, ok := ret.Get(0).(func([]string) []*model.Group); ok { r0 = rf(groupIDs) } else { @@ -475,7 +539,6 @@ func (_m *GroupStore) GetByIDs(groupIDs []string) ([]*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(groupIDs) } else { @@ -490,6 +553,10 @@ func (_m *GroupStore) GetByName(name string, opts model.GroupSearchOpts) (*model ret := _m.Called(name, opts) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) (*model.Group, error)); ok { + return rf(name, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) *model.Group); ok { r0 = rf(name, opts) } else { @@ -498,7 +565,6 @@ func (_m *GroupStore) GetByName(name string, opts model.GroupSearchOpts) (*model } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(name, opts) } else { @@ -513,6 +579,10 @@ func (_m *GroupStore) GetByRemoteID(remoteID string, groupSource model.GroupSour ret := _m.Called(remoteID, groupSource) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSource) (*model.Group, error)); ok { + return rf(remoteID, groupSource) + } if rf, ok := ret.Get(0).(func(string, model.GroupSource) *model.Group); ok { r0 = rf(remoteID, groupSource) } else { @@ -521,7 +591,6 @@ func (_m *GroupStore) GetByRemoteID(remoteID string, groupSource model.GroupSour } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSource) error); ok { r1 = rf(remoteID, groupSource) } else { @@ -536,6 +605,10 @@ func (_m *GroupStore) GetByUser(userID string) ([]*model.Group, error) { ret := _m.Called(userID) var r0 []*model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Group, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Group); ok { r0 = rf(userID) } else { @@ -544,7 +617,6 @@ func (_m *GroupStore) GetByUser(userID string) ([]*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -559,6 +631,10 @@ func (_m *GroupStore) GetGroupSyncable(groupID string, syncableID string, syncab ret := _m.Called(groupID, syncableID, syncableType) var r0 *model.GroupSyncable + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) (*model.GroupSyncable, error)); ok { + return rf(groupID, syncableID, syncableType) + } if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) *model.GroupSyncable); ok { r0 = rf(groupID, syncableID, syncableType) } else { @@ -567,7 +643,6 @@ func (_m *GroupStore) GetGroupSyncable(groupID string, syncableID string, syncab } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GroupSyncableType) error); ok { r1 = rf(groupID, syncableID, syncableType) } else { @@ -582,6 +657,10 @@ func (_m *GroupStore) GetGroups(page int, perPage int, opts model.GroupSearchOpt ret := _m.Called(page, perPage, opts, viewRestrictions) var r0 []*model.Group + var r1 error + if rf, ok := ret.Get(0).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) ([]*model.Group, error)); ok { + return rf(page, perPage, opts, viewRestrictions) + } if rf, ok := ret.Get(0).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) []*model.Group); ok { r0 = rf(page, perPage, opts, viewRestrictions) } else { @@ -590,7 +669,6 @@ func (_m *GroupStore) GetGroups(page int, perPage int, opts model.GroupSearchOpt } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) error); ok { r1 = rf(page, perPage, opts, viewRestrictions) } else { @@ -605,6 +683,10 @@ func (_m *GroupStore) GetGroupsAssociatedToChannelsByTeam(teamID string, opts mo ret := _m.Called(teamID, opts) var r0 map[string][]*model.GroupWithSchemeAdmin + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, error)); ok { + return rf(teamID, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) map[string][]*model.GroupWithSchemeAdmin); ok { r0 = rf(teamID, opts) } else { @@ -613,7 +695,6 @@ func (_m *GroupStore) GetGroupsAssociatedToChannelsByTeam(teamID string, opts mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(teamID, opts) } else { @@ -628,6 +709,10 @@ func (_m *GroupStore) GetGroupsByChannel(channelID string, opts model.GroupSearc ret := _m.Called(channelID, opts) var r0 []*model.GroupWithSchemeAdmin + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, error)); ok { + return rf(channelID, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) []*model.GroupWithSchemeAdmin); ok { r0 = rf(channelID, opts) } else { @@ -636,7 +721,6 @@ func (_m *GroupStore) GetGroupsByChannel(channelID string, opts model.GroupSearc } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(channelID, opts) } else { @@ -651,6 +735,10 @@ func (_m *GroupStore) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ret := _m.Called(teamID, opts) var r0 []*model.GroupWithSchemeAdmin + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, error)); ok { + return rf(teamID, opts) + } if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) []*model.GroupWithSchemeAdmin); ok { r0 = rf(teamID, opts) } else { @@ -659,7 +747,6 @@ func (_m *GroupStore) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) error); ok { r1 = rf(teamID, opts) } else { @@ -674,6 +761,10 @@ func (_m *GroupStore) GetMember(groupID string, userID string) (*model.GroupMemb ret := _m.Called(groupID, userID) var r0 *model.GroupMember + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.GroupMember, error)); ok { + return rf(groupID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.GroupMember); ok { r0 = rf(groupID, userID) } else { @@ -682,7 +773,6 @@ func (_m *GroupStore) GetMember(groupID string, userID string) (*model.GroupMemb } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(groupID, userID) } else { @@ -697,13 +787,16 @@ func (_m *GroupStore) GetMemberCount(groupID string) (int64, error) { ret := _m.Called(groupID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(groupID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(groupID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(groupID) } else { @@ -718,13 +811,16 @@ func (_m *GroupStore) GetMemberCountWithRestrictions(groupID string, viewRestric ret := _m.Called(groupID, viewRestrictions) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) (int64, error)); ok { + return rf(groupID, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) int64); ok { r0 = rf(groupID, viewRestrictions) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.ViewUsersRestrictions) error); ok { r1 = rf(groupID, viewRestrictions) } else { @@ -739,6 +835,10 @@ func (_m *GroupStore) GetMemberUsers(groupID string) ([]*model.User, error) { ret := _m.Called(groupID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.User, error)); ok { + return rf(groupID) + } if rf, ok := ret.Get(0).(func(string) []*model.User); ok { r0 = rf(groupID) } else { @@ -747,7 +847,6 @@ func (_m *GroupStore) GetMemberUsers(groupID string) ([]*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(groupID) } else { @@ -762,6 +861,10 @@ func (_m *GroupStore) GetMemberUsersInTeam(groupID string, teamID string) ([]*mo ret := _m.Called(groupID, teamID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.User, error)); ok { + return rf(groupID, teamID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.User); ok { r0 = rf(groupID, teamID) } else { @@ -770,7 +873,6 @@ func (_m *GroupStore) GetMemberUsersInTeam(groupID string, teamID string) ([]*mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(groupID, teamID) } else { @@ -785,6 +887,10 @@ func (_m *GroupStore) GetMemberUsersNotInChannel(groupID string, channelID strin ret := _m.Called(groupID, channelID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.User, error)); ok { + return rf(groupID, channelID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.User); ok { r0 = rf(groupID, channelID) } else { @@ -793,7 +899,6 @@ func (_m *GroupStore) GetMemberUsersNotInChannel(groupID string, channelID strin } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(groupID, channelID) } else { @@ -808,6 +913,10 @@ func (_m *GroupStore) GetMemberUsersPage(groupID string, page int, perPage int, ret := _m.Called(groupID, page, perPage, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(groupID, page, perPage, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(groupID, page, perPage, viewRestrictions) } else { @@ -816,7 +925,6 @@ func (_m *GroupStore) GetMemberUsersPage(groupID string, page int, perPage int, } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(groupID, page, perPage, viewRestrictions) } else { @@ -831,6 +939,10 @@ func (_m *GroupStore) GetMemberUsersSortedPage(groupID string, page int, perPage ret := _m.Called(groupID, page, perPage, viewRestrictions, teammateNameDisplay) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions, string) ([]*model.User, error)); ok { + return rf(groupID, page, perPage, viewRestrictions, teammateNameDisplay) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions, string) []*model.User); ok { r0 = rf(groupID, page, perPage, viewRestrictions, teammateNameDisplay) } else { @@ -839,7 +951,6 @@ func (_m *GroupStore) GetMemberUsersSortedPage(groupID string, page int, perPage } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.ViewUsersRestrictions, string) error); ok { r1 = rf(groupID, page, perPage, viewRestrictions, teammateNameDisplay) } else { @@ -854,6 +965,10 @@ func (_m *GroupStore) GetNonMemberUsersPage(groupID string, page int, perPage in ret := _m.Called(groupID, page, perPage, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(groupID, page, perPage, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(groupID, page, perPage, viewRestrictions) } else { @@ -862,7 +977,6 @@ func (_m *GroupStore) GetNonMemberUsersPage(groupID string, page int, perPage in } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(groupID, page, perPage, viewRestrictions) } else { @@ -877,13 +991,16 @@ func (_m *GroupStore) GroupChannelCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -898,13 +1015,16 @@ func (_m *GroupStore) GroupCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -919,13 +1039,16 @@ func (_m *GroupStore) GroupCountBySource(source model.GroupSource) (int64, error ret := _m.Called(source) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(model.GroupSource) (int64, error)); ok { + return rf(source) + } if rf, ok := ret.Get(0).(func(model.GroupSource) int64); ok { r0 = rf(source) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(model.GroupSource) error); ok { r1 = rf(source) } else { @@ -940,13 +1063,16 @@ func (_m *GroupStore) GroupCountWithAllowReference() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -961,13 +1087,16 @@ func (_m *GroupStore) GroupMemberCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -982,13 +1111,16 @@ func (_m *GroupStore) GroupTeamCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -1017,6 +1149,10 @@ func (_m *GroupStore) PermittedSyncableAdmins(syncableID string, syncableType mo ret := _m.Called(syncableID, syncableType) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) ([]string, error)); ok { + return rf(syncableID, syncableType) + } if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) []string); ok { r0 = rf(syncableID, syncableType) } else { @@ -1025,7 +1161,6 @@ func (_m *GroupStore) PermittedSyncableAdmins(syncableID string, syncableType mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.GroupSyncableType) error); ok { r1 = rf(syncableID, syncableType) } else { @@ -1040,6 +1175,10 @@ func (_m *GroupStore) Restore(groupID string) (*model.Group, error) { ret := _m.Called(groupID) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Group, error)); ok { + return rf(groupID) + } if rf, ok := ret.Get(0).(func(string) *model.Group); ok { r0 = rf(groupID) } else { @@ -1048,7 +1187,6 @@ func (_m *GroupStore) Restore(groupID string) (*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(groupID) } else { @@ -1063,6 +1201,10 @@ func (_m *GroupStore) TeamMembersMinusGroupMembers(teamID string, groupIDs []str ret := _m.Called(teamID, groupIDs, page, perPage) var r0 []*model.UserWithGroups + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, int, int) ([]*model.UserWithGroups, error)); ok { + return rf(teamID, groupIDs, page, perPage) + } if rf, ok := ret.Get(0).(func(string, []string, int, int) []*model.UserWithGroups); ok { r0 = rf(teamID, groupIDs, page, perPage) } else { @@ -1071,7 +1213,6 @@ func (_m *GroupStore) TeamMembersMinusGroupMembers(teamID string, groupIDs []str } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, int, int) error); ok { r1 = rf(teamID, groupIDs, page, perPage) } else { @@ -1086,6 +1227,10 @@ func (_m *GroupStore) TeamMembersToAdd(since int64, teamID *string, includeRemov ret := _m.Called(since, teamID, includeRemovedMembers) var r0 []*model.UserTeamIDPair + var r1 error + if rf, ok := ret.Get(0).(func(int64, *string, bool) ([]*model.UserTeamIDPair, error)); ok { + return rf(since, teamID, includeRemovedMembers) + } if rf, ok := ret.Get(0).(func(int64, *string, bool) []*model.UserTeamIDPair); ok { r0 = rf(since, teamID, includeRemovedMembers) } else { @@ -1094,7 +1239,6 @@ func (_m *GroupStore) TeamMembersToAdd(since int64, teamID *string, includeRemov } } - var r1 error if rf, ok := ret.Get(1).(func(int64, *string, bool) error); ok { r1 = rf(since, teamID, includeRemovedMembers) } else { @@ -1109,6 +1253,10 @@ func (_m *GroupStore) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, ret := _m.Called(teamID) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(*string) ([]*model.TeamMember, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(*string) []*model.TeamMember); ok { r0 = rf(teamID) } else { @@ -1117,7 +1265,6 @@ func (_m *GroupStore) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, } } - var r1 error if rf, ok := ret.Get(1).(func(*string) error); ok { r1 = rf(teamID) } else { @@ -1132,6 +1279,10 @@ func (_m *GroupStore) Update(group *model.Group) (*model.Group, error) { ret := _m.Called(group) var r0 *model.Group + var r1 error + if rf, ok := ret.Get(0).(func(*model.Group) (*model.Group, error)); ok { + return rf(group) + } if rf, ok := ret.Get(0).(func(*model.Group) *model.Group); ok { r0 = rf(group) } else { @@ -1140,7 +1291,6 @@ func (_m *GroupStore) Update(group *model.Group) (*model.Group, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Group) error); ok { r1 = rf(group) } else { @@ -1155,6 +1305,10 @@ func (_m *GroupStore) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (* ret := _m.Called(groupSyncable) var r0 *model.GroupSyncable + var r1 error + if rf, ok := ret.Get(0).(func(*model.GroupSyncable) (*model.GroupSyncable, error)); ok { + return rf(groupSyncable) + } if rf, ok := ret.Get(0).(func(*model.GroupSyncable) *model.GroupSyncable); ok { r0 = rf(groupSyncable) } else { @@ -1163,7 +1317,6 @@ func (_m *GroupStore) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (* } } - var r1 error if rf, ok := ret.Get(1).(func(*model.GroupSyncable) error); ok { r1 = rf(groupSyncable) } else { @@ -1178,6 +1331,10 @@ func (_m *GroupStore) UpsertMember(groupID string, userID string) (*model.GroupM ret := _m.Called(groupID, userID) var r0 *model.GroupMember + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.GroupMember, error)); ok { + return rf(groupID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.GroupMember); ok { r0 = rf(groupID, userID) } else { @@ -1186,7 +1343,6 @@ func (_m *GroupStore) UpsertMember(groupID string, userID string) (*model.GroupM } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(groupID, userID) } else { @@ -1201,6 +1357,10 @@ func (_m *GroupStore) UpsertMembers(groupID string, userIDs []string) ([]*model. ret := _m.Called(groupID, userIDs) var r0 []*model.GroupMember + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) ([]*model.GroupMember, error)); ok { + return rf(groupID, userIDs) + } if rf, ok := ret.Get(0).(func(string, []string) []*model.GroupMember); ok { r0 = rf(groupID, userIDs) } else { @@ -1209,7 +1369,6 @@ func (_m *GroupStore) UpsertMembers(groupID string, userIDs []string) ([]*model. } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(groupID, userIDs) } else { @@ -1218,3 +1377,18 @@ func (_m *GroupStore) UpsertMembers(groupID string, userIDs []string) ([]*model. return r0, r1 } + +type mockConstructorTestingTNewGroupStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewGroupStore creates a new instance of GroupStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewGroupStore(t mockConstructorTestingTNewGroupStore) *GroupStore { + mock := &GroupStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/JobStore.go b/server/channels/store/storetest/mocks/JobStore.go index 74b52bf070..1b51098ecf 100644 --- a/server/channels/store/storetest/mocks/JobStore.go +++ b/server/channels/store/storetest/mocks/JobStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,13 +33,16 @@ func (_m *JobStore) Delete(id string) (string, error) { ret := _m.Called(id) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(id) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -54,6 +57,10 @@ func (_m *JobStore) Get(id string) (*model.Job, error) { ret := _m.Called(id) var r0 *model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Job, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.Job); ok { r0 = rf(id) } else { @@ -62,7 +69,6 @@ func (_m *JobStore) Get(id string) (*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -77,6 +83,10 @@ func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, error) { ret := _m.Called(status) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Job, error)); ok { + return rf(status) + } if rf, ok := ret.Get(0).(func(string) []*model.Job); ok { r0 = rf(status) } else { @@ -85,7 +95,6 @@ func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(status) } else { @@ -100,6 +109,10 @@ func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, error) { ret := _m.Called(jobType) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Job, error)); ok { + return rf(jobType) + } if rf, ok := ret.Get(0).(func(string) []*model.Job); ok { r0 = rf(jobType) } else { @@ -108,7 +121,6 @@ func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(jobType) } else { @@ -123,6 +135,10 @@ func (_m *JobStore) GetAllByTypeAndStatus(jobType string, status string) ([]*mod ret := _m.Called(jobType, status) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.Job, error)); ok { + return rf(jobType, status) + } if rf, ok := ret.Get(0).(func(string, string) []*model.Job); ok { r0 = rf(jobType, status) } else { @@ -131,7 +147,6 @@ func (_m *JobStore) GetAllByTypeAndStatus(jobType string, status string) ([]*mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(jobType, status) } else { @@ -146,6 +161,10 @@ func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]* ret := _m.Called(jobType, offset, limit) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Job, error)); ok { + return rf(jobType, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Job); ok { r0 = rf(jobType, offset, limit) } else { @@ -154,7 +173,6 @@ func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]* } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(jobType, offset, limit) } else { @@ -169,6 +187,10 @@ func (_m *JobStore) GetAllByTypesPage(jobTypes []string, offset int, limit int) ret := _m.Called(jobTypes, offset, limit) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func([]string, int, int) ([]*model.Job, error)); ok { + return rf(jobTypes, offset, limit) + } if rf, ok := ret.Get(0).(func([]string, int, int) []*model.Job); ok { r0 = rf(jobTypes, offset, limit) } else { @@ -177,7 +199,6 @@ func (_m *JobStore) GetAllByTypesPage(jobTypes []string, offset int, limit int) } } - var r1 error if rf, ok := ret.Get(1).(func([]string, int, int) error); ok { r1 = rf(jobTypes, offset, limit) } else { @@ -192,6 +213,10 @@ func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, error) { ret := _m.Called(offset, limit) var r0 []*model.Job + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.Job, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.Job); ok { r0 = rf(offset, limit) } else { @@ -200,7 +225,6 @@ func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -215,13 +239,16 @@ func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int6 ret := _m.Called(status, jobType) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (int64, error)); ok { + return rf(status, jobType) + } if rf, ok := ret.Get(0).(func(string, string) int64); ok { r0 = rf(status, jobType) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(status, jobType) } else { @@ -236,6 +263,10 @@ func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) ( ret := _m.Called(status, jobType) var r0 *model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Job, error)); ok { + return rf(status, jobType) + } if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok { r0 = rf(status, jobType) } else { @@ -244,7 +275,6 @@ func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) ( } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(status, jobType) } else { @@ -259,6 +289,10 @@ func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType str ret := _m.Called(statuses, jobType) var r0 *model.Job + var r1 error + if rf, ok := ret.Get(0).(func([]string, string) (*model.Job, error)); ok { + return rf(statuses, jobType) + } if rf, ok := ret.Get(0).(func([]string, string) *model.Job); ok { r0 = rf(statuses, jobType) } else { @@ -267,7 +301,6 @@ func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType str } } - var r1 error if rf, ok := ret.Get(1).(func([]string, string) error); ok { r1 = rf(statuses, jobType) } else { @@ -282,6 +315,10 @@ func (_m *JobStore) Save(job *model.Job) (*model.Job, error) { ret := _m.Called(job) var r0 *model.Job + var r1 error + if rf, ok := ret.Get(0).(func(*model.Job) (*model.Job, error)); ok { + return rf(job) + } if rf, ok := ret.Get(0).(func(*model.Job) *model.Job); ok { r0 = rf(job) } else { @@ -290,7 +327,6 @@ func (_m *JobStore) Save(job *model.Job) (*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Job) error); ok { r1 = rf(job) } else { @@ -305,13 +341,16 @@ func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) ( ret := _m.Called(job, currentStatus) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*model.Job, string) (bool, error)); ok { + return rf(job, currentStatus) + } if rf, ok := ret.Get(0).(func(*model.Job, string) bool); ok { r0 = rf(job, currentStatus) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*model.Job, string) error); ok { r1 = rf(job, currentStatus) } else { @@ -326,6 +365,10 @@ func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, error) { ret := _m.Called(id, status) var r0 *model.Job + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.Job, error)); ok { + return rf(id, status) + } if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok { r0 = rf(id, status) } else { @@ -334,7 +377,6 @@ func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(id, status) } else { @@ -349,13 +391,16 @@ func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, ret := _m.Called(id, currentStatus, newStatus) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (bool, error)); ok { + return rf(id, currentStatus, newStatus) + } if rf, ok := ret.Get(0).(func(string, string, string) bool); ok { r0 = rf(id, currentStatus, newStatus) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(id, currentStatus, newStatus) } else { @@ -364,3 +409,18 @@ func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, return r0, r1 } + +type mockConstructorTestingTNewJobStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewJobStore creates a new instance of JobStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewJobStore(t mockConstructorTestingTNewJobStore) *JobStore { + mock := &JobStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/LicenseStore.go b/server/channels/store/storetest/mocks/LicenseStore.go index f58139c882..b0a7947169 100644 --- a/server/channels/store/storetest/mocks/LicenseStore.go +++ b/server/channels/store/storetest/mocks/LicenseStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *LicenseStore) Get(id string) (*model.LicenseRecord, error) { ret := _m.Called(id) var r0 *model.LicenseRecord + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.LicenseRecord, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.LicenseRecord); ok { r0 = rf(id) } else { @@ -27,7 +31,6 @@ func (_m *LicenseStore) Get(id string) (*model.LicenseRecord, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -42,6 +45,10 @@ func (_m *LicenseStore) GetAll() ([]*model.LicenseRecord, error) { ret := _m.Called() var r0 []*model.LicenseRecord + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.LicenseRecord, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.LicenseRecord); ok { r0 = rf() } else { @@ -50,7 +57,6 @@ func (_m *LicenseStore) GetAll() ([]*model.LicenseRecord, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -65,6 +71,10 @@ func (_m *LicenseStore) Save(license *model.LicenseRecord) (*model.LicenseRecord ret := _m.Called(license) var r0 *model.LicenseRecord + var r1 error + if rf, ok := ret.Get(0).(func(*model.LicenseRecord) (*model.LicenseRecord, error)); ok { + return rf(license) + } if rf, ok := ret.Get(0).(func(*model.LicenseRecord) *model.LicenseRecord); ok { r0 = rf(license) } else { @@ -73,7 +83,6 @@ func (_m *LicenseStore) Save(license *model.LicenseRecord) (*model.LicenseRecord } } - var r1 error if rf, ok := ret.Get(1).(func(*model.LicenseRecord) error); ok { r1 = rf(license) } else { @@ -82,3 +91,18 @@ func (_m *LicenseStore) Save(license *model.LicenseRecord) (*model.LicenseRecord return r0, r1 } + +type mockConstructorTestingTNewLicenseStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewLicenseStore creates a new instance of LicenseStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLicenseStore(t mockConstructorTestingTNewLicenseStore) *LicenseStore { + mock := &LicenseStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/LinkMetadataStore.go b/server/channels/store/storetest/mocks/LinkMetadataStore.go index 19f7937f77..5bf135f9d2 100644 --- a/server/channels/store/storetest/mocks/LinkMetadataStore.go +++ b/server/channels/store/storetest/mocks/LinkMetadataStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *LinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetada ret := _m.Called(url, timestamp) var r0 *model.LinkMetadata + var r1 error + if rf, ok := ret.Get(0).(func(string, int64) (*model.LinkMetadata, error)); ok { + return rf(url, timestamp) + } if rf, ok := ret.Get(0).(func(string, int64) *model.LinkMetadata); ok { r0 = rf(url, timestamp) } else { @@ -27,7 +31,6 @@ func (_m *LinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetada } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64) error); ok { r1 = rf(url, timestamp) } else { @@ -42,6 +45,10 @@ func (_m *LinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.Link ret := _m.Called(linkMetadata) var r0 *model.LinkMetadata + var r1 error + if rf, ok := ret.Get(0).(func(*model.LinkMetadata) (*model.LinkMetadata, error)); ok { + return rf(linkMetadata) + } if rf, ok := ret.Get(0).(func(*model.LinkMetadata) *model.LinkMetadata); ok { r0 = rf(linkMetadata) } else { @@ -50,7 +57,6 @@ func (_m *LinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.Link } } - var r1 error if rf, ok := ret.Get(1).(func(*model.LinkMetadata) error); ok { r1 = rf(linkMetadata) } else { @@ -59,3 +65,18 @@ func (_m *LinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.Link return r0, r1 } + +type mockConstructorTestingTNewLinkMetadataStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewLinkMetadataStore creates a new instance of LinkMetadataStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLinkMetadataStore(t mockConstructorTestingTNewLinkMetadataStore) *LinkMetadataStore { + mock := &LinkMetadataStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/NotifyAdminStore.go b/server/channels/store/storetest/mocks/NotifyAdminStore.go index dbada2f895..eceb2be8d9 100644 --- a/server/channels/store/storetest/mocks/NotifyAdminStore.go +++ b/server/channels/store/storetest/mocks/NotifyAdminStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,6 +33,10 @@ func (_m *NotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData, error) { ret := _m.Called(trial) var r0 []*model.NotifyAdminData + var r1 error + if rf, ok := ret.Get(0).(func(bool) ([]*model.NotifyAdminData, error)); ok { + return rf(trial) + } if rf, ok := ret.Get(0).(func(bool) []*model.NotifyAdminData); ok { r0 = rf(trial) } else { @@ -41,7 +45,6 @@ func (_m *NotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(bool) error); ok { r1 = rf(trial) } else { @@ -56,6 +59,10 @@ func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature mod ret := _m.Called(userId, feature) var r0 []*model.NotifyAdminData + var r1 error + if rf, ok := ret.Get(0).(func(string, model.MattermostFeature) ([]*model.NotifyAdminData, error)); ok { + return rf(userId, feature) + } if rf, ok := ret.Get(0).(func(string, model.MattermostFeature) []*model.NotifyAdminData); ok { r0 = rf(userId, feature) } else { @@ -64,7 +71,6 @@ func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, model.MattermostFeature) error); ok { r1 = rf(userId, feature) } else { @@ -79,6 +85,10 @@ func (_m *NotifyAdminStore) Save(data *model.NotifyAdminData) (*model.NotifyAdmi ret := _m.Called(data) var r0 *model.NotifyAdminData + var r1 error + if rf, ok := ret.Get(0).(func(*model.NotifyAdminData) (*model.NotifyAdminData, error)); ok { + return rf(data) + } if rf, ok := ret.Get(0).(func(*model.NotifyAdminData) *model.NotifyAdminData); ok { r0 = rf(data) } else { @@ -87,7 +97,6 @@ func (_m *NotifyAdminStore) Save(data *model.NotifyAdminData) (*model.NotifyAdmi } } - var r1 error if rf, ok := ret.Get(1).(func(*model.NotifyAdminData) error); ok { r1 = rf(data) } else { @@ -110,3 +119,18 @@ func (_m *NotifyAdminStore) Update(userId string, requiredPlan string, requiredF return r0 } + +type mockConstructorTestingTNewNotifyAdminStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewNotifyAdminStore creates a new instance of NotifyAdminStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNotifyAdminStore(t mockConstructorTestingTNewNotifyAdminStore) *NotifyAdminStore { + mock := &NotifyAdminStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/OAuthStore.go b/server/channels/store/storetest/mocks/OAuthStore.go index 75cd533163..e368215b67 100644 --- a/server/channels/store/storetest/mocks/OAuthStore.go +++ b/server/channels/store/storetest/mocks/OAuthStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,6 +33,10 @@ func (_m *OAuthStore) GetAccessData(token string) (*model.AccessData, error) { ret := _m.Called(token) var r0 *model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.AccessData, error)); ok { + return rf(token) + } if rf, ok := ret.Get(0).(func(string) *model.AccessData); ok { r0 = rf(token) } else { @@ -41,7 +45,6 @@ func (_m *OAuthStore) GetAccessData(token string) (*model.AccessData, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(token) } else { @@ -56,6 +59,10 @@ func (_m *OAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessDa ret := _m.Called(token) var r0 *model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.AccessData, error)); ok { + return rf(token) + } if rf, ok := ret.Get(0).(func(string) *model.AccessData); ok { r0 = rf(token) } else { @@ -64,7 +71,6 @@ func (_m *OAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessDa } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(token) } else { @@ -79,6 +85,10 @@ func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientId string) ret := _m.Called(userID, clientId) var r0 []*model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.AccessData, error)); ok { + return rf(userID, clientId) + } if rf, ok := ret.Get(0).(func(string, string) []*model.AccessData); ok { r0 = rf(userID, clientId) } else { @@ -87,7 +97,6 @@ func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientId string) } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, clientId) } else { @@ -102,6 +111,10 @@ func (_m *OAuthStore) GetApp(id string) (*model.OAuthApp, error) { ret := _m.Called(id) var r0 *model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.OAuthApp, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.OAuthApp); ok { r0 = rf(id) } else { @@ -110,7 +123,6 @@ func (_m *OAuthStore) GetApp(id string) (*model.OAuthApp, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -125,6 +137,10 @@ func (_m *OAuthStore) GetAppByUser(userID string, offset int, limit int) ([]*mod ret := _m.Called(userID, offset, limit) var r0 []*model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OAuthApp, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.OAuthApp); ok { r0 = rf(userID, offset, limit) } else { @@ -133,7 +149,6 @@ func (_m *OAuthStore) GetAppByUser(userID string, offset int, limit int) ([]*mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -148,6 +163,10 @@ func (_m *OAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, error) ret := _m.Called(offset, limit) var r0 []*model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.OAuthApp, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.OAuthApp); ok { r0 = rf(offset, limit) } else { @@ -156,7 +175,6 @@ func (_m *OAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, error) } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -171,6 +189,10 @@ func (_m *OAuthStore) GetAuthData(code string) (*model.AuthData, error) { ret := _m.Called(code) var r0 *model.AuthData + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.AuthData, error)); ok { + return rf(code) + } if rf, ok := ret.Get(0).(func(string) *model.AuthData); ok { r0 = rf(code) } else { @@ -179,7 +201,6 @@ func (_m *OAuthStore) GetAuthData(code string) (*model.AuthData, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(code) } else { @@ -194,6 +215,10 @@ func (_m *OAuthStore) GetAuthorizedApps(userID string, offset int, limit int) ([ ret := _m.Called(userID, offset, limit) var r0 []*model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OAuthApp, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.OAuthApp); ok { r0 = rf(userID, offset, limit) } else { @@ -202,7 +227,6 @@ func (_m *OAuthStore) GetAuthorizedApps(userID string, offset int, limit int) ([ } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -217,6 +241,10 @@ func (_m *OAuthStore) GetPreviousAccessData(userID string, clientId string) (*mo ret := _m.Called(userID, clientId) var r0 *model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.AccessData, error)); ok { + return rf(userID, clientId) + } if rf, ok := ret.Get(0).(func(string, string) *model.AccessData); ok { r0 = rf(userID, clientId) } else { @@ -225,7 +253,6 @@ func (_m *OAuthStore) GetPreviousAccessData(userID string, clientId string) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, clientId) } else { @@ -324,6 +351,10 @@ func (_m *OAuthStore) SaveAccessData(accessData *model.AccessData) (*model.Acces ret := _m.Called(accessData) var r0 *model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(*model.AccessData) (*model.AccessData, error)); ok { + return rf(accessData) + } if rf, ok := ret.Get(0).(func(*model.AccessData) *model.AccessData); ok { r0 = rf(accessData) } else { @@ -332,7 +363,6 @@ func (_m *OAuthStore) SaveAccessData(accessData *model.AccessData) (*model.Acces } } - var r1 error if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok { r1 = rf(accessData) } else { @@ -347,6 +377,10 @@ func (_m *OAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, error) { ret := _m.Called(app) var r0 *model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, error)); ok { + return rf(app) + } if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok { r0 = rf(app) } else { @@ -355,7 +389,6 @@ func (_m *OAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok { r1 = rf(app) } else { @@ -370,6 +403,10 @@ func (_m *OAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, e ret := _m.Called(authData) var r0 *model.AuthData + var r1 error + if rf, ok := ret.Get(0).(func(*model.AuthData) (*model.AuthData, error)); ok { + return rf(authData) + } if rf, ok := ret.Get(0).(func(*model.AuthData) *model.AuthData); ok { r0 = rf(authData) } else { @@ -378,7 +415,6 @@ func (_m *OAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, e } } - var r1 error if rf, ok := ret.Get(1).(func(*model.AuthData) error); ok { r1 = rf(authData) } else { @@ -393,6 +429,10 @@ func (_m *OAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.Acc ret := _m.Called(accessData) var r0 *model.AccessData + var r1 error + if rf, ok := ret.Get(0).(func(*model.AccessData) (*model.AccessData, error)); ok { + return rf(accessData) + } if rf, ok := ret.Get(0).(func(*model.AccessData) *model.AccessData); ok { r0 = rf(accessData) } else { @@ -401,7 +441,6 @@ func (_m *OAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.Acc } } - var r1 error if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok { r1 = rf(accessData) } else { @@ -416,6 +455,10 @@ func (_m *OAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, error) { ret := _m.Called(app) var r0 *model.OAuthApp + var r1 error + if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, error)); ok { + return rf(app) + } if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok { r0 = rf(app) } else { @@ -424,7 +467,6 @@ func (_m *OAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok { r1 = rf(app) } else { @@ -433,3 +475,18 @@ func (_m *OAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, error) { return r0, r1 } + +type mockConstructorTestingTNewOAuthStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewOAuthStore creates a new instance of OAuthStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewOAuthStore(t mockConstructorTestingTNewOAuthStore) *OAuthStore { + mock := &OAuthStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/PluginStore.go b/server/channels/store/storetest/mocks/PluginStore.go index ca0ea03685..d44435d8db 100644 --- a/server/channels/store/storetest/mocks/PluginStore.go +++ b/server/channels/store/storetest/mocks/PluginStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *PluginStore) CompareAndDelete(keyVal *model.PluginKeyValue, oldValue [ ret := _m.Called(keyVal, oldValue) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*model.PluginKeyValue, []byte) (bool, error)); ok { + return rf(keyVal, oldValue) + } if rf, ok := ret.Get(0).(func(*model.PluginKeyValue, []byte) bool); ok { r0 = rf(keyVal, oldValue) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*model.PluginKeyValue, []byte) error); ok { r1 = rf(keyVal, oldValue) } else { @@ -40,13 +43,16 @@ func (_m *PluginStore) CompareAndSet(keyVal *model.PluginKeyValue, oldValue []by ret := _m.Called(keyVal, oldValue) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(*model.PluginKeyValue, []byte) (bool, error)); ok { + return rf(keyVal, oldValue) + } if rf, ok := ret.Get(0).(func(*model.PluginKeyValue, []byte) bool); ok { r0 = rf(keyVal, oldValue) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(*model.PluginKeyValue, []byte) error); ok { r1 = rf(keyVal, oldValue) } else { @@ -103,6 +109,10 @@ func (_m *PluginStore) Get(pluginID string, key string) (*model.PluginKeyValue, ret := _m.Called(pluginID, key) var r0 *model.PluginKeyValue + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.PluginKeyValue, error)); ok { + return rf(pluginID, key) + } if rf, ok := ret.Get(0).(func(string, string) *model.PluginKeyValue); ok { r0 = rf(pluginID, key) } else { @@ -111,7 +121,6 @@ func (_m *PluginStore) Get(pluginID string, key string) (*model.PluginKeyValue, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(pluginID, key) } else { @@ -126,6 +135,10 @@ func (_m *PluginStore) List(pluginID string, page int, perPage int) ([]string, e ret := _m.Called(pluginID, page, perPage) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]string, error)); ok { + return rf(pluginID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []string); ok { r0 = rf(pluginID, page, perPage) } else { @@ -134,7 +147,6 @@ func (_m *PluginStore) List(pluginID string, page int, perPage int) ([]string, e } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(pluginID, page, perPage) } else { @@ -149,6 +161,10 @@ func (_m *PluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*model.Plugin ret := _m.Called(keyVal) var r0 *model.PluginKeyValue + var r1 error + if rf, ok := ret.Get(0).(func(*model.PluginKeyValue) (*model.PluginKeyValue, error)); ok { + return rf(keyVal) + } if rf, ok := ret.Get(0).(func(*model.PluginKeyValue) *model.PluginKeyValue); ok { r0 = rf(keyVal) } else { @@ -157,7 +173,6 @@ func (_m *PluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*model.Plugin } } - var r1 error if rf, ok := ret.Get(1).(func(*model.PluginKeyValue) error); ok { r1 = rf(keyVal) } else { @@ -172,13 +187,16 @@ func (_m *PluginStore) SetWithOptions(pluginID string, key string, value []byte, ret := _m.Called(pluginID, key, value, options) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, string, []byte, model.PluginKVSetOptions) (bool, error)); ok { + return rf(pluginID, key, value, options) + } if rf, ok := ret.Get(0).(func(string, string, []byte, model.PluginKVSetOptions) bool); ok { r0 = rf(pluginID, key, value, options) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, []byte, model.PluginKVSetOptions) error); ok { r1 = rf(pluginID, key, value, options) } else { @@ -187,3 +205,18 @@ func (_m *PluginStore) SetWithOptions(pluginID string, key string, value []byte, return r0, r1 } + +type mockConstructorTestingTNewPluginStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewPluginStore creates a new instance of PluginStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPluginStore(t mockConstructorTestingTNewPluginStore) *PluginStore { + mock := &PluginStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/PostAcknowledgementStore.go b/server/channels/store/storetest/mocks/PostAcknowledgementStore.go index ad130137da..267ebf0bcf 100644 --- a/server/channels/store/storetest/mocks/PostAcknowledgementStore.go +++ b/server/channels/store/storetest/mocks/PostAcknowledgementStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,6 +33,10 @@ func (_m *PostAcknowledgementStore) Get(postID string, userID string) (*model.Po ret := _m.Called(postID, userID) var r0 *model.PostAcknowledgement + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.PostAcknowledgement, error)); ok { + return rf(postID, userID) + } if rf, ok := ret.Get(0).(func(string, string) *model.PostAcknowledgement); ok { r0 = rf(postID, userID) } else { @@ -41,7 +45,6 @@ func (_m *PostAcknowledgementStore) Get(postID string, userID string) (*model.Po } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(postID, userID) } else { @@ -56,6 +59,10 @@ func (_m *PostAcknowledgementStore) GetForPost(postID string) ([]*model.PostAckn ret := _m.Called(postID) var r0 []*model.PostAcknowledgement + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.PostAcknowledgement, error)); ok { + return rf(postID) + } if rf, ok := ret.Get(0).(func(string) []*model.PostAcknowledgement); ok { r0 = rf(postID) } else { @@ -64,7 +71,6 @@ func (_m *PostAcknowledgementStore) GetForPost(postID string) ([]*model.PostAckn } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postID) } else { @@ -79,6 +85,10 @@ func (_m *PostAcknowledgementStore) GetForPosts(postIds []string) ([]*model.Post ret := _m.Called(postIds) var r0 []*model.PostAcknowledgement + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.PostAcknowledgement, error)); ok { + return rf(postIds) + } if rf, ok := ret.Get(0).(func([]string) []*model.PostAcknowledgement); ok { r0 = rf(postIds) } else { @@ -87,7 +97,6 @@ func (_m *PostAcknowledgementStore) GetForPosts(postIds []string) ([]*model.Post } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(postIds) } else { @@ -102,6 +111,10 @@ func (_m *PostAcknowledgementStore) Save(postID string, userID string, acknowled ret := _m.Called(postID, userID, acknowledgedAt) var r0 *model.PostAcknowledgement + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64) (*model.PostAcknowledgement, error)); ok { + return rf(postID, userID, acknowledgedAt) + } if rf, ok := ret.Get(0).(func(string, string, int64) *model.PostAcknowledgement); ok { r0 = rf(postID, userID, acknowledgedAt) } else { @@ -110,7 +123,6 @@ func (_m *PostAcknowledgementStore) Save(postID string, userID string, acknowled } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64) error); ok { r1 = rf(postID, userID, acknowledgedAt) } else { @@ -119,3 +131,18 @@ func (_m *PostAcknowledgementStore) Save(postID string, userID string, acknowled return r0, r1 } + +type mockConstructorTestingTNewPostAcknowledgementStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewPostAcknowledgementStore creates a new instance of PostAcknowledgementStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPostAcknowledgementStore(t mockConstructorTestingTNewPostAcknowledgementStore) *PostAcknowledgementStore { + mock := &PostAcknowledgementStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/PostPriorityStore.go b/server/channels/store/storetest/mocks/PostPriorityStore.go index de126ec11a..5fc302066d 100644 --- a/server/channels/store/storetest/mocks/PostPriorityStore.go +++ b/server/channels/store/storetest/mocks/PostPriorityStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *PostPriorityStore) GetForPost(postId string) (*model.PostPriority, err ret := _m.Called(postId) var r0 *model.PostPriority + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.PostPriority, error)); ok { + return rf(postId) + } if rf, ok := ret.Get(0).(func(string) *model.PostPriority); ok { r0 = rf(postId) } else { @@ -27,7 +31,6 @@ func (_m *PostPriorityStore) GetForPost(postId string) (*model.PostPriority, err } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postId) } else { @@ -42,6 +45,10 @@ func (_m *PostPriorityStore) GetForPosts(ids []string) ([]*model.PostPriority, e ret := _m.Called(ids) var r0 []*model.PostPriority + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.PostPriority, error)); ok { + return rf(ids) + } if rf, ok := ret.Get(0).(func([]string) []*model.PostPriority); ok { r0 = rf(ids) } else { @@ -50,7 +57,6 @@ func (_m *PostPriorityStore) GetForPosts(ids []string) ([]*model.PostPriority, e } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(ids) } else { @@ -59,3 +65,18 @@ func (_m *PostPriorityStore) GetForPosts(ids []string) ([]*model.PostPriority, e return r0, r1 } + +type mockConstructorTestingTNewPostPriorityStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewPostPriorityStore creates a new instance of PostPriorityStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPostPriorityStore(t mockConstructorTestingTNewPostPriorityStore) *PostPriorityStore { + mock := &PostPriorityStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/PostStore.go b/server/channels/store/storetest/mocks/PostStore.go index 727b5944dd..2d16e519d6 100644 --- a/server/channels/store/storetest/mocks/PostStore.go +++ b/server/channels/store/storetest/mocks/PostStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -23,13 +23,16 @@ func (_m *PostStore) AnalyticsPostCount(options *model.PostCountOptions) (int64, ret := _m.Called(options) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(*model.PostCountOptions) (int64, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.PostCountOptions) int64); ok { r0 = rf(options) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(*model.PostCountOptions) error); ok { r1 = rf(options) } else { @@ -44,6 +47,10 @@ func (_m *PostStore) AnalyticsPostCountsByDay(options *model.AnalyticsPostCounts ret := _m.Called(options) var r0 model.AnalyticsRows + var r1 error + if rf, ok := ret.Get(0).(func(*model.AnalyticsPostCountsOptions) (model.AnalyticsRows, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.AnalyticsPostCountsOptions) model.AnalyticsRows); ok { r0 = rf(options) } else { @@ -52,7 +59,6 @@ func (_m *PostStore) AnalyticsPostCountsByDay(options *model.AnalyticsPostCounts } } - var r1 error if rf, ok := ret.Get(1).(func(*model.AnalyticsPostCountsOptions) error); ok { r1 = rf(options) } else { @@ -67,6 +73,10 @@ func (_m *PostStore) AnalyticsUserCountsWithPostsByDay(teamID string) (model.Ana ret := _m.Called(teamID) var r0 model.AnalyticsRows + var r1 error + if rf, ok := ret.Get(0).(func(string) (model.AnalyticsRows, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) model.AnalyticsRows); ok { r0 = rf(teamID) } else { @@ -75,7 +85,6 @@ func (_m *PostStore) AnalyticsUserCountsWithPostsByDay(teamID string) (model.Ana } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -109,13 +118,16 @@ func (_m *PostStore) DeleteOrphanedRows(limit int) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -130,6 +142,10 @@ func (_m *PostStore) Get(ctx context.Context, id string, opts model.GetPostsOpti ret := _m.Called(ctx, id, opts, userID, sanitizeOptions) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, model.GetPostsOptions, string, map[string]bool) (*model.PostList, error)); ok { + return rf(ctx, id, opts, userID, sanitizeOptions) + } if rf, ok := ret.Get(0).(func(context.Context, string, model.GetPostsOptions, string, map[string]bool) *model.PostList); ok { r0 = rf(ctx, id, opts, userID, sanitizeOptions) } else { @@ -138,7 +154,6 @@ func (_m *PostStore) Get(ctx context.Context, id string, opts model.GetPostsOpti } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, model.GetPostsOptions, string, map[string]bool) error); ok { r1 = rf(ctx, id, opts, userID, sanitizeOptions) } else { @@ -153,6 +168,10 @@ func (_m *PostStore) GetDirectPostParentsForExportAfter(limit int, afterID strin ret := _m.Called(limit, afterID) var r0 []*model.DirectPostForExport + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.DirectPostForExport, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.DirectPostForExport); ok { r0 = rf(limit, afterID) } else { @@ -161,7 +180,6 @@ func (_m *PostStore) GetDirectPostParentsForExportAfter(limit int, afterID strin } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -176,6 +194,10 @@ func (_m *PostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) ret := _m.Called(postId) var r0 []*model.Post + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Post, error)); ok { + return rf(postId) + } if rf, ok := ret.Get(0).(func(string) []*model.Post); ok { r0 = rf(postId) } else { @@ -184,7 +206,6 @@ func (_m *PostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postId) } else { @@ -213,6 +234,10 @@ func (_m *PostStore) GetFlaggedPosts(userID string, offset int, limit int) (*mod ret := _m.Called(userID, offset, limit) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (*model.PostList, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) *model.PostList); ok { r0 = rf(userID, offset, limit) } else { @@ -221,7 +246,6 @@ func (_m *PostStore) GetFlaggedPosts(userID string, offset int, limit int) (*mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -236,6 +260,10 @@ func (_m *PostStore) GetFlaggedPostsForChannel(userID string, channelID string, ret := _m.Called(userID, channelID, offset, limit) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, error)); ok { + return rf(userID, channelID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok { r0 = rf(userID, channelID, offset, limit) } else { @@ -244,7 +272,6 @@ func (_m *PostStore) GetFlaggedPostsForChannel(userID string, channelID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(userID, channelID, offset, limit) } else { @@ -259,6 +286,10 @@ func (_m *PostStore) GetFlaggedPostsForTeam(userID string, teamID string, offset ret := _m.Called(userID, teamID, offset, limit) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, error)); ok { + return rf(userID, teamID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok { r0 = rf(userID, teamID, offset, limit) } else { @@ -267,7 +298,6 @@ func (_m *PostStore) GetFlaggedPostsForTeam(userID string, teamID string, offset } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(userID, teamID, offset, limit) } else { @@ -296,13 +326,16 @@ func (_m *PostStore) GetNthRecentPostTime(n int64) (int64, error) { ret := _m.Called(n) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64) (int64, error)); ok { + return rf(n) + } if rf, ok := ret.Get(0).(func(int64) int64); ok { r0 = rf(n) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(n) } else { @@ -317,6 +350,10 @@ func (_m *PostStore) GetOldest() (*model.Post, error) { ret := _m.Called() var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func() (*model.Post, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *model.Post); ok { r0 = rf() } else { @@ -325,7 +362,6 @@ func (_m *PostStore) GetOldest() (*model.Post, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -340,13 +376,16 @@ func (_m *PostStore) GetOldestEntityCreationTime() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -361,6 +400,10 @@ func (_m *PostStore) GetParentsForExportAfter(limit int, afterID string) ([]*mod ret := _m.Called(limit, afterID) var r0 []*model.PostForExport + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.PostForExport, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.PostForExport); ok { r0 = rf(limit, afterID) } else { @@ -369,7 +412,6 @@ func (_m *PostStore) GetParentsForExportAfter(limit int, afterID string) ([]*mod } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -384,6 +426,10 @@ func (_m *PostStore) GetPostAfterTime(channelID string, timestamp int64, collaps ret := _m.Called(channelID, timestamp, collapsedThreads) var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, bool) (*model.Post, error)); ok { + return rf(channelID, timestamp, collapsedThreads) + } if rf, ok := ret.Get(0).(func(string, int64, bool) *model.Post); ok { r0 = rf(channelID, timestamp, collapsedThreads) } else { @@ -392,7 +438,6 @@ func (_m *PostStore) GetPostAfterTime(channelID string, timestamp int64, collaps } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, bool) error); ok { r1 = rf(channelID, timestamp, collapsedThreads) } else { @@ -407,13 +452,16 @@ func (_m *PostStore) GetPostIdAfterTime(channelID string, timestamp int64, colla ret := _m.Called(channelID, timestamp, collapsedThreads) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, bool) (string, error)); ok { + return rf(channelID, timestamp, collapsedThreads) + } if rf, ok := ret.Get(0).(func(string, int64, bool) string); ok { r0 = rf(channelID, timestamp, collapsedThreads) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, bool) error); ok { r1 = rf(channelID, timestamp, collapsedThreads) } else { @@ -428,13 +476,16 @@ func (_m *PostStore) GetPostIdBeforeTime(channelID string, timestamp int64, coll ret := _m.Called(channelID, timestamp, collapsedThreads) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, bool) (string, error)); ok { + return rf(channelID, timestamp, collapsedThreads) + } if rf, ok := ret.Get(0).(func(string, int64, bool) string); ok { r0 = rf(channelID, timestamp, collapsedThreads) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, bool) error); ok { r1 = rf(channelID, timestamp, collapsedThreads) } else { @@ -449,6 +500,10 @@ func (_m *PostStore) GetPostReminderMetadata(postID string) (*store.PostReminder ret := _m.Called(postID) var r0 *store.PostReminderMetadata + var r1 error + if rf, ok := ret.Get(0).(func(string) (*store.PostReminderMetadata, error)); ok { + return rf(postID) + } if rf, ok := ret.Get(0).(func(string) *store.PostReminderMetadata); ok { r0 = rf(postID) } else { @@ -457,7 +512,6 @@ func (_m *PostStore) GetPostReminderMetadata(postID string) (*store.PostReminder } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(postID) } else { @@ -472,6 +526,10 @@ func (_m *PostStore) GetPostReminders(now int64) ([]*model.PostReminder, error) ret := _m.Called(now) var r0 []*model.PostReminder + var r1 error + if rf, ok := ret.Get(0).(func(int64) ([]*model.PostReminder, error)); ok { + return rf(now) + } if rf, ok := ret.Get(0).(func(int64) []*model.PostReminder); ok { r0 = rf(now) } else { @@ -480,7 +538,6 @@ func (_m *PostStore) GetPostReminders(now int64) ([]*model.PostReminder, error) } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(now) } else { @@ -495,6 +552,10 @@ func (_m *PostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool ret := _m.Called(options, allowFromCache, sanitizeOptions) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(model.GetPostsOptions, bool, map[string]bool) (*model.PostList, error)); ok { + return rf(options, allowFromCache, sanitizeOptions) + } if rf, ok := ret.Get(0).(func(model.GetPostsOptions, bool, map[string]bool) *model.PostList); ok { r0 = rf(options, allowFromCache, sanitizeOptions) } else { @@ -503,7 +564,6 @@ func (_m *PostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool } } - var r1 error if rf, ok := ret.Get(1).(func(model.GetPostsOptions, bool, map[string]bool) error); ok { r1 = rf(options, allowFromCache, sanitizeOptions) } else { @@ -518,6 +578,10 @@ func (_m *PostStore) GetPostsAfter(options model.GetPostsOptions, sanitizeOption ret := _m.Called(options, sanitizeOptions) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(model.GetPostsOptions, map[string]bool) (*model.PostList, error)); ok { + return rf(options, sanitizeOptions) + } if rf, ok := ret.Get(0).(func(model.GetPostsOptions, map[string]bool) *model.PostList); ok { r0 = rf(options, sanitizeOptions) } else { @@ -526,7 +590,6 @@ func (_m *PostStore) GetPostsAfter(options model.GetPostsOptions, sanitizeOption } } - var r1 error if rf, ok := ret.Get(1).(func(model.GetPostsOptions, map[string]bool) error); ok { r1 = rf(options, sanitizeOptions) } else { @@ -541,6 +604,10 @@ func (_m *PostStore) GetPostsBatchForIndexing(startTime int64, startPostID strin ret := _m.Called(startTime, startPostID, limit) var r0 []*model.PostForIndexing + var r1 error + if rf, ok := ret.Get(0).(func(int64, string, int) ([]*model.PostForIndexing, error)); ok { + return rf(startTime, startPostID, limit) + } if rf, ok := ret.Get(0).(func(int64, string, int) []*model.PostForIndexing); ok { r0 = rf(startTime, startPostID, limit) } else { @@ -549,7 +616,6 @@ func (_m *PostStore) GetPostsBatchForIndexing(startTime int64, startPostID strin } } - var r1 error if rf, ok := ret.Get(1).(func(int64, string, int) error); ok { r1 = rf(startTime, startPostID, limit) } else { @@ -564,6 +630,10 @@ func (_m *PostStore) GetPostsBefore(options model.GetPostsOptions, sanitizeOptio ret := _m.Called(options, sanitizeOptions) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(model.GetPostsOptions, map[string]bool) (*model.PostList, error)); ok { + return rf(options, sanitizeOptions) + } if rf, ok := ret.Get(0).(func(model.GetPostsOptions, map[string]bool) *model.PostList); ok { r0 = rf(options, sanitizeOptions) } else { @@ -572,7 +642,6 @@ func (_m *PostStore) GetPostsBefore(options model.GetPostsOptions, sanitizeOptio } } - var r1 error if rf, ok := ret.Get(1).(func(model.GetPostsOptions, map[string]bool) error); ok { r1 = rf(options, sanitizeOptions) } else { @@ -587,6 +656,10 @@ func (_m *PostStore) GetPostsByIds(postIds []string) ([]*model.Post, error) { ret := _m.Called(postIds) var r0 []*model.Post + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Post, error)); ok { + return rf(postIds) + } if rf, ok := ret.Get(0).(func([]string) []*model.Post); ok { r0 = rf(postIds) } else { @@ -595,7 +668,6 @@ func (_m *PostStore) GetPostsByIds(postIds []string) ([]*model.Post, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(postIds) } else { @@ -610,6 +682,10 @@ func (_m *PostStore) GetPostsByThread(threadID string, since int64) ([]*model.Po ret := _m.Called(threadID, since) var r0 []*model.Post + var r1 error + if rf, ok := ret.Get(0).(func(string, int64) ([]*model.Post, error)); ok { + return rf(threadID, since) + } if rf, ok := ret.Get(0).(func(string, int64) []*model.Post); ok { r0 = rf(threadID, since) } else { @@ -618,7 +694,6 @@ func (_m *PostStore) GetPostsByThread(threadID string, since int64) ([]*model.Po } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64) error); ok { r1 = rf(threadID, since) } else { @@ -633,6 +708,10 @@ func (_m *PostStore) GetPostsCreatedAt(channelID string, timestamp int64) ([]*mo ret := _m.Called(channelID, timestamp) var r0 []*model.Post + var r1 error + if rf, ok := ret.Get(0).(func(string, int64) ([]*model.Post, error)); ok { + return rf(channelID, timestamp) + } if rf, ok := ret.Get(0).(func(string, int64) []*model.Post); ok { r0 = rf(channelID, timestamp) } else { @@ -641,7 +720,6 @@ func (_m *PostStore) GetPostsCreatedAt(channelID string, timestamp int64) ([]*mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64) error); ok { r1 = rf(channelID, timestamp) } else { @@ -656,6 +734,10 @@ func (_m *PostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFrom ret := _m.Called(options, allowFromCache, sanitizeOptions) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, bool, map[string]bool) (*model.PostList, error)); ok { + return rf(options, allowFromCache, sanitizeOptions) + } if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, bool, map[string]bool) *model.PostList); ok { r0 = rf(options, allowFromCache, sanitizeOptions) } else { @@ -664,7 +746,6 @@ func (_m *PostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFrom } } - var r1 error if rf, ok := ret.Get(1).(func(model.GetPostsSinceOptions, bool, map[string]bool) error); ok { r1 = rf(options, allowFromCache, sanitizeOptions) } else { @@ -679,6 +760,11 @@ func (_m *PostStore) GetPostsSinceForSync(options model.GetPostsSinceForSyncOpti ret := _m.Called(options, cursor, limit) var r0 []*model.Post + var r1 model.GetPostsSinceForSyncCursor + var r2 error + if rf, ok := ret.Get(0).(func(model.GetPostsSinceForSyncOptions, model.GetPostsSinceForSyncCursor, int) ([]*model.Post, model.GetPostsSinceForSyncCursor, error)); ok { + return rf(options, cursor, limit) + } if rf, ok := ret.Get(0).(func(model.GetPostsSinceForSyncOptions, model.GetPostsSinceForSyncCursor, int) []*model.Post); ok { r0 = rf(options, cursor, limit) } else { @@ -687,14 +773,12 @@ func (_m *PostStore) GetPostsSinceForSync(options model.GetPostsSinceForSyncOpti } } - var r1 model.GetPostsSinceForSyncCursor if rf, ok := ret.Get(1).(func(model.GetPostsSinceForSyncOptions, model.GetPostsSinceForSyncCursor, int) model.GetPostsSinceForSyncCursor); ok { r1 = rf(options, cursor, limit) } else { r1 = ret.Get(1).(model.GetPostsSinceForSyncCursor) } - var r2 error if rf, ok := ret.Get(2).(func(model.GetPostsSinceForSyncOptions, model.GetPostsSinceForSyncCursor, int) error); ok { r2 = rf(options, cursor, limit) } else { @@ -709,6 +793,10 @@ func (_m *PostStore) GetRecentSearchesForUser(userID string) ([]*model.SearchPar ret := _m.Called(userID) var r0 []*model.SearchParams + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.SearchParams, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.SearchParams); ok { r0 = rf(userID) } else { @@ -717,7 +805,6 @@ func (_m *PostStore) GetRecentSearchesForUser(userID string) ([]*model.SearchPar } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -732,6 +819,10 @@ func (_m *PostStore) GetRepliesForExport(parentID string) ([]*model.ReplyForExpo ret := _m.Called(parentID) var r0 []*model.ReplyForExport + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.ReplyForExport, error)); ok { + return rf(parentID) + } if rf, ok := ret.Get(0).(func(string) []*model.ReplyForExport); ok { r0 = rf(parentID) } else { @@ -740,7 +831,6 @@ func (_m *PostStore) GetRepliesForExport(parentID string) ([]*model.ReplyForExpo } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(parentID) } else { @@ -755,6 +845,10 @@ func (_m *PostStore) GetSingle(id string, inclDeleted bool) (*model.Post, error) ret := _m.Called(id, inclDeleted) var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (*model.Post, error)); ok { + return rf(id, inclDeleted) + } if rf, ok := ret.Get(0).(func(string, bool) *model.Post); ok { r0 = rf(id, inclDeleted) } else { @@ -763,7 +857,6 @@ func (_m *PostStore) GetSingle(id string, inclDeleted bool) (*model.Post, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(id, inclDeleted) } else { @@ -778,6 +871,10 @@ func (_m *PostStore) GetTopDMsForUserSince(userID string, since int64, offset in ret := _m.Called(userID, since, offset, limit) var r0 *model.TopDMList + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, int, int) (*model.TopDMList, error)); ok { + return rf(userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int64, int, int) *model.TopDMList); ok { r0 = rf(userID, since, offset, limit) } else { @@ -786,7 +883,6 @@ func (_m *PostStore) GetTopDMsForUserSince(userID string, since int64, offset in } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, int, int) error); ok { r1 = rf(userID, since, offset, limit) } else { @@ -801,13 +897,16 @@ func (_m *PostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceO ret := _m.Called(options, userId) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, string) (bool, error)); ok { + return rf(options, userId) + } if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, string) bool); ok { r0 = rf(options, userId) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(model.GetPostsSinceOptions, string) error); ok { r1 = rf(options, userId) } else { @@ -841,6 +940,10 @@ func (_m *PostStore) Overwrite(post *model.Post) (*model.Post, error) { ret := _m.Called(post) var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, error)); ok { + return rf(post) + } if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { r0 = rf(post) } else { @@ -849,7 +952,6 @@ func (_m *PostStore) Overwrite(post *model.Post) (*model.Post, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Post) error); ok { r1 = rf(post) } else { @@ -864,6 +966,11 @@ func (_m *PostStore) OverwriteMultiple(posts []*model.Post) ([]*model.Post, int, ret := _m.Called(posts) var r0 []*model.Post + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func([]*model.Post) ([]*model.Post, int, error)); ok { + return rf(posts) + } if rf, ok := ret.Get(0).(func([]*model.Post) []*model.Post); ok { r0 = rf(posts) } else { @@ -872,14 +979,12 @@ func (_m *PostStore) OverwriteMultiple(posts []*model.Post) ([]*model.Post, int, } } - var r1 int if rf, ok := ret.Get(1).(func([]*model.Post) int); ok { r1 = rf(posts) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func([]*model.Post) error); ok { r2 = rf(posts) } else { @@ -894,13 +999,16 @@ func (_m *PostStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, er ret := _m.Called(endTime, limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok { + return rf(endTime, limit) + } if rf, ok := ret.Get(0).(func(int64, int64) int64); ok { r0 = rf(endTime, limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64) error); ok { r1 = rf(endTime, limit) } else { @@ -915,20 +1023,23 @@ func (_m *PostStore) PermanentDeleteBatchForRetentionPolicies(now int64, globalP ret := _m.Called(now, globalPolicyEndTime, limit, cursor) var r0 int64 + var r1 model.RetentionPolicyCursor + var r2 error + if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok { + return rf(now, globalPolicyEndTime, limit, cursor) + } if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) int64); ok { r0 = rf(now, globalPolicyEndTime, limit, cursor) } else { r0 = ret.Get(0).(int64) } - var r1 model.RetentionPolicyCursor if rf, ok := ret.Get(1).(func(int64, int64, int64, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok { r1 = rf(now, globalPolicyEndTime, limit, cursor) } else { r1 = ret.Get(1).(model.RetentionPolicyCursor) } - var r2 error if rf, ok := ret.Get(2).(func(int64, int64, int64, model.RetentionPolicyCursor) error); ok { r2 = rf(now, globalPolicyEndTime, limit, cursor) } else { @@ -971,6 +1082,10 @@ func (_m *PostStore) Save(post *model.Post) (*model.Post, error) { ret := _m.Called(post) var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, error)); ok { + return rf(post) + } if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { r0 = rf(post) } else { @@ -979,7 +1094,6 @@ func (_m *PostStore) Save(post *model.Post) (*model.Post, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Post) error); ok { r1 = rf(post) } else { @@ -994,6 +1108,11 @@ func (_m *PostStore) SaveMultiple(posts []*model.Post) ([]*model.Post, int, erro ret := _m.Called(posts) var r0 []*model.Post + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func([]*model.Post) ([]*model.Post, int, error)); ok { + return rf(posts) + } if rf, ok := ret.Get(0).(func([]*model.Post) []*model.Post); ok { r0 = rf(posts) } else { @@ -1002,14 +1121,12 @@ func (_m *PostStore) SaveMultiple(posts []*model.Post) ([]*model.Post, int, erro } } - var r1 int if rf, ok := ret.Get(1).(func([]*model.Post) int); ok { r1 = rf(posts) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func([]*model.Post) error); ok { r2 = rf(posts) } else { @@ -1024,6 +1141,10 @@ func (_m *PostStore) Search(teamID string, userID string, params *model.SearchPa ret := _m.Called(teamID, userID, params) var r0 *model.PostList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.SearchParams) (*model.PostList, error)); ok { + return rf(teamID, userID, params) + } if rf, ok := ret.Get(0).(func(string, string, *model.SearchParams) *model.PostList); ok { r0 = rf(teamID, userID, params) } else { @@ -1032,7 +1153,6 @@ func (_m *PostStore) Search(teamID string, userID string, params *model.SearchPa } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.SearchParams) error); ok { r1 = rf(teamID, userID, params) } else { @@ -1047,6 +1167,10 @@ func (_m *PostStore) SearchPostsForUser(paramsList []*model.SearchParams, userID ret := _m.Called(paramsList, userID, teamID, page, perPage) var r0 *model.PostSearchResults + var r1 error + if rf, ok := ret.Get(0).(func([]*model.SearchParams, string, string, int, int) (*model.PostSearchResults, error)); ok { + return rf(paramsList, userID, teamID, page, perPage) + } if rf, ok := ret.Get(0).(func([]*model.SearchParams, string, string, int, int) *model.PostSearchResults); ok { r0 = rf(paramsList, userID, teamID, page, perPage) } else { @@ -1055,7 +1179,6 @@ func (_m *PostStore) SearchPostsForUser(paramsList []*model.SearchParams, userID } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.SearchParams, string, string, int, int) error); ok { r1 = rf(paramsList, userID, teamID, page, perPage) } else { @@ -1084,6 +1207,10 @@ func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) (*model.Po ret := _m.Called(newPost, oldPost) var r0 *model.Post + var r1 error + if rf, ok := ret.Get(0).(func(*model.Post, *model.Post) (*model.Post, error)); ok { + return rf(newPost, oldPost) + } if rf, ok := ret.Get(0).(func(*model.Post, *model.Post) *model.Post); ok { r0 = rf(newPost, oldPost) } else { @@ -1092,7 +1219,6 @@ func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) (*model.Po } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Post, *model.Post) error); ok { r1 = rf(newPost, oldPost) } else { @@ -1101,3 +1227,18 @@ func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) (*model.Po return r0, r1 } + +type mockConstructorTestingTNewPostStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewPostStore creates a new instance of PostStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPostStore(t mockConstructorTestingTNewPostStore) *PostStore { + mock := &PostStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/PreferenceStore.go b/server/channels/store/storetest/mocks/PreferenceStore.go index c651e905bc..2d8c9a8dae 100644 --- a/server/channels/store/storetest/mocks/PreferenceStore.go +++ b/server/channels/store/storetest/mocks/PreferenceStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *PreferenceStore) CleanupFlagsBatch(limit int64) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int64) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(limit) } else { @@ -82,13 +85,16 @@ func (_m *PreferenceStore) DeleteOrphanedRows(limit int) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -103,6 +109,10 @@ func (_m *PreferenceStore) Get(userID string, category string, name string) (*mo ret := _m.Called(userID, category, name) var r0 *model.Preference + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (*model.Preference, error)); ok { + return rf(userID, category, name) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.Preference); ok { r0 = rf(userID, category, name) } else { @@ -111,7 +121,6 @@ func (_m *PreferenceStore) Get(userID string, category string, name string) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(userID, category, name) } else { @@ -126,6 +135,10 @@ func (_m *PreferenceStore) GetAll(userID string) (model.Preferences, error) { ret := _m.Called(userID) var r0 model.Preferences + var r1 error + if rf, ok := ret.Get(0).(func(string) (model.Preferences, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) model.Preferences); ok { r0 = rf(userID) } else { @@ -134,7 +147,6 @@ func (_m *PreferenceStore) GetAll(userID string) (model.Preferences, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -149,6 +161,10 @@ func (_m *PreferenceStore) GetCategory(userID string, category string) (model.Pr ret := _m.Called(userID, category) var r0 model.Preferences + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (model.Preferences, error)); ok { + return rf(userID, category) + } if rf, ok := ret.Get(0).(func(string, string) model.Preferences); ok { r0 = rf(userID, category) } else { @@ -157,7 +173,6 @@ func (_m *PreferenceStore) GetCategory(userID string, category string) (model.Pr } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, category) } else { @@ -172,6 +187,10 @@ func (_m *PreferenceStore) GetCategoryAndName(category string, nane string) (mod ret := _m.Called(category, nane) var r0 model.Preferences + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (model.Preferences, error)); ok { + return rf(category, nane) + } if rf, ok := ret.Get(0).(func(string, string) model.Preferences); ok { r0 = rf(category, nane) } else { @@ -180,7 +199,6 @@ func (_m *PreferenceStore) GetCategoryAndName(category string, nane string) (mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(category, nane) } else { @@ -217,3 +235,18 @@ func (_m *PreferenceStore) Save(preferences model.Preferences) error { return r0 } + +type mockConstructorTestingTNewPreferenceStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewPreferenceStore creates a new instance of PreferenceStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewPreferenceStore(t mockConstructorTestingTNewPreferenceStore) *PreferenceStore { + mock := &PreferenceStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ProductNoticesStore.go b/server/channels/store/storetest/mocks/ProductNoticesStore.go index dc5c673464..15230fa626 100644 --- a/server/channels/store/storetest/mocks/ProductNoticesStore.go +++ b/server/channels/store/storetest/mocks/ProductNoticesStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -47,6 +47,10 @@ func (_m *ProductNoticesStore) GetViews(userID string) ([]model.ProductNoticeVie ret := _m.Called(userID) var r0 []model.ProductNoticeViewState + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]model.ProductNoticeViewState, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []model.ProductNoticeViewState); ok { r0 = rf(userID) } else { @@ -55,7 +59,6 @@ func (_m *ProductNoticesStore) GetViews(userID string) ([]model.ProductNoticeVie } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -78,3 +81,18 @@ func (_m *ProductNoticesStore) View(userID string, notices []string) error { return r0 } + +type mockConstructorTestingTNewProductNoticesStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewProductNoticesStore creates a new instance of ProductNoticesStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewProductNoticesStore(t mockConstructorTestingTNewProductNoticesStore) *ProductNoticesStore { + mock := &ProductNoticesStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ReactionStore.go b/server/channels/store/storetest/mocks/ReactionStore.go index 1eb9a92d24..d1d7247921 100644 --- a/server/channels/store/storetest/mocks/ReactionStore.go +++ b/server/channels/store/storetest/mocks/ReactionStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *ReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, e ret := _m.Called(postIds) var r0 []*model.Reaction + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Reaction, error)); ok { + return rf(postIds) + } if rf, ok := ret.Get(0).(func([]string) []*model.Reaction); ok { r0 = rf(postIds) } else { @@ -27,7 +31,6 @@ func (_m *ReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, e } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(postIds) } else { @@ -42,6 +45,10 @@ func (_m *ReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, erro ret := _m.Called(reaction) var r0 *model.Reaction + var r1 error + if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, error)); ok { + return rf(reaction) + } if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok { r0 = rf(reaction) } else { @@ -50,7 +57,6 @@ func (_m *ReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, erro } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok { r1 = rf(reaction) } else { @@ -79,13 +85,16 @@ func (_m *ReactionStore) DeleteOrphanedRows(limit int) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -100,6 +109,10 @@ func (_m *ReactionStore) GetForPost(postID string, allowFromCache bool) ([]*mode ret := _m.Called(postID, allowFromCache) var r0 []*model.Reaction + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) ([]*model.Reaction, error)); ok { + return rf(postID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) []*model.Reaction); ok { r0 = rf(postID, allowFromCache) } else { @@ -108,7 +121,6 @@ func (_m *ReactionStore) GetForPost(postID string, allowFromCache bool) ([]*mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(postID, allowFromCache) } else { @@ -123,6 +135,10 @@ func (_m *ReactionStore) GetForPostSince(postId string, since int64, excludeRemo ret := _m.Called(postId, since, excludeRemoteId, inclDeleted) var r0 []*model.Reaction + var r1 error + if rf, ok := ret.Get(0).(func(string, int64, string, bool) ([]*model.Reaction, error)); ok { + return rf(postId, since, excludeRemoteId, inclDeleted) + } if rf, ok := ret.Get(0).(func(string, int64, string, bool) []*model.Reaction); ok { r0 = rf(postId, since, excludeRemoteId, inclDeleted) } else { @@ -131,7 +147,6 @@ func (_m *ReactionStore) GetForPostSince(postId string, since int64, excludeRemo } } - var r1 error if rf, ok := ret.Get(1).(func(string, int64, string, bool) error); ok { r1 = rf(postId, since, excludeRemoteId, inclDeleted) } else { @@ -146,6 +161,10 @@ func (_m *ReactionStore) GetTopForTeamSince(teamID string, userID string, since ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopReactionList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopReactionList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopReactionList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -154,7 +173,6 @@ func (_m *ReactionStore) GetTopForTeamSince(teamID string, userID string, since } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -169,6 +187,10 @@ func (_m *ReactionStore) GetTopForUserSince(userID string, teamID string, since ret := _m.Called(userID, teamID, since, offset, limit) var r0 *model.TopReactionList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopReactionList, error)); ok { + return rf(userID, teamID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopReactionList); ok { r0 = rf(userID, teamID, since, offset, limit) } else { @@ -177,7 +199,6 @@ func (_m *ReactionStore) GetTopForUserSince(userID string, teamID string, since } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(userID, teamID, since, offset, limit) } else { @@ -192,13 +213,16 @@ func (_m *ReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64 ret := _m.Called(endTime, limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok { + return rf(endTime, limit) + } if rf, ok := ret.Get(0).(func(int64, int64) int64); ok { r0 = rf(endTime, limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64) error); ok { r1 = rf(endTime, limit) } else { @@ -213,6 +237,10 @@ func (_m *ReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error) ret := _m.Called(reaction) var r0 *model.Reaction + var r1 error + if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, error)); ok { + return rf(reaction) + } if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok { r0 = rf(reaction) } else { @@ -221,7 +249,6 @@ func (_m *ReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error) } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok { r1 = rf(reaction) } else { @@ -230,3 +257,18 @@ func (_m *ReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error) return r0, r1 } + +type mockConstructorTestingTNewReactionStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewReactionStore creates a new instance of ReactionStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewReactionStore(t mockConstructorTestingTNewReactionStore) *ReactionStore { + mock := &ReactionStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/RemoteClusterStore.go b/server/channels/store/storetest/mocks/RemoteClusterStore.go index 21fa62469c..8f144e3572 100644 --- a/server/channels/store/storetest/mocks/RemoteClusterStore.go +++ b/server/channels/store/storetest/mocks/RemoteClusterStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *RemoteClusterStore) Delete(remoteClusterId string) (bool, error) { ret := _m.Called(remoteClusterId) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(remoteClusterId) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(remoteClusterId) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(remoteClusterId) } else { @@ -40,6 +43,10 @@ func (_m *RemoteClusterStore) Get(remoteClusterId string) (*model.RemoteCluster, ret := _m.Called(remoteClusterId) var r0 *model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.RemoteCluster, error)); ok { + return rf(remoteClusterId) + } if rf, ok := ret.Get(0).(func(string) *model.RemoteCluster); ok { r0 = rf(remoteClusterId) } else { @@ -48,7 +55,6 @@ func (_m *RemoteClusterStore) Get(remoteClusterId string) (*model.RemoteCluster, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(remoteClusterId) } else { @@ -63,6 +69,10 @@ func (_m *RemoteClusterStore) GetAll(filter model.RemoteClusterQueryFilter) ([]* ret := _m.Called(filter) var r0 []*model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(model.RemoteClusterQueryFilter) ([]*model.RemoteCluster, error)); ok { + return rf(filter) + } if rf, ok := ret.Get(0).(func(model.RemoteClusterQueryFilter) []*model.RemoteCluster); ok { r0 = rf(filter) } else { @@ -71,7 +81,6 @@ func (_m *RemoteClusterStore) GetAll(filter model.RemoteClusterQueryFilter) ([]* } } - var r1 error if rf, ok := ret.Get(1).(func(model.RemoteClusterQueryFilter) error); ok { r1 = rf(filter) } else { @@ -86,6 +95,10 @@ func (_m *RemoteClusterStore) Save(rc *model.RemoteCluster) (*model.RemoteCluste ret := _m.Called(rc) var r0 *model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(*model.RemoteCluster) (*model.RemoteCluster, error)); ok { + return rf(rc) + } if rf, ok := ret.Get(0).(func(*model.RemoteCluster) *model.RemoteCluster); ok { r0 = rf(rc) } else { @@ -94,7 +107,6 @@ func (_m *RemoteClusterStore) Save(rc *model.RemoteCluster) (*model.RemoteCluste } } - var r1 error if rf, ok := ret.Get(1).(func(*model.RemoteCluster) error); ok { r1 = rf(rc) } else { @@ -123,6 +135,10 @@ func (_m *RemoteClusterStore) Update(rc *model.RemoteCluster) (*model.RemoteClus ret := _m.Called(rc) var r0 *model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(*model.RemoteCluster) (*model.RemoteCluster, error)); ok { + return rf(rc) + } if rf, ok := ret.Get(0).(func(*model.RemoteCluster) *model.RemoteCluster); ok { r0 = rf(rc) } else { @@ -131,7 +147,6 @@ func (_m *RemoteClusterStore) Update(rc *model.RemoteCluster) (*model.RemoteClus } } - var r1 error if rf, ok := ret.Get(1).(func(*model.RemoteCluster) error); ok { r1 = rf(rc) } else { @@ -146,6 +161,10 @@ func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string ret := _m.Called(remoteClusterId, topics) var r0 *model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.RemoteCluster, error)); ok { + return rf(remoteClusterId, topics) + } if rf, ok := ret.Get(0).(func(string, string) *model.RemoteCluster); ok { r0 = rf(remoteClusterId, topics) } else { @@ -154,7 +173,6 @@ func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(remoteClusterId, topics) } else { @@ -163,3 +181,18 @@ func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string return r0, r1 } + +type mockConstructorTestingTNewRemoteClusterStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewRemoteClusterStore creates a new instance of RemoteClusterStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRemoteClusterStore(t mockConstructorTestingTNewRemoteClusterStore) *RemoteClusterStore { + mock := &RemoteClusterStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/RetentionPolicyStore.go b/server/channels/store/storetest/mocks/RetentionPolicyStore.go index b94ce2a6df..3af57249ff 100644 --- a/server/channels/store/storetest/mocks/RetentionPolicyStore.go +++ b/server/channels/store/storetest/mocks/RetentionPolicyStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -61,13 +61,16 @@ func (_m *RetentionPolicyStore) DeleteOrphanedRows(limit int) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -82,6 +85,10 @@ func (_m *RetentionPolicyStore) Get(id string) (*model.RetentionPolicyWithTeamAn ret := _m.Called(id) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.RetentionPolicyWithTeamAndChannelCounts, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(id) } else { @@ -90,7 +97,6 @@ func (_m *RetentionPolicyStore) Get(id string) (*model.RetentionPolicyWithTeamAn } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -105,6 +111,10 @@ func (_m *RetentionPolicyStore) GetAll(offset int, limit int) ([]*model.Retentio ret := _m.Called(offset, limit) var r0 []*model.RetentionPolicyWithTeamAndChannelCounts + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.RetentionPolicyWithTeamAndChannelCounts, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(offset, limit) } else { @@ -113,7 +123,6 @@ func (_m *RetentionPolicyStore) GetAll(offset int, limit int) ([]*model.Retentio } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -128,13 +137,16 @@ func (_m *RetentionPolicyStore) GetChannelPoliciesCountForUser(userID string) (i ret := _m.Called(userID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(userID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -149,6 +161,10 @@ func (_m *RetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset ret := _m.Called(userID, offset, limit) var r0 []*model.RetentionPolicyForChannel + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.RetentionPolicyForChannel, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.RetentionPolicyForChannel); ok { r0 = rf(userID, offset, limit) } else { @@ -157,7 +173,6 @@ func (_m *RetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -172,6 +187,10 @@ func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit i ret := _m.Called(policyId, offset, limit) var r0 model.ChannelListWithTeamData + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelListWithTeamData, error)); ok { + return rf(policyId, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelListWithTeamData); ok { r0 = rf(policyId, offset, limit) } else { @@ -180,7 +199,6 @@ func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit i } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(policyId, offset, limit) } else { @@ -195,13 +213,16 @@ func (_m *RetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) ret := _m.Called(policyId) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(policyId) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(policyId) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(policyId) } else { @@ -216,13 +237,16 @@ func (_m *RetentionPolicyStore) GetCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -237,13 +261,16 @@ func (_m *RetentionPolicyStore) GetTeamPoliciesCountForUser(userID string) (int6 ret := _m.Called(userID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(userID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -258,6 +285,10 @@ func (_m *RetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset int ret := _m.Called(userID, offset, limit) var r0 []*model.RetentionPolicyForTeam + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.RetentionPolicyForTeam, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.RetentionPolicyForTeam); ok { r0 = rf(userID, offset, limit) } else { @@ -266,7 +297,6 @@ func (_m *RetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset int } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -281,6 +311,10 @@ func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ret := _m.Called(policyId, offset, limit) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Team, error)); ok { + return rf(policyId, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Team); ok { r0 = rf(policyId, offset, limit) } else { @@ -289,7 +323,6 @@ func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int) } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(policyId, offset, limit) } else { @@ -304,13 +337,16 @@ func (_m *RetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) { ret := _m.Called(policyId) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(policyId) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(policyId) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(policyId) } else { @@ -325,6 +361,10 @@ func (_m *RetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndCha ret := _m.Called(patch) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 error + if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error)); ok { + return rf(patch) + } if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(patch) } else { @@ -333,7 +373,6 @@ func (_m *RetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndCha } } - var r1 error if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok { r1 = rf(patch) } else { @@ -376,6 +415,10 @@ func (_m *RetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndCha ret := _m.Called(policy) var r0 *model.RetentionPolicyWithTeamAndChannelCounts + var r1 error + if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error)); ok { + return rf(policy) + } if rf, ok := ret.Get(0).(func(*model.RetentionPolicyWithTeamAndChannelIDs) *model.RetentionPolicyWithTeamAndChannelCounts); ok { r0 = rf(policy) } else { @@ -384,7 +427,6 @@ func (_m *RetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndCha } } - var r1 error if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok { r1 = rf(policy) } else { @@ -393,3 +435,18 @@ func (_m *RetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndCha return r0, r1 } + +type mockConstructorTestingTNewRetentionPolicyStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewRetentionPolicyStore creates a new instance of RetentionPolicyStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRetentionPolicyStore(t mockConstructorTestingTNewRetentionPolicyStore) *RetentionPolicyStore { + mock := &RetentionPolicyStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/RoleStore.go b/server/channels/store/storetest/mocks/RoleStore.go index 08709d628f..29a7d1b303 100644 --- a/server/channels/store/storetest/mocks/RoleStore.go +++ b/server/channels/store/storetest/mocks/RoleStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -21,6 +21,10 @@ func (_m *RoleStore) AllChannelSchemeRoles() ([]*model.Role, error) { ret := _m.Called() var r0 []*model.Role + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Role, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Role); ok { r0 = rf() } else { @@ -29,7 +33,6 @@ func (_m *RoleStore) AllChannelSchemeRoles() ([]*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -44,6 +47,10 @@ func (_m *RoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[str ret := _m.Called(roleNames) var r0 map[string]*model.RolePermissions + var r1 error + if rf, ok := ret.Get(0).(func([]string) (map[string]*model.RolePermissions, error)); ok { + return rf(roleNames) + } if rf, ok := ret.Get(0).(func([]string) map[string]*model.RolePermissions); ok { r0 = rf(roleNames) } else { @@ -52,7 +59,6 @@ func (_m *RoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[str } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(roleNames) } else { @@ -67,6 +73,10 @@ func (_m *RoleStore) ChannelRolesUnderTeamRole(roleName string) ([]*model.Role, ret := _m.Called(roleName) var r0 []*model.Role + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Role, error)); ok { + return rf(roleName) + } if rf, ok := ret.Get(0).(func(string) []*model.Role); ok { r0 = rf(roleName) } else { @@ -75,7 +85,6 @@ func (_m *RoleStore) ChannelRolesUnderTeamRole(roleName string) ([]*model.Role, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(roleName) } else { @@ -90,6 +99,10 @@ func (_m *RoleStore) Delete(roleID string) (*model.Role, error) { ret := _m.Called(roleID) var r0 *model.Role + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Role, error)); ok { + return rf(roleID) + } if rf, ok := ret.Get(0).(func(string) *model.Role); ok { r0 = rf(roleID) } else { @@ -98,7 +111,6 @@ func (_m *RoleStore) Delete(roleID string) (*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(roleID) } else { @@ -113,6 +125,10 @@ func (_m *RoleStore) Get(roleID string) (*model.Role, error) { ret := _m.Called(roleID) var r0 *model.Role + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Role, error)); ok { + return rf(roleID) + } if rf, ok := ret.Get(0).(func(string) *model.Role); ok { r0 = rf(roleID) } else { @@ -121,7 +137,6 @@ func (_m *RoleStore) Get(roleID string) (*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(roleID) } else { @@ -136,6 +151,10 @@ func (_m *RoleStore) GetAll() ([]*model.Role, error) { ret := _m.Called() var r0 []*model.Role + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Role, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Role); ok { r0 = rf() } else { @@ -144,7 +163,6 @@ func (_m *RoleStore) GetAll() ([]*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -159,6 +177,10 @@ func (_m *RoleStore) GetByName(ctx context.Context, name string) (*model.Role, e ret := _m.Called(ctx, name) var r0 *model.Role + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*model.Role, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) *model.Role); ok { r0 = rf(ctx, name) } else { @@ -167,7 +189,6 @@ func (_m *RoleStore) GetByName(ctx context.Context, name string) (*model.Role, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -182,6 +203,10 @@ func (_m *RoleStore) GetByNames(names []string) ([]*model.Role, error) { ret := _m.Called(names) var r0 []*model.Role + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Role, error)); ok { + return rf(names) + } if rf, ok := ret.Get(0).(func([]string) []*model.Role); ok { r0 = rf(names) } else { @@ -190,7 +215,6 @@ func (_m *RoleStore) GetByNames(names []string) ([]*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(names) } else { @@ -219,6 +243,10 @@ func (_m *RoleStore) Save(role *model.Role) (*model.Role, error) { ret := _m.Called(role) var r0 *model.Role + var r1 error + if rf, ok := ret.Get(0).(func(*model.Role) (*model.Role, error)); ok { + return rf(role) + } if rf, ok := ret.Get(0).(func(*model.Role) *model.Role); ok { r0 = rf(role) } else { @@ -227,7 +255,6 @@ func (_m *RoleStore) Save(role *model.Role) (*model.Role, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Role) error); ok { r1 = rf(role) } else { @@ -236,3 +263,18 @@ func (_m *RoleStore) Save(role *model.Role) (*model.Role, error) { return r0, r1 } + +type mockConstructorTestingTNewRoleStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewRoleStore creates a new instance of RoleStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRoleStore(t mockConstructorTestingTNewRoleStore) *RoleStore { + mock := &RoleStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/SchemeStore.go b/server/channels/store/storetest/mocks/SchemeStore.go index 031ba57d19..4b20742404 100644 --- a/server/channels/store/storetest/mocks/SchemeStore.go +++ b/server/channels/store/storetest/mocks/SchemeStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *SchemeStore) CountByScope(scope string) (int64, error) { ret := _m.Called(scope) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(scope) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(scope) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(scope) } else { @@ -40,13 +43,16 @@ func (_m *SchemeStore) CountWithoutPermission(scope string, permissionID string, ret := _m.Called(scope, permissionID, roleScope, roleType) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.RoleScope, model.RoleType) (int64, error)); ok { + return rf(scope, permissionID, roleScope, roleType) + } if rf, ok := ret.Get(0).(func(string, string, model.RoleScope, model.RoleType) int64); ok { r0 = rf(scope, permissionID, roleScope, roleType) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.RoleScope, model.RoleType) error); ok { r1 = rf(scope, permissionID, roleScope, roleType) } else { @@ -61,6 +67,10 @@ func (_m *SchemeStore) Delete(schemeID string) (*model.Scheme, error) { ret := _m.Called(schemeID) var r0 *model.Scheme + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Scheme, error)); ok { + return rf(schemeID) + } if rf, ok := ret.Get(0).(func(string) *model.Scheme); ok { r0 = rf(schemeID) } else { @@ -69,7 +79,6 @@ func (_m *SchemeStore) Delete(schemeID string) (*model.Scheme, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(schemeID) } else { @@ -84,6 +93,10 @@ func (_m *SchemeStore) Get(schemeID string) (*model.Scheme, error) { ret := _m.Called(schemeID) var r0 *model.Scheme + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Scheme, error)); ok { + return rf(schemeID) + } if rf, ok := ret.Get(0).(func(string) *model.Scheme); ok { r0 = rf(schemeID) } else { @@ -92,7 +105,6 @@ func (_m *SchemeStore) Get(schemeID string) (*model.Scheme, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(schemeID) } else { @@ -107,6 +119,10 @@ func (_m *SchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model ret := _m.Called(scope, offset, limit) var r0 []*model.Scheme + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Scheme, error)); ok { + return rf(scope, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Scheme); ok { r0 = rf(scope, offset, limit) } else { @@ -115,7 +131,6 @@ func (_m *SchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(scope, offset, limit) } else { @@ -130,6 +145,10 @@ func (_m *SchemeStore) GetByName(schemeName string) (*model.Scheme, error) { ret := _m.Called(schemeName) var r0 *model.Scheme + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Scheme, error)); ok { + return rf(schemeName) + } if rf, ok := ret.Get(0).(func(string) *model.Scheme); ok { r0 = rf(schemeName) } else { @@ -138,7 +157,6 @@ func (_m *SchemeStore) GetByName(schemeName string) (*model.Scheme, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(schemeName) } else { @@ -167,6 +185,10 @@ func (_m *SchemeStore) Save(scheme *model.Scheme) (*model.Scheme, error) { ret := _m.Called(scheme) var r0 *model.Scheme + var r1 error + if rf, ok := ret.Get(0).(func(*model.Scheme) (*model.Scheme, error)); ok { + return rf(scheme) + } if rf, ok := ret.Get(0).(func(*model.Scheme) *model.Scheme); ok { r0 = rf(scheme) } else { @@ -175,7 +197,6 @@ func (_m *SchemeStore) Save(scheme *model.Scheme) (*model.Scheme, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Scheme) error); ok { r1 = rf(scheme) } else { @@ -184,3 +205,18 @@ func (_m *SchemeStore) Save(scheme *model.Scheme) (*model.Scheme, error) { return r0, r1 } + +type mockConstructorTestingTNewSchemeStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewSchemeStore creates a new instance of SchemeStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSchemeStore(t mockConstructorTestingTNewSchemeStore) *SchemeStore { + mock := &SchemeStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/SessionStore.go b/server/channels/store/storetest/mocks/SessionStore.go index eea72a1d4e..034313ba8d 100644 --- a/server/channels/store/storetest/mocks/SessionStore.go +++ b/server/channels/store/storetest/mocks/SessionStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -21,13 +21,16 @@ func (_m *SessionStore) AnalyticsSessionCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -56,6 +59,10 @@ func (_m *SessionStore) Get(ctx context.Context, sessionIDOrToken string) (*mode ret := _m.Called(ctx, sessionIDOrToken) var r0 *model.Session + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*model.Session, error)); ok { + return rf(ctx, sessionIDOrToken) + } if rf, ok := ret.Get(0).(func(context.Context, string) *model.Session); ok { r0 = rf(ctx, sessionIDOrToken) } else { @@ -64,7 +71,6 @@ func (_m *SessionStore) Get(ctx context.Context, sessionIDOrToken string) (*mode } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, sessionIDOrToken) } else { @@ -79,6 +85,10 @@ func (_m *SessionStore) GetSessions(userID string) ([]*model.Session, error) { ret := _m.Called(userID) var r0 []*model.Session + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Session, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Session); ok { r0 = rf(userID) } else { @@ -87,7 +97,6 @@ func (_m *SessionStore) GetSessions(userID string) ([]*model.Session, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -102,6 +111,10 @@ func (_m *SessionStore) GetSessionsExpired(thresholdMillis int64, mobileOnly boo ret := _m.Called(thresholdMillis, mobileOnly, unnotifiedOnly) var r0 []*model.Session + var r1 error + if rf, ok := ret.Get(0).(func(int64, bool, bool) ([]*model.Session, error)); ok { + return rf(thresholdMillis, mobileOnly, unnotifiedOnly) + } if rf, ok := ret.Get(0).(func(int64, bool, bool) []*model.Session); ok { r0 = rf(thresholdMillis, mobileOnly, unnotifiedOnly) } else { @@ -110,7 +123,6 @@ func (_m *SessionStore) GetSessionsExpired(thresholdMillis int64, mobileOnly boo } } - var r1 error if rf, ok := ret.Get(1).(func(int64, bool, bool) error); ok { r1 = rf(thresholdMillis, mobileOnly, unnotifiedOnly) } else { @@ -125,6 +137,10 @@ func (_m *SessionStore) GetSessionsWithActiveDeviceIds(userID string) ([]*model. ret := _m.Called(userID) var r0 []*model.Session + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Session, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Session); ok { r0 = rf(userID) } else { @@ -133,7 +149,6 @@ func (_m *SessionStore) GetSessionsWithActiveDeviceIds(userID string) ([]*model. } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -190,6 +205,10 @@ func (_m *SessionStore) Save(session *model.Session) (*model.Session, error) { ret := _m.Called(session) var r0 *model.Session + var r1 error + if rf, ok := ret.Get(0).(func(*model.Session) (*model.Session, error)); ok { + return rf(session) + } if rf, ok := ret.Get(0).(func(*model.Session) *model.Session); ok { r0 = rf(session) } else { @@ -198,7 +217,6 @@ func (_m *SessionStore) Save(session *model.Session) (*model.Session, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Session) error); ok { r1 = rf(session) } else { @@ -213,13 +231,16 @@ func (_m *SessionStore) UpdateDeviceId(id string, deviceID string, expiresAt int ret := _m.Called(id, deviceID, expiresAt) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64) (string, error)); ok { + return rf(id, deviceID, expiresAt) + } if rf, ok := ret.Get(0).(func(string, string, int64) string); ok { r0 = rf(id, deviceID, expiresAt) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64) error); ok { r1 = rf(id, deviceID, expiresAt) } else { @@ -290,13 +311,16 @@ func (_m *SessionStore) UpdateRoles(userID string, roles string) (string, error) ret := _m.Called(userID, roles) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { + return rf(userID, roles) + } if rf, ok := ret.Get(0).(func(string, string) string); ok { r0 = rf(userID, roles) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, roles) } else { @@ -305,3 +329,18 @@ func (_m *SessionStore) UpdateRoles(userID string, roles string) (string, error) return r0, r1 } + +type mockConstructorTestingTNewSessionStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewSessionStore creates a new instance of SessionStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSessionStore(t mockConstructorTestingTNewSessionStore) *SessionStore { + mock := &SessionStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/SharedChannelStore.go b/server/channels/store/storetest/mocks/SharedChannelStore.go index d622fa14e3..33d2599b47 100644 --- a/server/channels/store/storetest/mocks/SharedChannelStore.go +++ b/server/channels/store/storetest/mocks/SharedChannelStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *SharedChannelStore) Delete(channelId string) (bool, error) { ret := _m.Called(channelId) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(channelId) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(channelId) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelId) } else { @@ -40,13 +43,16 @@ func (_m *SharedChannelStore) DeleteRemote(remoteId string) (bool, error) { ret := _m.Called(remoteId) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(remoteId) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(remoteId) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(remoteId) } else { @@ -61,6 +67,10 @@ func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error ret := _m.Called(channelId) var r0 *model.SharedChannel + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.SharedChannel, error)); ok { + return rf(channelId) + } if rf, ok := ret.Get(0).(func(string) *model.SharedChannel); ok { r0 = rf(channelId) } else { @@ -69,7 +79,6 @@ func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelId) } else { @@ -84,6 +93,10 @@ func (_m *SharedChannelStore) GetAll(offset int, limit int, opts model.SharedCha ret := _m.Called(offset, limit, opts) var r0 []*model.SharedChannel + var r1 error + if rf, ok := ret.Get(0).(func(int, int, model.SharedChannelFilterOpts) ([]*model.SharedChannel, error)); ok { + return rf(offset, limit, opts) + } if rf, ok := ret.Get(0).(func(int, int, model.SharedChannelFilterOpts) []*model.SharedChannel); ok { r0 = rf(offset, limit, opts) } else { @@ -92,7 +105,6 @@ func (_m *SharedChannelStore) GetAll(offset int, limit int, opts model.SharedCha } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, model.SharedChannelFilterOpts) error); ok { r1 = rf(offset, limit, opts) } else { @@ -107,13 +119,16 @@ func (_m *SharedChannelStore) GetAllCount(opts model.SharedChannelFilterOpts) (i ret := _m.Called(opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(model.SharedChannelFilterOpts) (int64, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(model.SharedChannelFilterOpts) int64); ok { r0 = rf(opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(model.SharedChannelFilterOpts) error); ok { r1 = rf(opts) } else { @@ -128,6 +143,10 @@ func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*mo ret := _m.Called(fileId, remoteId) var r0 *model.SharedChannelAttachment + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.SharedChannelAttachment, error)); ok { + return rf(fileId, remoteId) + } if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelAttachment); ok { r0 = rf(fileId, remoteId) } else { @@ -136,7 +155,6 @@ func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(fileId, remoteId) } else { @@ -151,6 +169,10 @@ func (_m *SharedChannelStore) GetRemote(id string) (*model.SharedChannelRemote, ret := _m.Called(id) var r0 *model.SharedChannelRemote + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.SharedChannelRemote, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.SharedChannelRemote); ok { r0 = rf(id) } else { @@ -159,7 +181,6 @@ func (_m *SharedChannelStore) GetRemote(id string) (*model.SharedChannelRemote, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -174,6 +195,10 @@ func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string) ret := _m.Called(channelId, remoteId) var r0 *model.SharedChannelRemote + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.SharedChannelRemote, error)); ok { + return rf(channelId, remoteId) + } if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelRemote); ok { r0 = rf(channelId, remoteId) } else { @@ -182,7 +207,6 @@ func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string) } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(channelId, remoteId) } else { @@ -197,6 +221,10 @@ func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) ( ret := _m.Called(remoteId, userId) var r0 *model.RemoteCluster + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.RemoteCluster, error)); ok { + return rf(remoteId, userId) + } if rf, ok := ret.Get(0).(func(string, string) *model.RemoteCluster); ok { r0 = rf(remoteId, userId) } else { @@ -205,7 +233,6 @@ func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) ( } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(remoteId, userId) } else { @@ -220,6 +247,10 @@ func (_m *SharedChannelStore) GetRemotes(opts model.SharedChannelRemoteFilterOpt ret := _m.Called(opts) var r0 []*model.SharedChannelRemote + var r1 error + if rf, ok := ret.Get(0).(func(model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(model.SharedChannelRemoteFilterOpts) []*model.SharedChannelRemote); ok { r0 = rf(opts) } else { @@ -228,7 +259,6 @@ func (_m *SharedChannelStore) GetRemotes(opts model.SharedChannelRemoteFilterOpt } } - var r1 error if rf, ok := ret.Get(1).(func(model.SharedChannelRemoteFilterOpts) error); ok { r1 = rf(opts) } else { @@ -243,6 +273,10 @@ func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.Share ret := _m.Called(channelId) var r0 []*model.SharedChannelRemoteStatus + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.SharedChannelRemoteStatus, error)); ok { + return rf(channelId) + } if rf, ok := ret.Get(0).(func(string) []*model.SharedChannelRemoteStatus); ok { r0 = rf(channelId) } else { @@ -251,7 +285,6 @@ func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.Share } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelId) } else { @@ -266,6 +299,10 @@ func (_m *SharedChannelStore) GetSingleUser(userID string, channelID string, rem ret := _m.Called(userID, channelID, remoteID) var r0 *model.SharedChannelUser + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string) (*model.SharedChannelUser, error)); ok { + return rf(userID, channelID, remoteID) + } if rf, ok := ret.Get(0).(func(string, string, string) *model.SharedChannelUser); ok { r0 = rf(userID, channelID, remoteID) } else { @@ -274,7 +311,6 @@ func (_m *SharedChannelStore) GetSingleUser(userID string, channelID string, rem } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string) error); ok { r1 = rf(userID, channelID, remoteID) } else { @@ -289,6 +325,10 @@ func (_m *SharedChannelStore) GetUsersForSync(filter model.GetUsersForSyncFilter ret := _m.Called(filter) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(model.GetUsersForSyncFilter) ([]*model.User, error)); ok { + return rf(filter) + } if rf, ok := ret.Get(0).(func(model.GetUsersForSyncFilter) []*model.User); ok { r0 = rf(filter) } else { @@ -297,7 +337,6 @@ func (_m *SharedChannelStore) GetUsersForSync(filter model.GetUsersForSyncFilter } } - var r1 error if rf, ok := ret.Get(1).(func(model.GetUsersForSyncFilter) error); ok { r1 = rf(filter) } else { @@ -312,6 +351,10 @@ func (_m *SharedChannelStore) GetUsersForUser(userID string) ([]*model.SharedCha ret := _m.Called(userID) var r0 []*model.SharedChannelUser + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.SharedChannelUser, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.SharedChannelUser); ok { r0 = rf(userID) } else { @@ -320,7 +363,6 @@ func (_m *SharedChannelStore) GetUsersForUser(userID string) ([]*model.SharedCha } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -335,13 +377,16 @@ func (_m *SharedChannelStore) HasChannel(channelID string) (bool, error) { ret := _m.Called(channelID) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(channelID) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -356,13 +401,16 @@ func (_m *SharedChannelStore) HasRemote(channelID string, remoteId string) (bool ret := _m.Called(channelID, remoteId) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok { + return rf(channelID, remoteId) + } if rf, ok := ret.Get(0).(func(string, string) bool); ok { r0 = rf(channelID, remoteId) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(channelID, remoteId) } else { @@ -377,6 +425,10 @@ func (_m *SharedChannelStore) Save(sc *model.SharedChannel) (*model.SharedChanne ret := _m.Called(sc) var r0 *model.SharedChannel + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannel) (*model.SharedChannel, error)); ok { + return rf(sc) + } if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok { r0 = rf(sc) } else { @@ -385,7 +437,6 @@ func (_m *SharedChannelStore) Save(sc *model.SharedChannel) (*model.SharedChanne } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok { r1 = rf(sc) } else { @@ -400,6 +451,10 @@ func (_m *SharedChannelStore) SaveAttachment(remote *model.SharedChannelAttachme ret := _m.Called(remote) var r0 *model.SharedChannelAttachment + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) (*model.SharedChannelAttachment, error)); ok { + return rf(remote) + } if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) *model.SharedChannelAttachment); ok { r0 = rf(remote) } else { @@ -408,7 +463,6 @@ func (_m *SharedChannelStore) SaveAttachment(remote *model.SharedChannelAttachme } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok { r1 = rf(remote) } else { @@ -423,6 +477,10 @@ func (_m *SharedChannelStore) SaveRemote(remote *model.SharedChannelRemote) (*mo ret := _m.Called(remote) var r0 *model.SharedChannelRemote + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) (*model.SharedChannelRemote, error)); ok { + return rf(remote) + } if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) *model.SharedChannelRemote); ok { r0 = rf(remote) } else { @@ -431,7 +489,6 @@ func (_m *SharedChannelStore) SaveRemote(remote *model.SharedChannelRemote) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok { r1 = rf(remote) } else { @@ -446,6 +503,10 @@ func (_m *SharedChannelStore) SaveUser(remote *model.SharedChannelUser) (*model. ret := _m.Called(remote) var r0 *model.SharedChannelUser + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannelUser) (*model.SharedChannelUser, error)); ok { + return rf(remote) + } if rf, ok := ret.Get(0).(func(*model.SharedChannelUser) *model.SharedChannelUser); ok { r0 = rf(remote) } else { @@ -454,7 +515,6 @@ func (_m *SharedChannelStore) SaveUser(remote *model.SharedChannelUser) (*model. } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannelUser) error); ok { r1 = rf(remote) } else { @@ -469,6 +529,10 @@ func (_m *SharedChannelStore) Update(sc *model.SharedChannel) (*model.SharedChan ret := _m.Called(sc) var r0 *model.SharedChannel + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannel) (*model.SharedChannel, error)); ok { + return rf(sc) + } if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok { r0 = rf(sc) } else { @@ -477,7 +541,6 @@ func (_m *SharedChannelStore) Update(sc *model.SharedChannel) (*model.SharedChan } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok { r1 = rf(sc) } else { @@ -506,6 +569,10 @@ func (_m *SharedChannelStore) UpdateRemote(remote *model.SharedChannelRemote) (* ret := _m.Called(remote) var r0 *model.SharedChannelRemote + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) (*model.SharedChannelRemote, error)); ok { + return rf(remote) + } if rf, ok := ret.Get(0).(func(*model.SharedChannelRemote) *model.SharedChannelRemote); ok { r0 = rf(remote) } else { @@ -514,7 +581,6 @@ func (_m *SharedChannelStore) UpdateRemote(remote *model.SharedChannelRemote) (* } } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok { r1 = rf(remote) } else { @@ -557,13 +623,16 @@ func (_m *SharedChannelStore) UpsertAttachment(remote *model.SharedChannelAttach ret := _m.Called(remote) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) (string, error)); ok { + return rf(remote) + } if rf, ok := ret.Get(0).(func(*model.SharedChannelAttachment) string); ok { r0 = rf(remote) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok { r1 = rf(remote) } else { @@ -572,3 +641,18 @@ func (_m *SharedChannelStore) UpsertAttachment(remote *model.SharedChannelAttach return r0, r1 } + +type mockConstructorTestingTNewSharedChannelStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewSharedChannelStore creates a new instance of SharedChannelStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSharedChannelStore(t mockConstructorTestingTNewSharedChannelStore) *SharedChannelStore { + mock := &SharedChannelStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/StatusStore.go b/server/channels/store/storetest/mocks/StatusStore.go index 56858579b7..9959fa23cf 100644 --- a/server/channels/store/storetest/mocks/StatusStore.go +++ b/server/channels/store/storetest/mocks/StatusStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *StatusStore) Get(userID string) (*model.Status, error) { ret := _m.Called(userID) var r0 *model.Status + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Status, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.Status); ok { r0 = rf(userID) } else { @@ -27,7 +31,6 @@ func (_m *StatusStore) Get(userID string) (*model.Status, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -42,6 +45,10 @@ func (_m *StatusStore) GetByIds(userIds []string) ([]*model.Status, error) { ret := _m.Called(userIds) var r0 []*model.Status + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Status, error)); ok { + return rf(userIds) + } if rf, ok := ret.Get(0).(func([]string) []*model.Status); ok { r0 = rf(userIds) } else { @@ -50,7 +57,6 @@ func (_m *StatusStore) GetByIds(userIds []string) ([]*model.Status, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(userIds) } else { @@ -65,13 +71,16 @@ func (_m *StatusStore) GetTotalActiveUsersCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -114,6 +123,10 @@ func (_m *StatusStore) UpdateExpiredDNDStatuses() ([]*model.Status, error) { ret := _m.Called() var r0 []*model.Status + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Status, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Status); ok { r0 = rf() } else { @@ -122,7 +135,6 @@ func (_m *StatusStore) UpdateExpiredDNDStatuses() ([]*model.Status, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -145,3 +157,18 @@ func (_m *StatusStore) UpdateLastActivityAt(userID string, lastActivityAt int64) return r0 } + +type mockConstructorTestingTNewStatusStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewStatusStore creates a new instance of StatusStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStatusStore(t mockConstructorTestingTNewStatusStore) *StatusStore { + mock := &StatusStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/Store.go b/server/channels/store/storetest/mocks/Store.go index 54f92e3cec..c41ca9d1a9 100644 --- a/server/channels/store/storetest/mocks/Store.go +++ b/server/channels/store/storetest/mocks/Store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -245,6 +245,10 @@ func (_m *Store) GetAppliedMigrations() ([]model.AppliedMigration, error) { ret := _m.Called() var r0 []model.AppliedMigration + var r1 error + if rf, ok := ret.Get(0).(func() ([]model.AppliedMigration, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []model.AppliedMigration); ok { r0 = rf() } else { @@ -253,7 +257,6 @@ func (_m *Store) GetAppliedMigrations() ([]model.AppliedMigration, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -268,13 +271,16 @@ func (_m *Store) GetDBSchemaVersion() (int, error) { ret := _m.Called() var r0 int + var r1 error + if rf, ok := ret.Get(0).(func() (int, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -289,13 +295,16 @@ func (_m *Store) GetDbVersion(numerical bool) (string, error) { ret := _m.Called(numerical) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(bool) (string, error)); ok { + return rf(numerical) + } if rf, ok := ret.Get(0).(func(bool) string); ok { r0 = rf(numerical) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(bool) error); ok { r1 = rf(numerical) } else { @@ -943,3 +952,18 @@ func (_m *Store) Webhook() store.WebhookStore { return r0 } + +type mockConstructorTestingTNewStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStore(t mockConstructorTestingTNewStore) *Store { + mock := &Store{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/SystemStore.go b/server/channels/store/storetest/mocks/SystemStore.go index 0c8ecb6436..d84a3ad0ee 100644 --- a/server/channels/store/storetest/mocks/SystemStore.go +++ b/server/channels/store/storetest/mocks/SystemStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *SystemStore) Get() (model.StringMap, error) { ret := _m.Called() var r0 model.StringMap + var r1 error + if rf, ok := ret.Get(0).(func() (model.StringMap, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() model.StringMap); ok { r0 = rf() } else { @@ -27,7 +31,6 @@ func (_m *SystemStore) Get() (model.StringMap, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -42,6 +45,10 @@ func (_m *SystemStore) GetByName(name string) (*model.System, error) { ret := _m.Called(name) var r0 *model.System + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.System, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.System); ok { r0 = rf(name) } else { @@ -50,7 +57,6 @@ func (_m *SystemStore) GetByName(name string) (*model.System, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -65,6 +71,10 @@ func (_m *SystemStore) InsertIfExists(system *model.System) (*model.System, erro ret := _m.Called(system) var r0 *model.System + var r1 error + if rf, ok := ret.Get(0).(func(*model.System) (*model.System, error)); ok { + return rf(system) + } if rf, ok := ret.Get(0).(func(*model.System) *model.System); ok { r0 = rf(system) } else { @@ -73,7 +83,6 @@ func (_m *SystemStore) InsertIfExists(system *model.System) (*model.System, erro } } - var r1 error if rf, ok := ret.Get(1).(func(*model.System) error); ok { r1 = rf(system) } else { @@ -88,6 +97,10 @@ func (_m *SystemStore) PermanentDeleteByName(name string) (*model.System, error) ret := _m.Called(name) var r0 *model.System + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.System, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.System); ok { r0 = rf(name) } else { @@ -96,7 +109,6 @@ func (_m *SystemStore) PermanentDeleteByName(name string) (*model.System, error) } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -161,3 +173,18 @@ func (_m *SystemStore) Update(system *model.System) error { return r0 } + +type mockConstructorTestingTNewSystemStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewSystemStore creates a new instance of SystemStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSystemStore(t mockConstructorTestingTNewSystemStore) *SystemStore { + mock := &SystemStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/TeamStore.go b/server/channels/store/storetest/mocks/TeamStore.go index 6076693d3f..5cf83f077e 100644 --- a/server/channels/store/storetest/mocks/TeamStore.go +++ b/server/channels/store/storetest/mocks/TeamStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -21,13 +21,16 @@ func (_m *TeamStore) AnalyticsGetTeamCountForScheme(schemeID string) (int64, err ret := _m.Called(schemeID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(schemeID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(schemeID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(schemeID) } else { @@ -42,13 +45,16 @@ func (_m *TeamStore) AnalyticsTeamCount(opts *model.TeamSearch) (int64, error) { ret := _m.Called(opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamSearch) (int64, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(*model.TeamSearch) int64); ok { r0 = rf(opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamSearch) error); ok { r1 = rf(opts) } else { @@ -82,6 +88,10 @@ func (_m *TeamStore) Get(id string) (*model.Team, error) { ret := _m.Called(id) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Team, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(id) } else { @@ -90,7 +100,6 @@ func (_m *TeamStore) Get(id string) (*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -105,13 +114,16 @@ func (_m *TeamStore) GetActiveMemberCount(teamID string, restrictions *model.Vie ret := _m.Called(teamID, restrictions) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) (int64, error)); ok { + return rf(teamID, restrictions) + } if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) int64); ok { r0 = rf(teamID, restrictions) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, restrictions) } else { @@ -126,6 +138,10 @@ func (_m *TeamStore) GetAll() ([]*model.Team, error) { ret := _m.Called() var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Team, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Team); ok { r0 = rf() } else { @@ -134,7 +150,6 @@ func (_m *TeamStore) GetAll() ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -149,6 +164,10 @@ func (_m *TeamStore) GetAllForExportAfter(limit int, afterID string) ([]*model.T ret := _m.Called(limit, afterID) var r0 []*model.TeamForExport + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.TeamForExport, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.TeamForExport); ok { r0 = rf(limit, afterID) } else { @@ -157,7 +176,6 @@ func (_m *TeamStore) GetAllForExportAfter(limit int, afterID string) ([]*model.T } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -172,6 +190,10 @@ func (_m *TeamStore) GetAllPage(offset int, limit int, opts *model.TeamSearch) ( ret := _m.Called(offset, limit, opts) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(int, int, *model.TeamSearch) ([]*model.Team, error)); ok { + return rf(offset, limit, opts) + } if rf, ok := ret.Get(0).(func(int, int, *model.TeamSearch) []*model.Team); ok { r0 = rf(offset, limit, opts) } else { @@ -180,7 +202,6 @@ func (_m *TeamStore) GetAllPage(offset int, limit int, opts *model.TeamSearch) ( } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, *model.TeamSearch) error); ok { r1 = rf(offset, limit, opts) } else { @@ -195,6 +216,10 @@ func (_m *TeamStore) GetAllPrivateTeamListing() ([]*model.Team, error) { ret := _m.Called() var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Team, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Team); ok { r0 = rf() } else { @@ -203,7 +228,6 @@ func (_m *TeamStore) GetAllPrivateTeamListing() ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -218,6 +242,10 @@ func (_m *TeamStore) GetAllTeamListing() ([]*model.Team, error) { ret := _m.Called() var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Team, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Team); ok { r0 = rf() } else { @@ -226,7 +254,6 @@ func (_m *TeamStore) GetAllTeamListing() ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -241,6 +268,10 @@ func (_m *TeamStore) GetByEmptyInviteID() ([]*model.Team, error) { ret := _m.Called() var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.Team, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.Team); ok { r0 = rf() } else { @@ -249,7 +280,6 @@ func (_m *TeamStore) GetByEmptyInviteID() ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -264,6 +294,10 @@ func (_m *TeamStore) GetByInviteId(inviteID string) (*model.Team, error) { ret := _m.Called(inviteID) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Team, error)); ok { + return rf(inviteID) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(inviteID) } else { @@ -272,7 +306,6 @@ func (_m *TeamStore) GetByInviteId(inviteID string) (*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(inviteID) } else { @@ -287,6 +320,10 @@ func (_m *TeamStore) GetByName(name string) (*model.Team, error) { ret := _m.Called(name) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Team, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) *model.Team); ok { r0 = rf(name) } else { @@ -295,7 +332,6 @@ func (_m *TeamStore) GetByName(name string) (*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -310,6 +346,10 @@ func (_m *TeamStore) GetByNames(name []string) ([]*model.Team, error) { ret := _m.Called(name) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Team, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func([]string) []*model.Team); ok { r0 = rf(name) } else { @@ -318,7 +358,6 @@ func (_m *TeamStore) GetByNames(name []string) ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(name) } else { @@ -333,6 +372,10 @@ func (_m *TeamStore) GetChannelUnreadsForAllTeams(excludeTeamID string, userID s ret := _m.Called(excludeTeamID, userID) var r0 []*model.ChannelUnread + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.ChannelUnread, error)); ok { + return rf(excludeTeamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.ChannelUnread); ok { r0 = rf(excludeTeamID, userID) } else { @@ -341,7 +384,6 @@ func (_m *TeamStore) GetChannelUnreadsForAllTeams(excludeTeamID string, userID s } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(excludeTeamID, userID) } else { @@ -356,6 +398,10 @@ func (_m *TeamStore) GetChannelUnreadsForTeam(teamID string, userID string) ([]* ret := _m.Called(teamID, userID) var r0 []*model.ChannelUnread + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.ChannelUnread, error)); ok { + return rf(teamID, userID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.ChannelUnread); ok { r0 = rf(teamID, userID) } else { @@ -364,7 +410,6 @@ func (_m *TeamStore) GetChannelUnreadsForTeam(teamID string, userID string) ([]* } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(teamID, userID) } else { @@ -379,6 +424,10 @@ func (_m *TeamStore) GetCommonTeamIDsForTwoUsers(userID string, otherUserID stri ret := _m.Called(userID, otherUserID) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]string, error)); ok { + return rf(userID, otherUserID) + } if rf, ok := ret.Get(0).(func(string, string) []string); ok { r0 = rf(userID, otherUserID) } else { @@ -387,7 +436,6 @@ func (_m *TeamStore) GetCommonTeamIDsForTwoUsers(userID string, otherUserID stri } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, otherUserID) } else { @@ -402,6 +450,10 @@ func (_m *TeamStore) GetMany(ids []string) ([]*model.Team, error) { ret := _m.Called(ids) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.Team, error)); ok { + return rf(ids) + } if rf, ok := ret.Get(0).(func([]string) []*model.Team); ok { r0 = rf(ids) } else { @@ -410,7 +462,6 @@ func (_m *TeamStore) GetMany(ids []string) ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(ids) } else { @@ -425,6 +476,10 @@ func (_m *TeamStore) GetMember(ctx context.Context, teamID string, userID string ret := _m.Called(ctx, teamID, userID) var r0 *model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*model.TeamMember, error)); ok { + return rf(ctx, teamID, userID) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.TeamMember); ok { r0 = rf(ctx, teamID, userID) } else { @@ -433,7 +488,6 @@ func (_m *TeamStore) GetMember(ctx context.Context, teamID string, userID string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, teamID, userID) } else { @@ -448,6 +502,10 @@ func (_m *TeamStore) GetMembers(teamID string, offset int, limit int, teamMember ret := _m.Called(teamID, offset, limit, teamMembersGetOptions) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.TeamMembersGetOptions) ([]*model.TeamMember, error)); ok { + return rf(teamID, offset, limit, teamMembersGetOptions) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.TeamMembersGetOptions) []*model.TeamMember); ok { r0 = rf(teamID, offset, limit, teamMembersGetOptions) } else { @@ -456,7 +514,6 @@ func (_m *TeamStore) GetMembers(teamID string, offset int, limit int, teamMember } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.TeamMembersGetOptions) error); ok { r1 = rf(teamID, offset, limit, teamMembersGetOptions) } else { @@ -471,6 +528,10 @@ func (_m *TeamStore) GetMembersByIds(teamID string, userIds []string, restrictio ret := _m.Called(teamID, userIds, restrictions) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, *model.ViewUsersRestrictions) ([]*model.TeamMember, error)); ok { + return rf(teamID, userIds, restrictions) + } if rf, ok := ret.Get(0).(func(string, []string, *model.ViewUsersRestrictions) []*model.TeamMember); ok { r0 = rf(teamID, userIds, restrictions) } else { @@ -479,7 +540,6 @@ func (_m *TeamStore) GetMembersByIds(teamID string, userIds []string, restrictio } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, userIds, restrictions) } else { @@ -494,6 +554,11 @@ func (_m *TeamStore) GetNewTeamMembersSince(teamID string, since int64, offset i ret := _m.Called(teamID, since, offset, limit) var r0 *model.NewTeamMembersList + var r1 int64 + var r2 error + if rf, ok := ret.Get(0).(func(string, int64, int, int) (*model.NewTeamMembersList, int64, error)); ok { + return rf(teamID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int64, int, int) *model.NewTeamMembersList); ok { r0 = rf(teamID, since, offset, limit) } else { @@ -502,14 +567,12 @@ func (_m *TeamStore) GetNewTeamMembersSince(teamID string, since int64, offset i } } - var r1 int64 if rf, ok := ret.Get(1).(func(string, int64, int, int) int64); ok { r1 = rf(teamID, since, offset, limit) } else { r1 = ret.Get(1).(int64) } - var r2 error if rf, ok := ret.Get(2).(func(string, int64, int, int) error); ok { r2 = rf(teamID, since, offset, limit) } else { @@ -524,6 +587,10 @@ func (_m *TeamStore) GetTeamMembersForExport(userID string) ([]*model.TeamMember ret := _m.Called(userID) var r0 []*model.TeamMemberForExport + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.TeamMemberForExport, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.TeamMemberForExport); ok { r0 = rf(userID) } else { @@ -532,7 +599,6 @@ func (_m *TeamStore) GetTeamMembersForExport(userID string) ([]*model.TeamMember } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -547,6 +613,10 @@ func (_m *TeamStore) GetTeamsByScheme(schemeID string, offset int, limit int) ([ ret := _m.Called(schemeID, offset, limit) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Team, error)); ok { + return rf(schemeID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Team); ok { r0 = rf(schemeID, offset, limit) } else { @@ -555,7 +625,6 @@ func (_m *TeamStore) GetTeamsByScheme(schemeID string, offset int, limit int) ([ } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(schemeID, offset, limit) } else { @@ -570,6 +639,10 @@ func (_m *TeamStore) GetTeamsByUserId(userID string) ([]*model.Team, error) { ret := _m.Called(userID) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Team, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.Team); ok { r0 = rf(userID) } else { @@ -578,7 +651,6 @@ func (_m *TeamStore) GetTeamsByUserId(userID string) ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -593,6 +665,10 @@ func (_m *TeamStore) GetTeamsForUser(ctx context.Context, userID string, exclude ret := _m.Called(ctx, userID, excludeTeamID, includeDeleted) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) ([]*model.TeamMember, error)); ok { + return rf(ctx, userID, excludeTeamID, includeDeleted) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) []*model.TeamMember); ok { r0 = rf(ctx, userID, excludeTeamID, includeDeleted) } else { @@ -601,7 +677,6 @@ func (_m *TeamStore) GetTeamsForUser(ctx context.Context, userID string, exclude } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, bool) error); ok { r1 = rf(ctx, userID, excludeTeamID, includeDeleted) } else { @@ -616,6 +691,10 @@ func (_m *TeamStore) GetTeamsForUserWithPagination(userID string, page int, perP ret := _m.Called(userID, page, perPage) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.TeamMember, error)); ok { + return rf(userID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.TeamMember); ok { r0 = rf(userID, page, perPage) } else { @@ -624,7 +703,6 @@ func (_m *TeamStore) GetTeamsForUserWithPagination(userID string, page int, perP } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, page, perPage) } else { @@ -639,13 +717,16 @@ func (_m *TeamStore) GetTotalMemberCount(teamID string, restrictions *model.View ret := _m.Called(teamID, restrictions) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) (int64, error)); ok { + return rf(teamID, restrictions) + } if rf, ok := ret.Get(0).(func(string, *model.ViewUsersRestrictions) int64); ok { r0 = rf(teamID, restrictions) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, restrictions) } else { @@ -660,6 +741,10 @@ func (_m *TeamStore) GetUserTeamIds(userID string, allowFromCache bool) ([]strin ret := _m.Called(userID, allowFromCache) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) ([]string, error)); ok { + return rf(userID, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) []string); ok { r0 = rf(userID, allowFromCache) } else { @@ -668,7 +753,6 @@ func (_m *TeamStore) GetUserTeamIds(userID string, allowFromCache bool) ([]strin } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(userID, allowFromCache) } else { @@ -683,13 +767,16 @@ func (_m *TeamStore) GroupSyncedTeamCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -709,6 +796,10 @@ func (_m *TeamStore) MigrateTeamMembers(fromTeamID string, fromUserID string) (m ret := _m.Called(fromTeamID, fromUserID) var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (map[string]string, error)); ok { + return rf(fromTeamID, fromUserID) + } if rf, ok := ret.Get(0).(func(string, string) map[string]string); ok { r0 = rf(fromTeamID, fromUserID) } else { @@ -717,7 +808,6 @@ func (_m *TeamStore) MigrateTeamMembers(fromTeamID string, fromUserID string) (m } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(fromTeamID, fromUserID) } else { @@ -816,6 +906,10 @@ func (_m *TeamStore) Save(team *model.Team) (*model.Team, error) { ret := _m.Called(team) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, error)); ok { + return rf(team) + } if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { r0 = rf(team) } else { @@ -824,7 +918,6 @@ func (_m *TeamStore) Save(team *model.Team) (*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Team) error); ok { r1 = rf(team) } else { @@ -839,6 +932,10 @@ func (_m *TeamStore) SaveMember(member *model.TeamMember, maxUsersPerTeam int) ( ret := _m.Called(member, maxUsersPerTeam) var r0 *model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamMember, int) (*model.TeamMember, error)); ok { + return rf(member, maxUsersPerTeam) + } if rf, ok := ret.Get(0).(func(*model.TeamMember, int) *model.TeamMember); ok { r0 = rf(member, maxUsersPerTeam) } else { @@ -847,7 +944,6 @@ func (_m *TeamStore) SaveMember(member *model.TeamMember, maxUsersPerTeam int) ( } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamMember, int) error); ok { r1 = rf(member, maxUsersPerTeam) } else { @@ -862,6 +958,10 @@ func (_m *TeamStore) SaveMultipleMembers(members []*model.TeamMember, maxUsersPe ret := _m.Called(members, maxUsersPerTeam) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func([]*model.TeamMember, int) ([]*model.TeamMember, error)); ok { + return rf(members, maxUsersPerTeam) + } if rf, ok := ret.Get(0).(func([]*model.TeamMember, int) []*model.TeamMember); ok { r0 = rf(members, maxUsersPerTeam) } else { @@ -870,7 +970,6 @@ func (_m *TeamStore) SaveMultipleMembers(members []*model.TeamMember, maxUsersPe } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.TeamMember, int) error); ok { r1 = rf(members, maxUsersPerTeam) } else { @@ -885,6 +984,10 @@ func (_m *TeamStore) SearchAll(opts *model.TeamSearch) ([]*model.Team, error) { ret := _m.Called(opts) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamSearch) ([]*model.Team, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(*model.TeamSearch) []*model.Team); ok { r0 = rf(opts) } else { @@ -893,7 +996,6 @@ func (_m *TeamStore) SearchAll(opts *model.TeamSearch) ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamSearch) error); ok { r1 = rf(opts) } else { @@ -908,6 +1010,11 @@ func (_m *TeamStore) SearchAllPaged(opts *model.TeamSearch) ([]*model.Team, int6 ret := _m.Called(opts) var r0 []*model.Team + var r1 int64 + var r2 error + if rf, ok := ret.Get(0).(func(*model.TeamSearch) ([]*model.Team, int64, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(*model.TeamSearch) []*model.Team); ok { r0 = rf(opts) } else { @@ -916,14 +1023,12 @@ func (_m *TeamStore) SearchAllPaged(opts *model.TeamSearch) ([]*model.Team, int6 } } - var r1 int64 if rf, ok := ret.Get(1).(func(*model.TeamSearch) int64); ok { r1 = rf(opts) } else { r1 = ret.Get(1).(int64) } - var r2 error if rf, ok := ret.Get(2).(func(*model.TeamSearch) error); ok { r2 = rf(opts) } else { @@ -938,6 +1043,10 @@ func (_m *TeamStore) SearchOpen(opts *model.TeamSearch) ([]*model.Team, error) { ret := _m.Called(opts) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamSearch) ([]*model.Team, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(*model.TeamSearch) []*model.Team); ok { r0 = rf(opts) } else { @@ -946,7 +1055,6 @@ func (_m *TeamStore) SearchOpen(opts *model.TeamSearch) ([]*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamSearch) error); ok { r1 = rf(opts) } else { @@ -961,6 +1069,10 @@ func (_m *TeamStore) SearchPrivate(opts *model.TeamSearch) ([]*model.Team, error ret := _m.Called(opts) var r0 []*model.Team + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamSearch) ([]*model.Team, error)); ok { + return rf(opts) + } if rf, ok := ret.Get(0).(func(*model.TeamSearch) []*model.Team); ok { r0 = rf(opts) } else { @@ -969,7 +1081,6 @@ func (_m *TeamStore) SearchPrivate(opts *model.TeamSearch) ([]*model.Team, error } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamSearch) error); ok { r1 = rf(opts) } else { @@ -984,6 +1095,10 @@ func (_m *TeamStore) Update(team *model.Team) (*model.Team, error) { ret := _m.Called(team) var r0 *model.Team + var r1 error + if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, error)); ok { + return rf(team) + } if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { r0 = rf(team) } else { @@ -992,7 +1107,6 @@ func (_m *TeamStore) Update(team *model.Team) (*model.Team, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.Team) error); ok { r1 = rf(team) } else { @@ -1021,6 +1135,10 @@ func (_m *TeamStore) UpdateMember(member *model.TeamMember) (*model.TeamMember, ret := _m.Called(member) var r0 *model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func(*model.TeamMember) (*model.TeamMember, error)); ok { + return rf(member) + } if rf, ok := ret.Get(0).(func(*model.TeamMember) *model.TeamMember); ok { r0 = rf(member) } else { @@ -1029,7 +1147,6 @@ func (_m *TeamStore) UpdateMember(member *model.TeamMember) (*model.TeamMember, } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TeamMember) error); ok { r1 = rf(member) } else { @@ -1058,6 +1175,10 @@ func (_m *TeamStore) UpdateMultipleMembers(members []*model.TeamMember) ([]*mode ret := _m.Called(members) var r0 []*model.TeamMember + var r1 error + if rf, ok := ret.Get(0).(func([]*model.TeamMember) ([]*model.TeamMember, error)); ok { + return rf(members) + } if rf, ok := ret.Get(0).(func([]*model.TeamMember) []*model.TeamMember); ok { r0 = rf(members) } else { @@ -1066,7 +1187,6 @@ func (_m *TeamStore) UpdateMultipleMembers(members []*model.TeamMember) ([]*mode } } - var r1 error if rf, ok := ret.Get(1).(func([]*model.TeamMember) error); ok { r1 = rf(members) } else { @@ -1081,13 +1201,16 @@ func (_m *TeamStore) UserBelongsToTeams(userID string, teamIds []string) (bool, ret := _m.Called(userID, teamIds) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (bool, error)); ok { + return rf(userID, teamIds) + } if rf, ok := ret.Get(0).(func(string, []string) bool); ok { r0 = rf(userID, teamIds) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(userID, teamIds) } else { @@ -1096,3 +1219,18 @@ func (_m *TeamStore) UserBelongsToTeams(userID string, teamIds []string) (bool, return r0, r1 } + +type mockConstructorTestingTNewTeamStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewTeamStore creates a new instance of TeamStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTeamStore(t mockConstructorTestingTNewTeamStore) *TeamStore { + mock := &TeamStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/TermsOfServiceStore.go b/server/channels/store/storetest/mocks/TermsOfServiceStore.go index 75a3daf720..17093293d2 100644 --- a/server/channels/store/storetest/mocks/TermsOfServiceStore.go +++ b/server/channels/store/storetest/mocks/TermsOfServiceStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *TermsOfServiceStore) Get(id string, allowFromCache bool) (*model.Terms ret := _m.Called(id, allowFromCache) var r0 *model.TermsOfService + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (*model.TermsOfService, error)); ok { + return rf(id, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) *model.TermsOfService); ok { r0 = rf(id, allowFromCache) } else { @@ -27,7 +31,6 @@ func (_m *TermsOfServiceStore) Get(id string, allowFromCache bool) (*model.Terms } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(id, allowFromCache) } else { @@ -42,6 +45,10 @@ func (_m *TermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfSer ret := _m.Called(allowFromCache) var r0 *model.TermsOfService + var r1 error + if rf, ok := ret.Get(0).(func(bool) (*model.TermsOfService, error)); ok { + return rf(allowFromCache) + } if rf, ok := ret.Get(0).(func(bool) *model.TermsOfService); ok { r0 = rf(allowFromCache) } else { @@ -50,7 +57,6 @@ func (_m *TermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfSer } } - var r1 error if rf, ok := ret.Get(1).(func(bool) error); ok { r1 = rf(allowFromCache) } else { @@ -65,6 +71,10 @@ func (_m *TermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*mode ret := _m.Called(termsOfService) var r0 *model.TermsOfService + var r1 error + if rf, ok := ret.Get(0).(func(*model.TermsOfService) (*model.TermsOfService, error)); ok { + return rf(termsOfService) + } if rf, ok := ret.Get(0).(func(*model.TermsOfService) *model.TermsOfService); ok { r0 = rf(termsOfService) } else { @@ -73,7 +83,6 @@ func (_m *TermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*mode } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TermsOfService) error); ok { r1 = rf(termsOfService) } else { @@ -82,3 +91,18 @@ func (_m *TermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*mode return r0, r1 } + +type mockConstructorTestingTNewTermsOfServiceStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewTermsOfServiceStore creates a new instance of TermsOfServiceStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTermsOfServiceStore(t mockConstructorTestingTNewTermsOfServiceStore) *TermsOfServiceStore { + mock := &TermsOfServiceStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/ThreadStore.go b/server/channels/store/storetest/mocks/ThreadStore.go index 122f5b4b18..b969e81460 100644 --- a/server/channels/store/storetest/mocks/ThreadStore.go +++ b/server/channels/store/storetest/mocks/ThreadStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -34,13 +34,16 @@ func (_m *ThreadStore) DeleteOrphanedRows(limit int) (int64, error) { ret := _m.Called(limit) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int) (int64, error)); ok { + return rf(limit) + } if rf, ok := ret.Get(0).(func(int) int64); ok { r0 = rf(limit) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int) error); ok { r1 = rf(limit) } else { @@ -55,6 +58,10 @@ func (_m *ThreadStore) Get(id string) (*model.Thread, error) { ret := _m.Called(id) var r0 *model.Thread + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Thread, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.Thread); ok { r0 = rf(id) } else { @@ -63,7 +70,6 @@ func (_m *ThreadStore) Get(id string) (*model.Thread, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -78,6 +84,10 @@ func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*mode ret := _m.Called(userId, postID) var r0 *model.ThreadMembership + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*model.ThreadMembership, error)); ok { + return rf(userId, postID) + } if rf, ok := ret.Get(0).(func(string, string) *model.ThreadMembership); ok { r0 = rf(userId, postID) } else { @@ -86,7 +96,6 @@ func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userId, postID) } else { @@ -101,6 +110,10 @@ func (_m *ThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*m ret := _m.Called(userId, teamID) var r0 []*model.ThreadMembership + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]*model.ThreadMembership, error)); ok { + return rf(userId, teamID) + } if rf, ok := ret.Get(0).(func(string, string) []*model.ThreadMembership); ok { r0 = rf(userId, teamID) } else { @@ -109,7 +122,6 @@ func (_m *ThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*m } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userId, teamID) } else { @@ -124,6 +136,10 @@ func (_m *ThreadStore) GetTeamsUnreadForUser(userID string, teamIDs []string, in ret := _m.Called(userID, teamIDs, includeUrgentMentionCount) var r0 map[string]*model.TeamUnread + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, bool) (map[string]*model.TeamUnread, error)); ok { + return rf(userID, teamIDs, includeUrgentMentionCount) + } if rf, ok := ret.Get(0).(func(string, []string, bool) map[string]*model.TeamUnread); ok { r0 = rf(userID, teamIDs, includeUrgentMentionCount) } else { @@ -132,7 +148,6 @@ func (_m *ThreadStore) GetTeamsUnreadForUser(userID string, teamIDs []string, in } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, bool) error); ok { r1 = rf(userID, teamIDs, includeUrgentMentionCount) } else { @@ -147,6 +162,10 @@ func (_m *ThreadStore) GetThreadFollowers(threadID string, fetchOnlyActive bool) ret := _m.Called(threadID, fetchOnlyActive) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) ([]string, error)); ok { + return rf(threadID, fetchOnlyActive) + } if rf, ok := ret.Get(0).(func(string, bool) []string); ok { r0 = rf(threadID, fetchOnlyActive) } else { @@ -155,7 +174,6 @@ func (_m *ThreadStore) GetThreadFollowers(threadID string, fetchOnlyActive bool) } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(threadID, fetchOnlyActive) } else { @@ -170,6 +188,10 @@ func (_m *ThreadStore) GetThreadForUser(threadMembership *model.ThreadMembership ret := _m.Called(threadMembership, extended, postPriorityIsEnabled) var r0 *model.ThreadResponse + var r1 error + if rf, ok := ret.Get(0).(func(*model.ThreadMembership, bool, bool) (*model.ThreadResponse, error)); ok { + return rf(threadMembership, extended, postPriorityIsEnabled) + } if rf, ok := ret.Get(0).(func(*model.ThreadMembership, bool, bool) *model.ThreadResponse); ok { r0 = rf(threadMembership, extended, postPriorityIsEnabled) } else { @@ -178,7 +200,6 @@ func (_m *ThreadStore) GetThreadForUser(threadMembership *model.ThreadMembership } } - var r1 error if rf, ok := ret.Get(1).(func(*model.ThreadMembership, bool, bool) error); ok { r1 = rf(threadMembership, extended, postPriorityIsEnabled) } else { @@ -193,13 +214,16 @@ func (_m *ThreadStore) GetThreadUnreadReplyCount(threadMembership *model.ThreadM ret := _m.Called(threadMembership) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(*model.ThreadMembership) (int64, error)); ok { + return rf(threadMembership) + } if rf, ok := ret.Get(0).(func(*model.ThreadMembership) int64); ok { r0 = rf(threadMembership) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok { r1 = rf(threadMembership) } else { @@ -214,6 +238,10 @@ func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts mode ret := _m.Called(userId, teamID, opts) var r0 []*model.ThreadResponse + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) ([]*model.ThreadResponse, error)); ok { + return rf(userId, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) []*model.ThreadResponse); ok { r0 = rf(userId, teamID, opts) } else { @@ -222,7 +250,6 @@ func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok { r1 = rf(userId, teamID, opts) } else { @@ -237,6 +264,10 @@ func (_m *ThreadStore) GetTopThreadsForTeamSince(teamID string, userID string, s ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopThreadList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopThreadList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopThreadList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -245,7 +276,6 @@ func (_m *ThreadStore) GetTopThreadsForTeamSince(teamID string, userID string, s } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -260,6 +290,10 @@ func (_m *ThreadStore) GetTopThreadsForUserSince(teamID string, userID string, s ret := _m.Called(teamID, userID, since, offset, limit) var r0 *model.TopThreadList + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int64, int, int) (*model.TopThreadList, error)); ok { + return rf(teamID, userID, since, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int64, int, int) *model.TopThreadList); ok { r0 = rf(teamID, userID, since, offset, limit) } else { @@ -268,7 +302,6 @@ func (_m *ThreadStore) GetTopThreadsForUserSince(teamID string, userID string, s } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int64, int, int) error); ok { r1 = rf(teamID, userID, since, offset, limit) } else { @@ -283,13 +316,16 @@ func (_m *ThreadStore) GetTotalThreads(userId string, teamID string, opts model. ret := _m.Called(userId, teamID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok { + return rf(userId, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok { r0 = rf(userId, teamID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok { r1 = rf(userId, teamID, opts) } else { @@ -304,13 +340,16 @@ func (_m *ThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts ret := _m.Called(userId, teamID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok { + return rf(userId, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok { r0 = rf(userId, teamID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok { r1 = rf(userId, teamID, opts) } else { @@ -325,13 +364,16 @@ func (_m *ThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts ret := _m.Called(userId, teamID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok { + return rf(userId, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok { r0 = rf(userId, teamID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok { r1 = rf(userId, teamID, opts) } else { @@ -346,13 +388,16 @@ func (_m *ThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string ret := _m.Called(userId, teamID, opts) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok { + return rf(userId, teamID, opts) + } if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok { r0 = rf(userId, teamID, opts) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok { r1 = rf(userId, teamID, opts) } else { @@ -367,6 +412,10 @@ func (_m *ThreadStore) MaintainMembership(userID string, postID string, opts sto ret := _m.Called(userID, postID, opts) var r0 *model.ThreadMembership + var r1 error + if rf, ok := ret.Get(0).(func(string, string, store.ThreadMembershipOpts) (*model.ThreadMembership, error)); ok { + return rf(userID, postID, opts) + } if rf, ok := ret.Get(0).(func(string, string, store.ThreadMembershipOpts) *model.ThreadMembership); ok { r0 = rf(userID, postID, opts) } else { @@ -375,7 +424,6 @@ func (_m *ThreadStore) MaintainMembership(userID string, postID string, opts sto } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, store.ThreadMembershipOpts) error); ok { r1 = rf(userID, postID, opts) } else { @@ -446,20 +494,23 @@ func (_m *ThreadStore) PermanentDeleteBatchForRetentionPolicies(now int64, globa ret := _m.Called(now, globalPolicyEndTime, limit, cursor) var r0 int64 + var r1 model.RetentionPolicyCursor + var r2 error + if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok { + return rf(now, globalPolicyEndTime, limit, cursor) + } if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) int64); ok { r0 = rf(now, globalPolicyEndTime, limit, cursor) } else { r0 = ret.Get(0).(int64) } - var r1 model.RetentionPolicyCursor if rf, ok := ret.Get(1).(func(int64, int64, int64, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok { r1 = rf(now, globalPolicyEndTime, limit, cursor) } else { r1 = ret.Get(1).(model.RetentionPolicyCursor) } - var r2 error if rf, ok := ret.Get(2).(func(int64, int64, int64, model.RetentionPolicyCursor) error); ok { r2 = rf(now, globalPolicyEndTime, limit, cursor) } else { @@ -474,20 +525,23 @@ func (_m *ThreadStore) PermanentDeleteBatchThreadMembershipsForRetentionPolicies ret := _m.Called(now, globalPolicyEndTime, limit, cursor) var r0 int64 + var r1 model.RetentionPolicyCursor + var r2 error + if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok { + return rf(now, globalPolicyEndTime, limit, cursor) + } if rf, ok := ret.Get(0).(func(int64, int64, int64, model.RetentionPolicyCursor) int64); ok { r0 = rf(now, globalPolicyEndTime, limit, cursor) } else { r0 = ret.Get(0).(int64) } - var r1 model.RetentionPolicyCursor if rf, ok := ret.Get(1).(func(int64, int64, int64, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok { r1 = rf(now, globalPolicyEndTime, limit, cursor) } else { r1 = ret.Get(1).(model.RetentionPolicyCursor) } - var r2 error if rf, ok := ret.Get(2).(func(int64, int64, int64, model.RetentionPolicyCursor) error); ok { r2 = rf(now, globalPolicyEndTime, limit, cursor) } else { @@ -502,6 +556,10 @@ func (_m *ThreadStore) UpdateMembership(membership *model.ThreadMembership) (*mo ret := _m.Called(membership) var r0 *model.ThreadMembership + var r1 error + if rf, ok := ret.Get(0).(func(*model.ThreadMembership) (*model.ThreadMembership, error)); ok { + return rf(membership) + } if rf, ok := ret.Get(0).(func(*model.ThreadMembership) *model.ThreadMembership); ok { r0 = rf(membership) } else { @@ -510,7 +568,6 @@ func (_m *ThreadStore) UpdateMembership(membership *model.ThreadMembership) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok { r1 = rf(membership) } else { @@ -519,3 +576,18 @@ func (_m *ThreadStore) UpdateMembership(membership *model.ThreadMembership) (*mo return r0, r1 } + +type mockConstructorTestingTNewThreadStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewThreadStore creates a new instance of ThreadStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewThreadStore(t mockConstructorTestingTNewThreadStore) *ThreadStore { + mock := &ThreadStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/TokenStore.go b/server/channels/store/storetest/mocks/TokenStore.go index 87cbc40efa..5f3f14922f 100644 --- a/server/channels/store/storetest/mocks/TokenStore.go +++ b/server/channels/store/storetest/mocks/TokenStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -38,6 +38,10 @@ func (_m *TokenStore) GetAllTokensByType(tokenType string) ([]*model.Token, erro ret := _m.Called(tokenType) var r0 []*model.Token + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.Token, error)); ok { + return rf(tokenType) + } if rf, ok := ret.Get(0).(func(string) []*model.Token); ok { r0 = rf(tokenType) } else { @@ -46,7 +50,6 @@ func (_m *TokenStore) GetAllTokensByType(tokenType string) ([]*model.Token, erro } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(tokenType) } else { @@ -61,6 +64,10 @@ func (_m *TokenStore) GetByToken(token string) (*model.Token, error) { ret := _m.Called(token) var r0 *model.Token + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.Token, error)); ok { + return rf(token) + } if rf, ok := ret.Get(0).(func(string) *model.Token); ok { r0 = rf(token) } else { @@ -69,7 +76,6 @@ func (_m *TokenStore) GetByToken(token string) (*model.Token, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(token) } else { @@ -106,3 +112,18 @@ func (_m *TokenStore) Save(recovery *model.Token) error { return r0 } + +type mockConstructorTestingTNewTokenStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewTokenStore creates a new instance of TokenStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTokenStore(t mockConstructorTestingTNewTokenStore) *TokenStore { + mock := &TokenStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/TrueUpReviewStore.go b/server/channels/store/storetest/mocks/TrueUpReviewStore.go index 0e7bc15411..f71c1a8eb3 100644 --- a/server/channels/store/storetest/mocks/TrueUpReviewStore.go +++ b/server/channels/store/storetest/mocks/TrueUpReviewStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,6 +19,10 @@ func (_m *TrueUpReviewStore) CreateTrueUpReviewStatusRecord(reviewStatus *model. ret := _m.Called(reviewStatus) var r0 *model.TrueUpReviewStatus + var r1 error + if rf, ok := ret.Get(0).(func(*model.TrueUpReviewStatus) (*model.TrueUpReviewStatus, error)); ok { + return rf(reviewStatus) + } if rf, ok := ret.Get(0).(func(*model.TrueUpReviewStatus) *model.TrueUpReviewStatus); ok { r0 = rf(reviewStatus) } else { @@ -27,7 +31,6 @@ func (_m *TrueUpReviewStore) CreateTrueUpReviewStatusRecord(reviewStatus *model. } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TrueUpReviewStatus) error); ok { r1 = rf(reviewStatus) } else { @@ -42,6 +45,10 @@ func (_m *TrueUpReviewStore) GetTrueUpReviewStatus(dueDate int64) (*model.TrueUp ret := _m.Called(dueDate) var r0 *model.TrueUpReviewStatus + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*model.TrueUpReviewStatus, error)); ok { + return rf(dueDate) + } if rf, ok := ret.Get(0).(func(int64) *model.TrueUpReviewStatus); ok { r0 = rf(dueDate) } else { @@ -50,7 +57,6 @@ func (_m *TrueUpReviewStore) GetTrueUpReviewStatus(dueDate int64) (*model.TrueUp } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(dueDate) } else { @@ -65,6 +71,10 @@ func (_m *TrueUpReviewStore) Update(reviewStatus *model.TrueUpReviewStatus) (*mo ret := _m.Called(reviewStatus) var r0 *model.TrueUpReviewStatus + var r1 error + if rf, ok := ret.Get(0).(func(*model.TrueUpReviewStatus) (*model.TrueUpReviewStatus, error)); ok { + return rf(reviewStatus) + } if rf, ok := ret.Get(0).(func(*model.TrueUpReviewStatus) *model.TrueUpReviewStatus); ok { r0 = rf(reviewStatus) } else { @@ -73,7 +83,6 @@ func (_m *TrueUpReviewStore) Update(reviewStatus *model.TrueUpReviewStatus) (*mo } } - var r1 error if rf, ok := ret.Get(1).(func(*model.TrueUpReviewStatus) error); ok { r1 = rf(reviewStatus) } else { @@ -82,3 +91,18 @@ func (_m *TrueUpReviewStore) Update(reviewStatus *model.TrueUpReviewStatus) (*mo return r0, r1 } + +type mockConstructorTestingTNewTrueUpReviewStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewTrueUpReviewStore creates a new instance of TrueUpReviewStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTrueUpReviewStore(t mockConstructorTestingTNewTrueUpReviewStore) *TrueUpReviewStore { + mock := &TrueUpReviewStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/UploadSessionStore.go b/server/channels/store/storetest/mocks/UploadSessionStore.go index f27dbf6856..8a4ea35009 100644 --- a/server/channels/store/storetest/mocks/UploadSessionStore.go +++ b/server/channels/store/storetest/mocks/UploadSessionStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -35,6 +35,10 @@ func (_m *UploadSessionStore) Get(ctx context.Context, id string) (*model.Upload ret := _m.Called(ctx, id) var r0 *model.UploadSession + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*model.UploadSession, error)); ok { + return rf(ctx, id) + } if rf, ok := ret.Get(0).(func(context.Context, string) *model.UploadSession); ok { r0 = rf(ctx, id) } else { @@ -43,7 +47,6 @@ func (_m *UploadSessionStore) Get(ctx context.Context, id string) (*model.Upload } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, id) } else { @@ -58,6 +61,10 @@ func (_m *UploadSessionStore) GetForUser(userID string) ([]*model.UploadSession, ret := _m.Called(userID) var r0 []*model.UploadSession + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.UploadSession, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []*model.UploadSession); ok { r0 = rf(userID) } else { @@ -66,7 +73,6 @@ func (_m *UploadSessionStore) GetForUser(userID string) ([]*model.UploadSession, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -81,6 +87,10 @@ func (_m *UploadSessionStore) Save(session *model.UploadSession) (*model.UploadS ret := _m.Called(session) var r0 *model.UploadSession + var r1 error + if rf, ok := ret.Get(0).(func(*model.UploadSession) (*model.UploadSession, error)); ok { + return rf(session) + } if rf, ok := ret.Get(0).(func(*model.UploadSession) *model.UploadSession); ok { r0 = rf(session) } else { @@ -89,7 +99,6 @@ func (_m *UploadSessionStore) Save(session *model.UploadSession) (*model.UploadS } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UploadSession) error); ok { r1 = rf(session) } else { @@ -112,3 +121,18 @@ func (_m *UploadSessionStore) Update(session *model.UploadSession) error { return r0 } + +type mockConstructorTestingTNewUploadSessionStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewUploadSessionStore creates a new instance of UploadSessionStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewUploadSessionStore(t mockConstructorTestingTNewUploadSessionStore) *UploadSessionStore { + mock := &UploadSessionStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/UserAccessTokenStore.go b/server/channels/store/storetest/mocks/UserAccessTokenStore.go index 937304fb81..8ebac229cc 100644 --- a/server/channels/store/storetest/mocks/UserAccessTokenStore.go +++ b/server/channels/store/storetest/mocks/UserAccessTokenStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -47,6 +47,10 @@ func (_m *UserAccessTokenStore) Get(tokenID string) (*model.UserAccessToken, err ret := _m.Called(tokenID) var r0 *model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.UserAccessToken, error)); ok { + return rf(tokenID) + } if rf, ok := ret.Get(0).(func(string) *model.UserAccessToken); ok { r0 = rf(tokenID) } else { @@ -55,7 +59,6 @@ func (_m *UserAccessTokenStore) Get(tokenID string) (*model.UserAccessToken, err } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(tokenID) } else { @@ -70,6 +73,10 @@ func (_m *UserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAcce ret := _m.Called(offset, limit) var r0 []*model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.UserAccessToken, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.UserAccessToken); ok { r0 = rf(offset, limit) } else { @@ -78,7 +85,6 @@ func (_m *UserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAcce } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -93,6 +99,10 @@ func (_m *UserAccessTokenStore) GetByToken(tokenString string) (*model.UserAcces ret := _m.Called(tokenString) var r0 *model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.UserAccessToken, error)); ok { + return rf(tokenString) + } if rf, ok := ret.Get(0).(func(string) *model.UserAccessToken); ok { r0 = rf(tokenString) } else { @@ -101,7 +111,6 @@ func (_m *UserAccessTokenStore) GetByToken(tokenString string) (*model.UserAcces } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(tokenString) } else { @@ -116,6 +125,10 @@ func (_m *UserAccessTokenStore) GetByUser(userID string, page int, perPage int) ret := _m.Called(userID, page, perPage) var r0 []*model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.UserAccessToken, error)); ok { + return rf(userID, page, perPage) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.UserAccessToken); ok { r0 = rf(userID, page, perPage) } else { @@ -124,7 +137,6 @@ func (_m *UserAccessTokenStore) GetByUser(userID string, page int, perPage int) } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, page, perPage) } else { @@ -139,6 +151,10 @@ func (_m *UserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserA ret := _m.Called(token) var r0 *model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserAccessToken) (*model.UserAccessToken, error)); ok { + return rf(token) + } if rf, ok := ret.Get(0).(func(*model.UserAccessToken) *model.UserAccessToken); ok { r0 = rf(token) } else { @@ -147,7 +163,6 @@ func (_m *UserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserA } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserAccessToken) error); ok { r1 = rf(token) } else { @@ -162,6 +177,10 @@ func (_m *UserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, e ret := _m.Called(term) var r0 []*model.UserAccessToken + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.UserAccessToken, error)); ok { + return rf(term) + } if rf, ok := ret.Get(0).(func(string) []*model.UserAccessToken); ok { r0 = rf(term) } else { @@ -170,7 +189,6 @@ func (_m *UserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, e } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(term) } else { @@ -207,3 +225,18 @@ func (_m *UserAccessTokenStore) UpdateTokenEnable(tokenID string) error { return r0 } + +type mockConstructorTestingTNewUserAccessTokenStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewUserAccessTokenStore creates a new instance of UserAccessTokenStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewUserAccessTokenStore(t mockConstructorTestingTNewUserAccessTokenStore) *UserAccessTokenStore { + mock := &UserAccessTokenStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/UserStore.go b/server/channels/store/storetest/mocks/UserStore.go index a94cd9dc0d..0e7698809e 100644 --- a/server/channels/store/storetest/mocks/UserStore.go +++ b/server/channels/store/storetest/mocks/UserStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -23,13 +23,16 @@ func (_m *UserStore) AnalyticsActiveCount(timestamp int64, options model.UserCou ret := _m.Called(timestamp, options) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, model.UserCountOptions) (int64, error)); ok { + return rf(timestamp, options) + } if rf, ok := ret.Get(0).(func(int64, model.UserCountOptions) int64); ok { r0 = rf(timestamp, options) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, model.UserCountOptions) error); ok { r1 = rf(timestamp, options) } else { @@ -44,13 +47,16 @@ func (_m *UserStore) AnalyticsActiveCountForPeriod(startTime int64, endTime int6 ret := _m.Called(startTime, endTime, options) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int64, model.UserCountOptions) (int64, error)); ok { + return rf(startTime, endTime, options) + } if rf, ok := ret.Get(0).(func(int64, int64, model.UserCountOptions) int64); ok { r0 = rf(startTime, endTime, options) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int64, model.UserCountOptions) error); ok { r1 = rf(startTime, endTime, options) } else { @@ -65,13 +71,16 @@ func (_m *UserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, error) ret := _m.Called(hostDomain) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(hostDomain) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(hostDomain) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(hostDomain) } else { @@ -86,13 +95,16 @@ func (_m *UserStore) AnalyticsGetGuestCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -107,13 +119,16 @@ func (_m *UserStore) AnalyticsGetInactiveUsersCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -128,13 +143,16 @@ func (_m *UserStore) AnalyticsGetSystemAdminCount() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -149,6 +167,10 @@ func (_m *UserStore) AutocompleteUsersInChannel(teamID string, channelID string, ret := _m.Called(teamID, channelID, term, options) var r0 *model.UserAutocompleteInChannel + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, *model.UserSearchOptions) (*model.UserAutocompleteInChannel, error)); ok { + return rf(teamID, channelID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, string, *model.UserSearchOptions) *model.UserAutocompleteInChannel); ok { r0 = rf(teamID, channelID, term, options) } else { @@ -157,7 +179,6 @@ func (_m *UserStore) AutocompleteUsersInChannel(teamID string, channelID string, } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, *model.UserSearchOptions) error); ok { r1 = rf(teamID, channelID, term, options) } else { @@ -191,13 +212,16 @@ func (_m *UserStore) Count(options model.UserCountOptions) (int64, error) { ret := _m.Called(options) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(model.UserCountOptions) (int64, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(model.UserCountOptions) int64); ok { r0 = rf(options) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(model.UserCountOptions) error); ok { r1 = rf(options) } else { @@ -212,6 +236,10 @@ func (_m *UserStore) DeactivateGuests() ([]string, error) { ret := _m.Called() var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func() ([]string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() } else { @@ -220,7 +248,6 @@ func (_m *UserStore) DeactivateGuests() ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -235,6 +262,10 @@ func (_m *UserStore) DemoteUserToGuest(userID string) (*model.User, error) { ret := _m.Called(userID) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(userID) } else { @@ -243,7 +274,6 @@ func (_m *UserStore) DemoteUserToGuest(userID string) (*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -258,6 +288,10 @@ func (_m *UserStore) Get(ctx context.Context, id string) (*model.User, error) { ret := _m.Called(ctx, id) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*model.User, error)); ok { + return rf(ctx, id) + } if rf, ok := ret.Get(0).(func(context.Context, string) *model.User); ok { r0 = rf(ctx, id) } else { @@ -266,7 +300,6 @@ func (_m *UserStore) Get(ctx context.Context, id string) (*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, id) } else { @@ -281,6 +314,10 @@ func (_m *UserStore) GetAll() ([]*model.User, error) { ret := _m.Called() var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func() ([]*model.User, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*model.User); ok { r0 = rf() } else { @@ -289,7 +326,6 @@ func (_m *UserStore) GetAll() ([]*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -304,6 +340,10 @@ func (_m *UserStore) GetAllAfter(limit int, afterID string) ([]*model.User, erro ret := _m.Called(limit, afterID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(int, string) ([]*model.User, error)); ok { + return rf(limit, afterID) + } if rf, ok := ret.Get(0).(func(int, string) []*model.User); ok { r0 = rf(limit, afterID) } else { @@ -312,7 +352,6 @@ func (_m *UserStore) GetAllAfter(limit int, afterID string) ([]*model.User, erro } } - var r1 error if rf, ok := ret.Get(1).(func(int, string) error); ok { r1 = rf(limit, afterID) } else { @@ -327,6 +366,10 @@ func (_m *UserStore) GetAllNotInAuthService(authServices []string) ([]*model.Use ret := _m.Called(authServices) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*model.User, error)); ok { + return rf(authServices) + } if rf, ok := ret.Get(0).(func([]string) []*model.User); ok { r0 = rf(authServices) } else { @@ -335,7 +378,6 @@ func (_m *UserStore) GetAllNotInAuthService(authServices []string) ([]*model.Use } } - var r1 error if rf, ok := ret.Get(1).(func([]string) error); ok { r1 = rf(authServices) } else { @@ -350,6 +392,10 @@ func (_m *UserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.Use ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -358,7 +404,6 @@ func (_m *UserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.Use } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -373,6 +418,10 @@ func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID stri ret := _m.Called(ctx, channelID, allowFromCache) var r0 map[string]*model.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool) (map[string]*model.User, error)); ok { + return rf(ctx, channelID, allowFromCache) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool) map[string]*model.User); ok { r0 = rf(ctx, channelID, allowFromCache) } else { @@ -381,7 +430,6 @@ func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID stri } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { r1 = rf(ctx, channelID, allowFromCache) } else { @@ -396,6 +444,10 @@ func (_m *UserStore) GetAllUsingAuthService(authService string) ([]*model.User, ret := _m.Called(authService) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.User, error)); ok { + return rf(authService) + } if rf, ok := ret.Get(0).(func(string) []*model.User); ok { r0 = rf(authService) } else { @@ -404,7 +456,6 @@ func (_m *UserStore) GetAllUsingAuthService(authService string) ([]*model.User, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(authService) } else { @@ -419,13 +470,16 @@ func (_m *UserStore) GetAnyUnreadPostCountForChannel(userID string, channelID st ret := _m.Called(userID, channelID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (int64, error)); ok { + return rf(userID, channelID) + } if rf, ok := ret.Get(0).(func(string, string) int64); ok { r0 = rf(userID, channelID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, channelID) } else { @@ -440,6 +494,10 @@ func (_m *UserStore) GetByAuth(authData *string, authService string) (*model.Use ret := _m.Called(authData, authService) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(*string, string) (*model.User, error)); ok { + return rf(authData, authService) + } if rf, ok := ret.Get(0).(func(*string, string) *model.User); ok { r0 = rf(authData, authService) } else { @@ -448,7 +506,6 @@ func (_m *UserStore) GetByAuth(authData *string, authService string) (*model.Use } } - var r1 error if rf, ok := ret.Get(1).(func(*string, string) error); ok { r1 = rf(authData, authService) } else { @@ -463,6 +520,10 @@ func (_m *UserStore) GetByEmail(email string) (*model.User, error) { ret := _m.Called(email) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { + return rf(email) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(email) } else { @@ -471,7 +532,6 @@ func (_m *UserStore) GetByEmail(email string) (*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(email) } else { @@ -486,6 +546,10 @@ func (_m *UserStore) GetByUsername(username string) (*model.User, error) { ret := _m.Called(username) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { + return rf(username) + } if rf, ok := ret.Get(0).(func(string) *model.User); ok { r0 = rf(username) } else { @@ -494,7 +558,6 @@ func (_m *UserStore) GetByUsername(username string) (*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(username) } else { @@ -509,6 +572,10 @@ func (_m *UserStore) GetChannelGroupUsers(channelID string) ([]*model.User, erro ret := _m.Called(channelID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.User, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) []*model.User); ok { r0 = rf(channelID) } else { @@ -517,7 +584,6 @@ func (_m *UserStore) GetChannelGroupUsers(channelID string) ([]*model.User, erro } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -574,13 +640,16 @@ func (_m *UserStore) GetFirstSystemAdminID() (string, error) { ret := _m.Called() var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -595,6 +664,10 @@ func (_m *UserStore) GetForLogin(loginID string, allowSignInWithUsername bool, a ret := _m.Called(loginID, allowSignInWithUsername, allowSignInWithEmail) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, bool) (*model.User, error)); ok { + return rf(loginID, allowSignInWithUsername, allowSignInWithEmail) + } if rf, ok := ret.Get(0).(func(string, bool, bool) *model.User); ok { r0 = rf(loginID, allowSignInWithUsername, allowSignInWithEmail) } else { @@ -603,7 +676,6 @@ func (_m *UserStore) GetForLogin(loginID string, allowSignInWithUsername bool, a } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, bool) error); ok { r1 = rf(loginID, allowSignInWithUsername, allowSignInWithEmail) } else { @@ -618,6 +690,10 @@ func (_m *UserStore) GetKnownUsers(userID string) ([]string, error) { ret := _m.Called(userID) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(userID) } else { @@ -626,7 +702,6 @@ func (_m *UserStore) GetKnownUsers(userID string) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -641,6 +716,10 @@ func (_m *UserStore) GetMany(ctx context.Context, ids []string) ([]*model.User, ret := _m.Called(ctx, ids) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*model.User, error)); ok { + return rf(ctx, ids) + } if rf, ok := ret.Get(0).(func(context.Context, []string) []*model.User); ok { r0 = rf(ctx, ids) } else { @@ -649,7 +728,6 @@ func (_m *UserStore) GetMany(ctx context.Context, ids []string) ([]*model.User, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { r1 = rf(ctx, ids) } else { @@ -664,6 +742,10 @@ func (_m *UserStore) GetNewUsersForTeam(teamID string, offset int, limit int, vi ret := _m.Called(teamID, offset, limit, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(teamID, offset, limit, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(teamID, offset, limit, viewRestrictions) } else { @@ -672,7 +754,6 @@ func (_m *UserStore) GetNewUsersForTeam(teamID string, offset int, limit int, vi } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, offset, limit, viewRestrictions) } else { @@ -687,6 +768,10 @@ func (_m *UserStore) GetProfileByGroupChannelIdsForUser(userID string, channelId ret := _m.Called(userID, channelIds) var r0 map[string][]*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, []string) (map[string][]*model.User, error)); ok { + return rf(userID, channelIds) + } if rf, ok := ret.Get(0).(func(string, []string) map[string][]*model.User); ok { r0 = rf(userID, channelIds) } else { @@ -695,7 +780,6 @@ func (_m *UserStore) GetProfileByGroupChannelIdsForUser(userID string, channelId } } - var r1 error if rf, ok := ret.Get(1).(func(string, []string) error); ok { r1 = rf(userID, channelIds) } else { @@ -710,6 +794,10 @@ func (_m *UserStore) GetProfileByIds(ctx context.Context, userIds []string, opti ret := _m.Called(ctx, userIds, options, allowFromCache) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []string, *store.UserGetByIdsOpts, bool) ([]*model.User, error)); ok { + return rf(ctx, userIds, options, allowFromCache) + } if rf, ok := ret.Get(0).(func(context.Context, []string, *store.UserGetByIdsOpts, bool) []*model.User); ok { r0 = rf(ctx, userIds, options, allowFromCache) } else { @@ -718,7 +806,6 @@ func (_m *UserStore) GetProfileByIds(ctx context.Context, userIds []string, opti } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, []string, *store.UserGetByIdsOpts, bool) error); ok { r1 = rf(ctx, userIds, options, allowFromCache) } else { @@ -733,6 +820,10 @@ func (_m *UserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -741,7 +832,6 @@ func (_m *UserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -756,6 +846,10 @@ func (_m *UserStore) GetProfilesByUsernames(usernames []string, viewRestrictions ret := _m.Called(usernames, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func([]string, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(usernames, viewRestrictions) + } if rf, ok := ret.Get(0).(func([]string, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(usernames, viewRestrictions) } else { @@ -764,7 +858,6 @@ func (_m *UserStore) GetProfilesByUsernames(usernames []string, viewRestrictions } } - var r1 error if rf, ok := ret.Get(1).(func([]string, *model.ViewUsersRestrictions) error); ok { r1 = rf(usernames, viewRestrictions) } else { @@ -779,6 +872,10 @@ func (_m *UserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*mod ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -787,7 +884,6 @@ func (_m *UserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*mod } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -802,6 +898,10 @@ func (_m *UserStore) GetProfilesInChannelByAdmin(options *model.UserGetOptions) ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -810,7 +910,6 @@ func (_m *UserStore) GetProfilesInChannelByAdmin(options *model.UserGetOptions) } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -825,6 +924,10 @@ func (_m *UserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -833,7 +936,6 @@ func (_m *UserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -848,6 +950,10 @@ func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelId string, gr ret := _m.Called(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) } else { @@ -856,7 +962,6 @@ func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelId string, gr } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) } else { @@ -871,6 +976,10 @@ func (_m *UserStore) GetProfilesNotInTeam(teamID string, groupConstrained bool, ret := _m.Called(teamID, groupConstrained, offset, limit, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, bool, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(teamID, groupConstrained, offset, limit, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, bool, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(teamID, groupConstrained, offset, limit, viewRestrictions) } else { @@ -879,7 +988,6 @@ func (_m *UserStore) GetProfilesNotInTeam(teamID string, groupConstrained bool, } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, groupConstrained, offset, limit, viewRestrictions) } else { @@ -894,6 +1002,10 @@ func (_m *UserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*m ret := _m.Called(options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, error)); ok { + return rf(options) + } if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok { r0 = rf(options) } else { @@ -902,7 +1014,6 @@ func (_m *UserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*m } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserGetOptions) error); ok { r1 = rf(options) } else { @@ -917,6 +1028,10 @@ func (_m *UserStore) GetRecentlyActiveUsersForTeam(teamID string, offset int, li ret := _m.Called(teamID, offset, limit, viewRestrictions) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok { + return rf(teamID, offset, limit, viewRestrictions) + } if rf, ok := ret.Get(0).(func(string, int, int, *model.ViewUsersRestrictions) []*model.User); ok { r0 = rf(teamID, offset, limit, viewRestrictions) } else { @@ -925,7 +1040,6 @@ func (_m *UserStore) GetRecentlyActiveUsersForTeam(teamID string, offset int, li } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int, *model.ViewUsersRestrictions) error); ok { r1 = rf(teamID, offset, limit, viewRestrictions) } else { @@ -940,6 +1054,10 @@ func (_m *UserStore) GetSystemAdminProfiles() (map[string]*model.User, error) { ret := _m.Called() var r0 map[string]*model.User + var r1 error + if rf, ok := ret.Get(0).(func() (map[string]*model.User, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() map[string]*model.User); ok { r0 = rf() } else { @@ -948,7 +1066,6 @@ func (_m *UserStore) GetSystemAdminProfiles() (map[string]*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -963,6 +1080,10 @@ func (_m *UserStore) GetTeamGroupUsers(teamID string) ([]*model.User, error) { ret := _m.Called(teamID) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.User, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) []*model.User); ok { r0 = rf(teamID) } else { @@ -971,7 +1092,6 @@ func (_m *UserStore) GetTeamGroupUsers(teamID string) ([]*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -986,13 +1106,16 @@ func (_m *UserStore) GetUnreadCount(userID string, isCRTEnabled bool) (int64, er ret := _m.Called(userID, isCRTEnabled) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok { + return rf(userID, isCRTEnabled) + } if rf, ok := ret.Get(0).(func(string, bool) int64); ok { r0 = rf(userID, isCRTEnabled) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(userID, isCRTEnabled) } else { @@ -1007,13 +1130,16 @@ func (_m *UserStore) GetUnreadCountForChannel(userID string, channelID string) ( ret := _m.Called(userID, channelID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (int64, error)); ok { + return rf(userID, channelID) + } if rf, ok := ret.Get(0).(func(string, string) int64); ok { r0 = rf(userID, channelID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, channelID) } else { @@ -1028,6 +1154,10 @@ func (_m *UserStore) GetUsersBatchForIndexing(startTime int64, startFileID strin ret := _m.Called(startTime, startFileID, limit) var r0 []*model.UserForIndexing + var r1 error + if rf, ok := ret.Get(0).(func(int64, string, int) ([]*model.UserForIndexing, error)); ok { + return rf(startTime, startFileID, limit) + } if rf, ok := ret.Get(0).(func(int64, string, int) []*model.UserForIndexing); ok { r0 = rf(startTime, startFileID, limit) } else { @@ -1036,7 +1166,6 @@ func (_m *UserStore) GetUsersBatchForIndexing(startTime int64, startFileID strin } } - var r1 error if rf, ok := ret.Get(1).(func(int64, string, int) error); ok { r1 = rf(startTime, startFileID, limit) } else { @@ -1051,6 +1180,10 @@ func (_m *UserStore) GetUsersWithInvalidEmails(page int, perPage int, restricted ret := _m.Called(page, perPage, restrictedDomains) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(int, int, string) ([]*model.User, error)); ok { + return rf(page, perPage, restrictedDomains) + } if rf, ok := ret.Get(0).(func(int, int, string) []*model.User); ok { r0 = rf(page, perPage, restrictedDomains) } else { @@ -1059,7 +1192,6 @@ func (_m *UserStore) GetUsersWithInvalidEmails(page int, perPage int, restricted } } - var r1 error if rf, ok := ret.Get(1).(func(int, int, string) error); ok { r1 = rf(page, perPage, restrictedDomains) } else { @@ -1074,13 +1206,16 @@ func (_m *UserStore) InferSystemInstallDate() (int64, error) { ret := _m.Called() var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func() (int64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -1124,13 +1259,16 @@ func (_m *UserStore) IsEmpty(excludeBots bool) (bool, error) { ret := _m.Called(excludeBots) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(bool) (bool, error)); ok { + return rf(excludeBots) + } if rf, ok := ret.Get(0).(func(bool) bool); ok { r0 = rf(excludeBots) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(bool) error); ok { r1 = rf(excludeBots) } else { @@ -1173,13 +1311,16 @@ func (_m *UserStore) ResetAuthDataToEmailForUsers(service string, userIDs []stri ret := _m.Called(service, userIDs, includeDeleted, dryRun) var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(string, []string, bool, bool) (int, error)); ok { + return rf(service, userIDs, includeDeleted, dryRun) + } if rf, ok := ret.Get(0).(func(string, []string, bool, bool) int); ok { r0 = rf(service, userIDs, includeDeleted, dryRun) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func(string, []string, bool, bool) error); ok { r1 = rf(service, userIDs, includeDeleted, dryRun) } else { @@ -1208,6 +1349,10 @@ func (_m *UserStore) Save(user *model.User) (*model.User, error) { ret := _m.Called(user) var r0 *model.User + var r1 error + if rf, ok := ret.Get(0).(func(*model.User) (*model.User, error)); ok { + return rf(user) + } if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok { r0 = rf(user) } else { @@ -1216,7 +1361,6 @@ func (_m *UserStore) Save(user *model.User) (*model.User, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*model.User) error); ok { r1 = rf(user) } else { @@ -1231,6 +1375,10 @@ func (_m *UserStore) Search(teamID string, term string, options *model.UserSearc ret := _m.Called(teamID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(teamID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(teamID, term, options) } else { @@ -1239,7 +1387,6 @@ func (_m *UserStore) Search(teamID string, term string, options *model.UserSearc } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.UserSearchOptions) error); ok { r1 = rf(teamID, term, options) } else { @@ -1254,6 +1401,10 @@ func (_m *UserStore) SearchInChannel(channelID string, term string, options *mod ret := _m.Called(channelID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(channelID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(channelID, term, options) } else { @@ -1262,7 +1413,6 @@ func (_m *UserStore) SearchInChannel(channelID string, term string, options *mod } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.UserSearchOptions) error); ok { r1 = rf(channelID, term, options) } else { @@ -1277,6 +1427,10 @@ func (_m *UserStore) SearchInGroup(groupID string, term string, options *model.U ret := _m.Called(groupID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(groupID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(groupID, term, options) } else { @@ -1285,7 +1439,6 @@ func (_m *UserStore) SearchInGroup(groupID string, term string, options *model.U } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.UserSearchOptions) error); ok { r1 = rf(groupID, term, options) } else { @@ -1300,6 +1453,10 @@ func (_m *UserStore) SearchNotInChannel(teamID string, channelID string, term st ret := _m.Called(teamID, channelID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(teamID, channelID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(teamID, channelID, term, options) } else { @@ -1308,7 +1465,6 @@ func (_m *UserStore) SearchNotInChannel(teamID string, channelID string, term st } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, *model.UserSearchOptions) error); ok { r1 = rf(teamID, channelID, term, options) } else { @@ -1323,6 +1479,10 @@ func (_m *UserStore) SearchNotInGroup(groupID string, term string, options *mode ret := _m.Called(groupID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(groupID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(groupID, term, options) } else { @@ -1331,7 +1491,6 @@ func (_m *UserStore) SearchNotInGroup(groupID string, term string, options *mode } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.UserSearchOptions) error); ok { r1 = rf(groupID, term, options) } else { @@ -1346,6 +1505,10 @@ func (_m *UserStore) SearchNotInTeam(notInTeamID string, term string, options *m ret := _m.Called(notInTeamID, term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(notInTeamID, term, options) + } if rf, ok := ret.Get(0).(func(string, string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(notInTeamID, term, options) } else { @@ -1354,7 +1517,6 @@ func (_m *UserStore) SearchNotInTeam(notInTeamID string, term string, options *m } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *model.UserSearchOptions) error); ok { r1 = rf(notInTeamID, term, options) } else { @@ -1369,6 +1531,10 @@ func (_m *UserStore) SearchWithoutTeam(term string, options *model.UserSearchOpt ret := _m.Called(term, options) var r0 []*model.User + var r1 error + if rf, ok := ret.Get(0).(func(string, *model.UserSearchOptions) ([]*model.User, error)); ok { + return rf(term, options) + } if rf, ok := ret.Get(0).(func(string, *model.UserSearchOptions) []*model.User); ok { r0 = rf(term, options) } else { @@ -1377,7 +1543,6 @@ func (_m *UserStore) SearchWithoutTeam(term string, options *model.UserSearchOpt } } - var r1 error if rf, ok := ret.Get(1).(func(string, *model.UserSearchOptions) error); ok { r1 = rf(term, options) } else { @@ -1392,6 +1557,10 @@ func (_m *UserStore) Update(user *model.User, allowRoleUpdate bool) (*model.User ret := _m.Called(user, allowRoleUpdate) var r0 *model.UserUpdate + var r1 error + if rf, ok := ret.Get(0).(func(*model.User, bool) (*model.UserUpdate, error)); ok { + return rf(user, allowRoleUpdate) + } if rf, ok := ret.Get(0).(func(*model.User, bool) *model.UserUpdate); ok { r0 = rf(user, allowRoleUpdate) } else { @@ -1400,7 +1569,6 @@ func (_m *UserStore) Update(user *model.User, allowRoleUpdate bool) (*model.User } } - var r1 error if rf, ok := ret.Get(1).(func(*model.User, bool) error); ok { r1 = rf(user, allowRoleUpdate) } else { @@ -1415,13 +1583,16 @@ func (_m *UserStore) UpdateAuthData(userID string, service string, authData *str ret := _m.Called(userID, service, authData, email, resetMfa) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, *string, string, bool) (string, error)); ok { + return rf(userID, service, authData, email, resetMfa) + } if rf, ok := ret.Get(0).(func(string, string, *string, string, bool) string); ok { r0 = rf(userID, service, authData, email, resetMfa) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, *string, string, bool) error); ok { r1 = rf(userID, service, authData, email, resetMfa) } else { @@ -1520,13 +1691,16 @@ func (_m *UserStore) UpdateUpdateAt(userID string) (int64, error) { ret := _m.Called(userID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(userID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -1541,13 +1715,16 @@ func (_m *UserStore) VerifyEmail(userID string, email string) (string, error) { ret := _m.Called(userID, email) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { + return rf(userID, email) + } if rf, ok := ret.Get(0).(func(string, string) string); ok { r0 = rf(userID, email) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(userID, email) } else { @@ -1556,3 +1733,18 @@ func (_m *UserStore) VerifyEmail(userID string, email string) (string, error) { return r0, r1 } + +type mockConstructorTestingTNewUserStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewUserStore creates a new instance of UserStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewUserStore(t mockConstructorTestingTNewUserStore) *UserStore { + mock := &UserStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/UserTermsOfServiceStore.go b/server/channels/store/storetest/mocks/UserTermsOfServiceStore.go index 2cdeb021a6..41fc7925e2 100644 --- a/server/channels/store/storetest/mocks/UserTermsOfServiceStore.go +++ b/server/channels/store/storetest/mocks/UserTermsOfServiceStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -33,6 +33,10 @@ func (_m *UserTermsOfServiceStore) GetByUser(userID string) (*model.UserTermsOfS ret := _m.Called(userID) var r0 *model.UserTermsOfService + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.UserTermsOfService, error)); ok { + return rf(userID) + } if rf, ok := ret.Get(0).(func(string) *model.UserTermsOfService); ok { r0 = rf(userID) } else { @@ -41,7 +45,6 @@ func (_m *UserTermsOfServiceStore) GetByUser(userID string) (*model.UserTermsOfS } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(userID) } else { @@ -56,6 +59,10 @@ func (_m *UserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfSer ret := _m.Called(userTermsOfService) var r0 *model.UserTermsOfService + var r1 error + if rf, ok := ret.Get(0).(func(*model.UserTermsOfService) (*model.UserTermsOfService, error)); ok { + return rf(userTermsOfService) + } if rf, ok := ret.Get(0).(func(*model.UserTermsOfService) *model.UserTermsOfService); ok { r0 = rf(userTermsOfService) } else { @@ -64,7 +71,6 @@ func (_m *UserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfSer } } - var r1 error if rf, ok := ret.Get(1).(func(*model.UserTermsOfService) error); ok { r1 = rf(userTermsOfService) } else { @@ -73,3 +79,18 @@ func (_m *UserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfSer return r0, r1 } + +type mockConstructorTestingTNewUserTermsOfServiceStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewUserTermsOfServiceStore creates a new instance of UserTermsOfServiceStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewUserTermsOfServiceStore(t mockConstructorTestingTNewUserTermsOfServiceStore) *UserTermsOfServiceStore { + mock := &UserTermsOfServiceStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/store/storetest/mocks/WebhookStore.go b/server/channels/store/storetest/mocks/WebhookStore.go index 5abfc36738..e78e63ec0a 100644 --- a/server/channels/store/storetest/mocks/WebhookStore.go +++ b/server/channels/store/storetest/mocks/WebhookStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make store-mocks`. @@ -19,13 +19,16 @@ func (_m *WebhookStore) AnalyticsIncomingCount(teamID string) (int64, error) { ret := _m.Called(teamID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(teamID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -40,13 +43,16 @@ func (_m *WebhookStore) AnalyticsOutgoingCount(teamID string) (int64, error) { ret := _m.Called(teamID) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(teamID) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(teamID) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(teamID) } else { @@ -94,6 +100,10 @@ func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.Inco ret := _m.Called(id, allowFromCache) var r0 *model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) (*model.IncomingWebhook, error)); ok { + return rf(id, allowFromCache) + } if rf, ok := ret.Get(0).(func(string, bool) *model.IncomingWebhook); ok { r0 = rf(id, allowFromCache) } else { @@ -102,7 +112,6 @@ func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.Inco } } - var r1 error if rf, ok := ret.Get(1).(func(string, bool) error); ok { r1 = rf(id, allowFromCache) } else { @@ -117,6 +126,10 @@ func (_m *WebhookStore) GetIncomingByChannel(channelID string) ([]*model.Incomin ret := _m.Called(channelID) var r0 []*model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]*model.IncomingWebhook, error)); ok { + return rf(channelID) + } if rf, ok := ret.Get(0).(func(string) []*model.IncomingWebhook); ok { r0 = rf(channelID) } else { @@ -125,7 +138,6 @@ func (_m *WebhookStore) GetIncomingByChannel(channelID string) ([]*model.Incomin } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(channelID) } else { @@ -140,6 +152,10 @@ func (_m *WebhookStore) GetIncomingByTeam(teamID string, offset int, limit int) ret := _m.Called(teamID, offset, limit) var r0 []*model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.IncomingWebhook, error)); ok { + return rf(teamID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.IncomingWebhook); ok { r0 = rf(teamID, offset, limit) } else { @@ -148,7 +164,6 @@ func (_m *WebhookStore) GetIncomingByTeam(teamID string, offset int, limit int) } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(teamID, offset, limit) } else { @@ -163,6 +178,10 @@ func (_m *WebhookStore) GetIncomingByTeamByUser(teamID string, userID string, of ret := _m.Called(teamID, userID, offset, limit) var r0 []*model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.IncomingWebhook, error)); ok { + return rf(teamID, userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.IncomingWebhook); ok { r0 = rf(teamID, userID, offset, limit) } else { @@ -171,7 +190,6 @@ func (_m *WebhookStore) GetIncomingByTeamByUser(teamID string, userID string, of } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(teamID, userID, offset, limit) } else { @@ -186,6 +204,10 @@ func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.Incomin ret := _m.Called(offset, limit) var r0 []*model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.IncomingWebhook, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.IncomingWebhook); ok { r0 = rf(offset, limit) } else { @@ -194,7 +216,6 @@ func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.Incomin } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -209,6 +230,10 @@ func (_m *WebhookStore) GetIncomingListByUser(userID string, offset int, limit i ret := _m.Called(userID, offset, limit) var r0 []*model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.IncomingWebhook, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.IncomingWebhook); ok { r0 = rf(userID, offset, limit) } else { @@ -217,7 +242,6 @@ func (_m *WebhookStore) GetIncomingListByUser(userID string, offset int, limit i } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -232,6 +256,10 @@ func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) { ret := _m.Called(id) var r0 *model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string) (*model.OutgoingWebhook, error)); ok { + return rf(id) + } if rf, ok := ret.Get(0).(func(string) *model.OutgoingWebhook); ok { r0 = rf(id) } else { @@ -240,7 +268,6 @@ func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -255,6 +282,10 @@ func (_m *WebhookStore) GetOutgoingByChannel(channelID string, offset int, limit ret := _m.Called(channelID, offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(channelID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.OutgoingWebhook); ok { r0 = rf(channelID, offset, limit) } else { @@ -263,7 +294,6 @@ func (_m *WebhookStore) GetOutgoingByChannel(channelID string, offset int, limit } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(channelID, offset, limit) } else { @@ -278,6 +308,10 @@ func (_m *WebhookStore) GetOutgoingByChannelByUser(channelID string, userID stri ret := _m.Called(channelID, userID, offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(channelID, userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.OutgoingWebhook); ok { r0 = rf(channelID, userID, offset, limit) } else { @@ -286,7 +320,6 @@ func (_m *WebhookStore) GetOutgoingByChannelByUser(channelID string, userID stri } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(channelID, userID, offset, limit) } else { @@ -301,6 +334,10 @@ func (_m *WebhookStore) GetOutgoingByTeam(teamID string, offset int, limit int) ret := _m.Called(teamID, offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(teamID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.OutgoingWebhook); ok { r0 = rf(teamID, offset, limit) } else { @@ -309,7 +346,6 @@ func (_m *WebhookStore) GetOutgoingByTeam(teamID string, offset int, limit int) } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(teamID, offset, limit) } else { @@ -324,6 +360,10 @@ func (_m *WebhookStore) GetOutgoingByTeamByUser(teamID string, userID string, of ret := _m.Called(teamID, userID, offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(teamID, userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.OutgoingWebhook); ok { r0 = rf(teamID, userID, offset, limit) } else { @@ -332,7 +372,6 @@ func (_m *WebhookStore) GetOutgoingByTeamByUser(teamID string, userID string, of } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok { r1 = rf(teamID, userID, offset, limit) } else { @@ -347,6 +386,10 @@ func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.Outgoin ret := _m.Called(offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(offset, limit) + } if rf, ok := ret.Get(0).(func(int, int) []*model.OutgoingWebhook); ok { r0 = rf(offset, limit) } else { @@ -355,7 +398,6 @@ func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.Outgoin } } - var r1 error if rf, ok := ret.Get(1).(func(int, int) error); ok { r1 = rf(offset, limit) } else { @@ -370,6 +412,10 @@ func (_m *WebhookStore) GetOutgoingListByUser(userID string, offset int, limit i ret := _m.Called(userID, offset, limit) var r0 []*model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OutgoingWebhook, error)); ok { + return rf(userID, offset, limit) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.OutgoingWebhook); ok { r0 = rf(userID, offset, limit) } else { @@ -378,7 +424,6 @@ func (_m *WebhookStore) GetOutgoingListByUser(userID string, offset int, limit i } } - var r1 error if rf, ok := ret.Get(1).(func(string, int, int) error); ok { r1 = rf(userID, offset, limit) } else { @@ -454,6 +499,10 @@ func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.Inc ret := _m.Called(webhook) var r0 *model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(*model.IncomingWebhook) (*model.IncomingWebhook, error)); ok { + return rf(webhook) + } if rf, ok := ret.Get(0).(func(*model.IncomingWebhook) *model.IncomingWebhook); ok { r0 = rf(webhook) } else { @@ -462,7 +511,6 @@ func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.Inc } } - var r1 error if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok { r1 = rf(webhook) } else { @@ -477,6 +525,10 @@ func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Out ret := _m.Called(webhook) var r0 *model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(*model.OutgoingWebhook) (*model.OutgoingWebhook, error)); ok { + return rf(webhook) + } if rf, ok := ret.Get(0).(func(*model.OutgoingWebhook) *model.OutgoingWebhook); ok { r0 = rf(webhook) } else { @@ -485,7 +537,6 @@ func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Out } } - var r1 error if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok { r1 = rf(webhook) } else { @@ -500,6 +551,10 @@ func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.I ret := _m.Called(webhook) var r0 *model.IncomingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(*model.IncomingWebhook) (*model.IncomingWebhook, error)); ok { + return rf(webhook) + } if rf, ok := ret.Get(0).(func(*model.IncomingWebhook) *model.IncomingWebhook); ok { r0 = rf(webhook) } else { @@ -508,7 +563,6 @@ func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.I } } - var r1 error if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok { r1 = rf(webhook) } else { @@ -523,6 +577,10 @@ func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Outg ret := _m.Called(hook) var r0 *model.OutgoingWebhook + var r1 error + if rf, ok := ret.Get(0).(func(*model.OutgoingWebhook) (*model.OutgoingWebhook, error)); ok { + return rf(hook) + } if rf, ok := ret.Get(0).(func(*model.OutgoingWebhook) *model.OutgoingWebhook); ok { r0 = rf(hook) } else { @@ -531,7 +589,6 @@ func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Outg } } - var r1 error if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok { r1 = rf(hook) } else { @@ -540,3 +597,18 @@ func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Outg return r0, r1 } + +type mockConstructorTestingTNewWebhookStore interface { + mock.TestingT + Cleanup(func()) +} + +// NewWebhookStore creates a new instance of WebhookStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewWebhookStore(t mockConstructorTestingTNewWebhookStore) *WebhookStore { + mock := &WebhookStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/channels/utils/mocks/LicenseValidatorIface.go b/server/channels/utils/mocks/LicenseValidatorIface.go index 9c0f9ab913..ae7196b201 100644 --- a/server/channels/utils/mocks/LicenseValidatorIface.go +++ b/server/channels/utils/mocks/LicenseValidatorIface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make misc-mocks`. @@ -19,6 +19,10 @@ func (_m *LicenseValidatorIface) LicenseFromBytes(licenseBytes []byte) (*model.L ret := _m.Called(licenseBytes) var r0 *model.License + var r1 *model.AppError + if rf, ok := ret.Get(0).(func([]byte) (*model.License, *model.AppError)); ok { + return rf(licenseBytes) + } if rf, ok := ret.Get(0).(func([]byte) *model.License); ok { r0 = rf(licenseBytes) } else { @@ -27,7 +31,6 @@ func (_m *LicenseValidatorIface) LicenseFromBytes(licenseBytes []byte) (*model.L } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func([]byte) *model.AppError); ok { r1 = rf(licenseBytes) } else { @@ -44,13 +47,16 @@ func (_m *LicenseValidatorIface) ValidateLicense(signed []byte) (bool, string) { ret := _m.Called(signed) var r0 bool + var r1 string + if rf, ok := ret.Get(0).(func([]byte) (bool, string)); ok { + return rf(signed) + } if rf, ok := ret.Get(0).(func([]byte) bool); ok { r0 = rf(signed) } else { r0 = ret.Get(0).(bool) } - var r1 string if rf, ok := ret.Get(1).(func([]byte) string); ok { r1 = rf(signed) } else { @@ -59,3 +65,18 @@ func (_m *LicenseValidatorIface) ValidateLicense(signed []byte) (bool, string) { return r0, r1 } + +type mockConstructorTestingTNewLicenseValidatorIface interface { + mock.TestingT + Cleanup(func()) +} + +// NewLicenseValidatorIface creates a new instance of LicenseValidatorIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLicenseValidatorIface(t mockConstructorTestingTNewLicenseValidatorIface) *LicenseValidatorIface { + mock := &LicenseValidatorIface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/services/searchengine/mocks/SearchEngineInterface.go b/server/platform/services/searchengine/mocks/SearchEngineInterface.go index 433d9bbf2a..db9ddfcb97 100644 --- a/server/platform/services/searchengine/mocks/SearchEngineInterface.go +++ b/server/platform/services/searchengine/mocks/SearchEngineInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make searchengine-mocks`. @@ -405,6 +405,10 @@ func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, te ret := _m.Called(teamId, userID, term, isGuest) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, string, bool) ([]string, *model.AppError)); ok { + return rf(teamId, userID, term, isGuest) + } if rf, ok := ret.Get(0).(func(string, string, string, bool) []string); ok { r0 = rf(teamId, userID, term, isGuest) } else { @@ -413,7 +417,6 @@ func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, te } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, string, string, bool) *model.AppError); ok { r1 = rf(teamId, userID, term, isGuest) } else { @@ -430,6 +433,10 @@ func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchP ret := _m.Called(channels, searchParams, page, perPage) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) ([]string, *model.AppError)); ok { + return rf(channels, searchParams, page, perPage) + } if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) []string); ok { r0 = rf(channels, searchParams, page, perPage) } else { @@ -438,7 +445,6 @@ func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchP } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(model.ChannelList, []*model.SearchParams, int, int) *model.AppError); ok { r1 = rf(channels, searchParams, page, perPage) } else { @@ -455,6 +461,11 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP ret := _m.Called(channels, searchParams, page, perPage) var r0 []string + var r1 model.PostSearchMatches + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) ([]string, model.PostSearchMatches, *model.AppError)); ok { + return rf(channels, searchParams, page, perPage) + } if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) []string); ok { r0 = rf(channels, searchParams, page, perPage) } else { @@ -463,7 +474,6 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP } } - var r1 model.PostSearchMatches if rf, ok := ret.Get(1).(func(model.ChannelList, []*model.SearchParams, int, int) model.PostSearchMatches); ok { r1 = rf(channels, searchParams, page, perPage) } else { @@ -472,7 +482,6 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP } } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(model.ChannelList, []*model.SearchParams, int, int) *model.AppError); ok { r2 = rf(channels, searchParams, page, perPage) } else { @@ -489,6 +498,11 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s ret := _m.Called(teamId, channelId, restrictedToChannels, term, options) var r0 []string + var r1 []string + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(string, string, []string, string, *model.UserSearchOptions) ([]string, []string, *model.AppError)); ok { + return rf(teamId, channelId, restrictedToChannels, term, options) + } if rf, ok := ret.Get(0).(func(string, string, []string, string, *model.UserSearchOptions) []string); ok { r0 = rf(teamId, channelId, restrictedToChannels, term, options) } else { @@ -497,7 +511,6 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s } } - var r1 []string if rf, ok := ret.Get(1).(func(string, string, []string, string, *model.UserSearchOptions) []string); ok { r1 = rf(teamId, channelId, restrictedToChannels, term, options) } else { @@ -506,7 +519,6 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s } } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(string, string, []string, string, *model.UserSearchOptions) *model.AppError); ok { r2 = rf(teamId, channelId, restrictedToChannels, term, options) } else { @@ -523,6 +535,10 @@ func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToCh ret := _m.Called(teamId, restrictedToChannels, term, options) var r0 []string + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, []string, string, *model.UserSearchOptions) ([]string, *model.AppError)); ok { + return rf(teamId, restrictedToChannels, term, options) + } if rf, ok := ret.Get(0).(func(string, []string, string, *model.UserSearchOptions) []string); ok { r0 = rf(teamId, restrictedToChannels, term, options) } else { @@ -531,7 +547,6 @@ func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToCh } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, []string, string, *model.UserSearchOptions) *model.AppError); ok { r1 = rf(teamId, restrictedToChannels, term, options) } else { @@ -595,3 +610,18 @@ func (_m *SearchEngineInterface) TestConfig(cfg *model.Config) *model.AppError { func (_m *SearchEngineInterface) UpdateConfig(cfg *model.Config) { _m.Called(cfg) } + +type mockConstructorTestingTNewSearchEngineInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewSearchEngineInterface creates a new instance of SearchEngineInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSearchEngineInterface(t mockConstructorTestingTNewSearchEngineInterface) *SearchEngineInterface { + mock := &SearchEngineInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/services/sharedchannel/mock_AppIface_test.go b/server/platform/services/sharedchannel/mock_AppIface_test.go index 50e3ccab83..eddbedf08a 100644 --- a/server/platform/services/sharedchannel/mock_AppIface_test.go +++ b/server/platform/services/sharedchannel/mock_AppIface_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make sharedchannel-mocks`. @@ -23,6 +23,10 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe ret := _m.Called(c, user, channel, skipTeamMemberIntegrityCheck) var r0 *model.ChannelMember + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) (*model.ChannelMember, *model.AppError)); ok { + return rf(c, user, channel, skipTeamMemberIntegrityCheck) + } if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) *model.ChannelMember); ok { r0 = rf(c, user, channel, skipTeamMemberIntegrityCheck) } else { @@ -31,7 +35,6 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, *model.User, *model.Channel, bool) *model.AppError); ok { r1 = rf(c, user, channel, skipTeamMemberIntegrityCheck) } else { @@ -64,6 +67,10 @@ func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Chan ret := _m.Called(c, channel, userId) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) (*model.Channel, *model.AppError)); ok { + return rf(c, channel, userId) + } if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) *model.Channel); ok { r0 = rf(c, channel, userId) } else { @@ -72,7 +79,6 @@ func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Chan } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, string) *model.AppError); ok { r1 = rf(c, channel, userId) } else { @@ -89,6 +95,10 @@ func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *mod ret := _m.Called(c, post, channel, triggerWebhooks, setOnline) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, bool, bool) (*model.Post, *model.AppError)); ok { + return rf(c, post, channel, triggerWebhooks, setOnline) + } if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, bool, bool) *model.Post); ok { r0 = rf(c, post, channel, triggerWebhooks, setOnline) } else { @@ -97,7 +107,6 @@ func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *mod } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.Channel, bool, bool) *model.AppError); ok { r1 = rf(c, post, channel, triggerWebhooks, setOnline) } else { @@ -114,6 +123,10 @@ func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSessi ret := _m.Called(c, us) var r0 *model.UploadSession + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) (*model.UploadSession, *model.AppError)); ok { + return rf(c, us) + } if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) *model.UploadSession); ok { r0 = rf(c, us) } else { @@ -122,7 +135,6 @@ func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSessi } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, *model.UploadSession) *model.AppError); ok { r1 = rf(c, us) } else { @@ -139,6 +151,10 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri ret := _m.Called(c, postID, deleteByID) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.Post, *model.AppError)); ok { + return rf(c, postID, deleteByID) + } if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.Post); ok { r0 = rf(c, postID, deleteByID) } else { @@ -147,7 +163,6 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok { r1 = rf(c, postID, deleteByID) } else { @@ -180,6 +195,10 @@ func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *mod ret := _m.Called(path) var r0 filestore.ReadCloseSeeker + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string) (filestore.ReadCloseSeeker, *model.AppError)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok { r0 = rf(path) } else { @@ -188,7 +207,6 @@ func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *mod } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { r1 = rf(path) } else { @@ -212,6 +230,10 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o ret := _m.Called(_ca...) var r0 *model.Channel + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) (*model.Channel, *model.AppError)); ok { + return rf(c, userId, otherUserId, channelOptions...) + } if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) *model.Channel); ok { r0 = rf(c, userId, otherUserId, channelOptions...) } else { @@ -220,7 +242,6 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, string, string, ...model.ChannelOption) *model.AppError); ok { r1 = rf(c, userId, otherUserId, channelOptions...) } else { @@ -237,6 +258,11 @@ func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model. ret := _m.Called(user) var r0 []byte + var r1 bool + var r2 *model.AppError + if rf, ok := ret.Get(0).(func(*model.User) ([]byte, bool, *model.AppError)); ok { + return rf(user) + } if rf, ok := ret.Get(0).(func(*model.User) []byte); ok { r0 = rf(user) } else { @@ -245,14 +271,12 @@ func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model. } } - var r1 bool if rf, ok := ret.Get(1).(func(*model.User) bool); ok { r1 = rf(user) } else { r1 = ret.Get(1).(bool) } - var r2 *model.AppError if rf, ok := ret.Get(2).(func(*model.User) *model.AppError); ok { r2 = rf(user) } else { @@ -295,6 +319,10 @@ func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel ret := _m.Called(c, channel, channelModerationsPatch) var r0 []*model.ChannelModeration + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError)); ok { + return rf(c, channel, channelModerationsPatch) + } if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) []*model.ChannelModeration); ok { r0 = rf(c, channel, channelModerationsPatch) } else { @@ -303,7 +331,6 @@ func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) *model.AppError); ok { r1 = rf(c, channel, channelModerationsPatch) } else { @@ -336,6 +363,10 @@ func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model. ret := _m.Called(c, reaction) var r0 *model.Reaction + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) (*model.Reaction, *model.AppError)); ok { + return rf(c, reaction) + } if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) *model.Reaction); ok { r0 = rf(c, reaction) } else { @@ -344,7 +375,6 @@ func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model. } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*request.Context, *model.Reaction) *model.AppError); ok { r1 = rf(c, reaction) } else { @@ -377,6 +407,10 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd ret := _m.Called(c, post, safeUpdate) var r0 *model.Post + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) (*model.Post, *model.AppError)); ok { + return rf(c, post, safeUpdate) + } if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) *model.Post); ok { r0 = rf(c, post, safeUpdate) } else { @@ -385,7 +419,6 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(*request.Context, *model.Post, bool) *model.AppError); ok { r1 = rf(c, post, safeUpdate) } else { @@ -396,3 +429,18 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd return r0, r1 } + +type mockConstructorTestingTNewMockAppIface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockAppIface creates a new instance of MockAppIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockAppIface(t mockConstructorTestingTNewMockAppIface) *MockAppIface { + mock := &MockAppIface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/services/sharedchannel/mock_ServerIface_test.go b/server/platform/services/sharedchannel/mock_ServerIface_test.go index 6513e56560..9643eef0a0 100644 --- a/server/platform/services/sharedchannel/mock_ServerIface_test.go +++ b/server/platform/services/sharedchannel/mock_ServerIface_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make sharedchannel-mocks`. @@ -116,3 +116,18 @@ func (_m *MockServerIface) Log() *mlog.Logger { func (_m *MockServerIface) RemoveClusterLeaderChangedListener(id string) { _m.Called(id) } + +type mockConstructorTestingTNewMockServerIface interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockServerIface creates a new instance of MockServerIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockServerIface(t mockConstructorTestingTNewMockServerIface) *MockServerIface { + mock := &MockServerIface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/services/telemetry/mocks/ServerIface.go b/server/platform/services/telemetry/mocks/ServerIface.go index 97ba9458ff..df271fa334 100644 --- a/server/platform/services/telemetry/mocks/ServerIface.go +++ b/server/platform/services/telemetry/mocks/ServerIface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make telemetry-mocks`. @@ -59,6 +59,10 @@ func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Ro ret := _m.Called(_a0, _a1) var r0 *model.Role + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(context.Context, string) (*model.Role, *model.AppError)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) *model.Role); ok { r0 = rf(_a0, _a1) } else { @@ -67,7 +71,6 @@ func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Ro } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(context.Context, string) *model.AppError); ok { r1 = rf(_a0, _a1) } else { @@ -84,6 +87,10 @@ func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme ret := _m.Called(_a0, _a1, _a2) var r0 []*model.Scheme + var r1 *model.AppError + if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Scheme, *model.AppError)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(string, int, int) []*model.Scheme); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -92,7 +99,6 @@ func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme } } - var r1 *model.AppError if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -165,3 +171,18 @@ func (_m *ServerIface) License() *model.License { return r0 } + +type mockConstructorTestingTNewServerIface interface { + mock.TestingT + Cleanup(func()) +} + +// NewServerIface creates a new instance of ServerIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewServerIface(t mockConstructorTestingTNewServerIface) *ServerIface { + mock := &ServerIface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/shared/filestore/mocks/FileBackend.go b/server/platform/shared/filestore/mocks/FileBackend.go index ec1c4240d1..aecaee75fc 100644 --- a/server/platform/shared/filestore/mocks/FileBackend.go +++ b/server/platform/shared/filestore/mocks/FileBackend.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make filestore-mocks`. @@ -24,13 +24,16 @@ func (_m *FileBackend) AppendFile(fr io.Reader, path string) (int64, error) { ret := _m.Called(fr, path) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(io.Reader, string) (int64, error)); ok { + return rf(fr, path) + } if rf, ok := ret.Get(0).(func(io.Reader, string) int64); ok { r0 = rf(fr, path) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(io.Reader, string) error); ok { r1 = rf(fr, path) } else { @@ -59,13 +62,16 @@ func (_m *FileBackend) FileExists(path string) (bool, error) { ret := _m.Called(path) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(string) (bool, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) bool); ok { r0 = rf(path) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -80,13 +86,16 @@ func (_m *FileBackend) FileModTime(path string) (time.Time, error) { ret := _m.Called(path) var r0 time.Time + var r1 error + if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) time.Time); ok { r0 = rf(path) } else { r0 = ret.Get(0).(time.Time) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -101,13 +110,16 @@ func (_m *FileBackend) FileSize(path string) (int64, error) { ret := _m.Called(path) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) int64); ok { r0 = rf(path) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -122,6 +134,10 @@ func (_m *FileBackend) ListDirectory(path string) ([]string, error) { ret := _m.Called(path) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(path) } else { @@ -130,7 +146,6 @@ func (_m *FileBackend) ListDirectory(path string) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -145,6 +160,10 @@ func (_m *FileBackend) ListDirectoryRecursively(path string) ([]string, error) { ret := _m.Called(path) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(path) } else { @@ -153,7 +172,6 @@ func (_m *FileBackend) ListDirectoryRecursively(path string) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -182,6 +200,10 @@ func (_m *FileBackend) ReadFile(path string) ([]byte, error) { ret := _m.Called(path) var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(path) } else { @@ -190,7 +212,6 @@ func (_m *FileBackend) ReadFile(path string) ([]byte, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -205,6 +226,10 @@ func (_m *FileBackend) Reader(path string) (filestore.ReadCloseSeeker, error) { ret := _m.Called(path) var r0 filestore.ReadCloseSeeker + var r1 error + if rf, ok := ret.Get(0).(func(string) (filestore.ReadCloseSeeker, error)); ok { + return rf(path) + } if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok { r0 = rf(path) } else { @@ -213,7 +238,6 @@ func (_m *FileBackend) Reader(path string) (filestore.ReadCloseSeeker, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(path) } else { @@ -270,13 +294,16 @@ func (_m *FileBackend) WriteFile(fr io.Reader, path string) (int64, error) { ret := _m.Called(fr, path) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(io.Reader, string) (int64, error)); ok { + return rf(fr, path) + } if rf, ok := ret.Get(0).(func(io.Reader, string) int64); ok { r0 = rf(fr, path) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(io.Reader, string) error); ok { r1 = rf(fr, path) } else { @@ -285,3 +312,18 @@ func (_m *FileBackend) WriteFile(fr io.Reader, path string) (int64, error) { return r0, r1 } + +type mockConstructorTestingTNewFileBackend interface { + mock.TestingT + Cleanup(func()) +} + +// NewFileBackend creates a new instance of FileBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewFileBackend(t mockConstructorTestingTNewFileBackend) *FileBackend { + mock := &FileBackend{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/platform/shared/filestore/mocks/ReadCloseSeeker.go b/server/platform/shared/filestore/mocks/ReadCloseSeeker.go index f075c8a0ce..42ace6c2bf 100644 --- a/server/platform/shared/filestore/mocks/ReadCloseSeeker.go +++ b/server/platform/shared/filestore/mocks/ReadCloseSeeker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.4. DO NOT EDIT. +// Code generated by mockery v2.23.2. DO NOT EDIT. // Regenerate this file using `make filestore-mocks`. @@ -30,13 +30,16 @@ func (_m *ReadCloseSeeker) Read(p []byte) (int, error) { ret := _m.Called(p) var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } if rf, ok := ret.Get(0).(func([]byte) int); ok { r0 = rf(p) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(p) } else { @@ -51,13 +54,16 @@ func (_m *ReadCloseSeeker) Seek(offset int64, whence int) (int64, error) { ret := _m.Called(offset, whence) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(int64, int) (int64, error)); ok { + return rf(offset, whence) + } if rf, ok := ret.Get(0).(func(int64, int) int64); ok { r0 = rf(offset, whence) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(int64, int) error); ok { r1 = rf(offset, whence) } else { @@ -66,3 +72,18 @@ func (_m *ReadCloseSeeker) Seek(offset int64, whence int) (int64, error) { return r0, r1 } + +type mockConstructorTestingTNewReadCloseSeeker interface { + mock.TestingT + Cleanup(func()) +} + +// NewReadCloseSeeker creates a new instance of ReadCloseSeeker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewReadCloseSeeker(t mockConstructorTestingTNewReadCloseSeeker) *ReadCloseSeeker { + mock := &ReadCloseSeeker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}