MM-57759: Added mockery support for 1.22 (#26774)

* Revert "Revert "MM-57759: Bump mockery to version 2.42.2 to support go  1.22^" (#26772)"

This reverts commit cd3b5b46e1.

* Added the hooks.go file changes as well

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-04-13 08:15:59 +05:30
коммит произвёл GitHub
родитель 96ab35ba34
Коммит 870cee30c6
84 изменённых файлов: 5382 добавлений и 504 удалений

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Code generated by mockery v2.42.2. DO NOT EDIT.
// Regenerate this file using `make searchengine-mocks`.
@@ -21,6 +21,10 @@ type SearchEngineInterface struct {
func (_m *SearchEngineInterface) DataRetentionDeleteIndexes(rctx request.CTX, cutoff time.Time) *model.AppError {
ret := _m.Called(rctx, cutoff)
if len(ret) == 0 {
panic("no return value specified for DataRetentionDeleteIndexes")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, time.Time) *model.AppError); ok {
r0 = rf(rctx, cutoff)
@@ -37,6 +41,10 @@ func (_m *SearchEngineInterface) DataRetentionDeleteIndexes(rctx request.CTX, cu
func (_m *SearchEngineInterface) DeleteChannel(channel *model.Channel) *model.AppError {
ret := _m.Called(channel)
if len(ret) == 0 {
panic("no return value specified for DeleteChannel")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(*model.Channel) *model.AppError); ok {
r0 = rf(channel)
@@ -53,6 +61,10 @@ func (_m *SearchEngineInterface) DeleteChannel(channel *model.Channel) *model.Ap
func (_m *SearchEngineInterface) DeleteChannelPosts(rctx request.CTX, channelID string) *model.AppError {
ret := _m.Called(rctx, channelID)
if len(ret) == 0 {
panic("no return value specified for DeleteChannelPosts")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
r0 = rf(rctx, channelID)
@@ -69,6 +81,10 @@ func (_m *SearchEngineInterface) DeleteChannelPosts(rctx request.CTX, channelID
func (_m *SearchEngineInterface) DeleteFile(fileID string) *model.AppError {
ret := _m.Called(fileID)
if len(ret) == 0 {
panic("no return value specified for DeleteFile")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
r0 = rf(fileID)
@@ -85,6 +101,10 @@ func (_m *SearchEngineInterface) DeleteFile(fileID string) *model.AppError {
func (_m *SearchEngineInterface) DeleteFilesBatch(rctx request.CTX, endTime int64, limit int64) *model.AppError {
ret := _m.Called(rctx, endTime, limit)
if len(ret) == 0 {
panic("no return value specified for DeleteFilesBatch")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64) *model.AppError); ok {
r0 = rf(rctx, endTime, limit)
@@ -101,6 +121,10 @@ func (_m *SearchEngineInterface) DeleteFilesBatch(rctx request.CTX, endTime int6
func (_m *SearchEngineInterface) DeletePost(post *model.Post) *model.AppError {
ret := _m.Called(post)
if len(ret) == 0 {
panic("no return value specified for DeletePost")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(*model.Post) *model.AppError); ok {
r0 = rf(post)
@@ -117,6 +141,10 @@ func (_m *SearchEngineInterface) DeletePost(post *model.Post) *model.AppError {
func (_m *SearchEngineInterface) DeletePostFiles(rctx request.CTX, postID string) *model.AppError {
ret := _m.Called(rctx, postID)
if len(ret) == 0 {
panic("no return value specified for DeletePostFiles")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
r0 = rf(rctx, postID)
@@ -133,6 +161,10 @@ func (_m *SearchEngineInterface) DeletePostFiles(rctx request.CTX, postID string
func (_m *SearchEngineInterface) DeleteUser(user *model.User) *model.AppError {
ret := _m.Called(user)
if len(ret) == 0 {
panic("no return value specified for DeleteUser")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(*model.User) *model.AppError); ok {
r0 = rf(user)
@@ -149,6 +181,10 @@ func (_m *SearchEngineInterface) DeleteUser(user *model.User) *model.AppError {
func (_m *SearchEngineInterface) DeleteUserFiles(rctx request.CTX, userID string) *model.AppError {
ret := _m.Called(rctx, userID)
if len(ret) == 0 {
panic("no return value specified for DeleteUserFiles")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
r0 = rf(rctx, userID)
@@ -165,6 +201,10 @@ func (_m *SearchEngineInterface) DeleteUserFiles(rctx request.CTX, userID string
func (_m *SearchEngineInterface) DeleteUserPosts(rctx request.CTX, userID string) *model.AppError {
ret := _m.Called(rctx, userID)
if len(ret) == 0 {
panic("no return value specified for DeleteUserPosts")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
r0 = rf(rctx, userID)
@@ -181,6 +221,10 @@ func (_m *SearchEngineInterface) DeleteUserPosts(rctx request.CTX, userID string
func (_m *SearchEngineInterface) GetFullVersion() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetFullVersion")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
@@ -195,6 +239,10 @@ func (_m *SearchEngineInterface) GetFullVersion() string {
func (_m *SearchEngineInterface) GetName() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetName")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
@@ -209,6 +257,10 @@ func (_m *SearchEngineInterface) GetName() string {
func (_m *SearchEngineInterface) GetPlugins() []string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetPlugins")
}
var r0 []string
if rf, ok := ret.Get(0).(func() []string); ok {
r0 = rf()
@@ -225,6 +277,10 @@ func (_m *SearchEngineInterface) GetPlugins() []string {
func (_m *SearchEngineInterface) GetVersion() int {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetVersion")
}
var r0 int
if rf, ok := ret.Get(0).(func() int); ok {
r0 = rf()
@@ -239,6 +295,10 @@ func (_m *SearchEngineInterface) GetVersion() int {
func (_m *SearchEngineInterface) IndexChannel(rctx request.CTX, channel *model.Channel, userIDs []string, teamMemberIDs []string) *model.AppError {
ret := _m.Called(rctx, channel, userIDs, teamMemberIDs)
if len(ret) == 0 {
panic("no return value specified for IndexChannel")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []string, []string) *model.AppError); ok {
r0 = rf(rctx, channel, userIDs, teamMemberIDs)
@@ -255,6 +315,10 @@ func (_m *SearchEngineInterface) IndexChannel(rctx request.CTX, channel *model.C
func (_m *SearchEngineInterface) IndexFile(file *model.FileInfo, channelId string) *model.AppError {
ret := _m.Called(file, channelId)
if len(ret) == 0 {
panic("no return value specified for IndexFile")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(*model.FileInfo, string) *model.AppError); ok {
r0 = rf(file, channelId)
@@ -271,6 +335,10 @@ func (_m *SearchEngineInterface) IndexFile(file *model.FileInfo, channelId strin
func (_m *SearchEngineInterface) IndexPost(post *model.Post, teamId string) *model.AppError {
ret := _m.Called(post, teamId)
if len(ret) == 0 {
panic("no return value specified for IndexPost")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(*model.Post, string) *model.AppError); ok {
r0 = rf(post, teamId)
@@ -287,6 +355,10 @@ func (_m *SearchEngineInterface) IndexPost(post *model.Post, teamId string) *mod
func (_m *SearchEngineInterface) IndexUser(rctx request.CTX, user *model.User, teamsIds []string, channelsIds []string) *model.AppError {
ret := _m.Called(rctx, user, teamsIds, channelsIds)
if len(ret) == 0 {
panic("no return value specified for IndexUser")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, []string, []string) *model.AppError); ok {
r0 = rf(rctx, user, teamsIds, channelsIds)
@@ -303,6 +375,10 @@ func (_m *SearchEngineInterface) IndexUser(rctx request.CTX, user *model.User, t
func (_m *SearchEngineInterface) IsActive() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsActive")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -317,6 +393,10 @@ func (_m *SearchEngineInterface) IsActive() bool {
func (_m *SearchEngineInterface) IsAutocompletionEnabled() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsAutocompletionEnabled")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -331,6 +411,10 @@ func (_m *SearchEngineInterface) IsAutocompletionEnabled() bool {
func (_m *SearchEngineInterface) IsChannelsIndexVerified() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsChannelsIndexVerified")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -345,6 +429,10 @@ func (_m *SearchEngineInterface) IsChannelsIndexVerified() bool {
func (_m *SearchEngineInterface) IsEnabled() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsEnabled")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -359,6 +447,10 @@ func (_m *SearchEngineInterface) IsEnabled() bool {
func (_m *SearchEngineInterface) IsIndexingEnabled() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsIndexingEnabled")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -373,6 +465,10 @@ func (_m *SearchEngineInterface) IsIndexingEnabled() bool {
func (_m *SearchEngineInterface) IsIndexingSync() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsIndexingSync")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -387,6 +483,10 @@ func (_m *SearchEngineInterface) IsIndexingSync() bool {
func (_m *SearchEngineInterface) IsSearchEnabled() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsSearchEnabled")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -401,6 +501,10 @@ func (_m *SearchEngineInterface) IsSearchEnabled() bool {
func (_m *SearchEngineInterface) PurgeIndexList(rctx request.CTX, indexes []string) *model.AppError {
ret := _m.Called(rctx, indexes)
if len(ret) == 0 {
panic("no return value specified for PurgeIndexList")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, []string) *model.AppError); ok {
r0 = rf(rctx, indexes)
@@ -417,6 +521,10 @@ func (_m *SearchEngineInterface) PurgeIndexList(rctx request.CTX, indexes []stri
func (_m *SearchEngineInterface) PurgeIndexes(rctx request.CTX) *model.AppError {
ret := _m.Called(rctx)
if len(ret) == 0 {
panic("no return value specified for PurgeIndexes")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX) *model.AppError); ok {
r0 = rf(rctx)
@@ -433,6 +541,10 @@ func (_m *SearchEngineInterface) PurgeIndexes(rctx request.CTX) *model.AppError
func (_m *SearchEngineInterface) RefreshIndexes(rctx request.CTX) *model.AppError {
ret := _m.Called(rctx)
if len(ret) == 0 {
panic("no return value specified for RefreshIndexes")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX) *model.AppError); ok {
r0 = rf(rctx)
@@ -449,6 +561,10 @@ func (_m *SearchEngineInterface) RefreshIndexes(rctx request.CTX) *model.AppErro
func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, term string, isGuest bool) ([]string, *model.AppError) {
ret := _m.Called(teamId, userID, term, isGuest)
if len(ret) == 0 {
panic("no return value specified for SearchChannels")
}
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, string, string, bool) ([]string, *model.AppError)); ok {
@@ -477,6 +593,10 @@ func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, te
func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchParams []*model.SearchParams, page int, perPage int) ([]string, *model.AppError) {
ret := _m.Called(channels, searchParams, page, perPage)
if len(ret) == 0 {
panic("no return value specified for SearchFiles")
}
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) ([]string, *model.AppError)); ok {
@@ -505,6 +625,10 @@ func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchP
func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchParams []*model.SearchParams, page int, perPage int) ([]string, model.PostSearchMatches, *model.AppError) {
ret := _m.Called(channels, searchParams, page, perPage)
if len(ret) == 0 {
panic("no return value specified for SearchPosts")
}
var r0 []string
var r1 model.PostSearchMatches
var r2 *model.AppError
@@ -542,6 +666,10 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP
func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId string, restrictedToChannels []string, term string, options *model.UserSearchOptions) ([]string, []string, *model.AppError) {
ret := _m.Called(teamId, channelId, restrictedToChannels, term, options)
if len(ret) == 0 {
panic("no return value specified for SearchUsersInChannel")
}
var r0 []string
var r1 []string
var r2 *model.AppError
@@ -579,6 +707,10 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s
func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToChannels []string, term string, options *model.UserSearchOptions) ([]string, *model.AppError) {
ret := _m.Called(teamId, restrictedToChannels, term, options)
if len(ret) == 0 {
panic("no return value specified for SearchUsersInTeam")
}
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, []string, string, *model.UserSearchOptions) ([]string, *model.AppError)); ok {
@@ -607,6 +739,10 @@ func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToCh
func (_m *SearchEngineInterface) Start() *model.AppError {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Start")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
r0 = rf()
@@ -623,6 +759,10 @@ func (_m *SearchEngineInterface) Start() *model.AppError {
func (_m *SearchEngineInterface) Stop() *model.AppError {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Stop")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
r0 = rf()
@@ -639,6 +779,10 @@ func (_m *SearchEngineInterface) Stop() *model.AppError {
func (_m *SearchEngineInterface) TestConfig(rctx request.CTX, cfg *model.Config) *model.AppError {
ret := _m.Called(rctx, cfg)
if len(ret) == 0 {
panic("no return value specified for TestConfig")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config) *model.AppError); ok {
r0 = rf(rctx, cfg)
@@ -656,13 +800,12 @@ func (_m *SearchEngineInterface) UpdateConfig(cfg *model.Config) {
_m.Called(cfg)
}
type mockConstructorTestingTNewSearchEngineInterface interface {
// 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.
// The first argument is typically a *testing.T value.
func NewSearchEngineInterface(t 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 {
}) *SearchEngineInterface {
mock := &SearchEngineInterface{}
mock.Mock.Test(t)

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Code generated by mockery v2.42.2. DO NOT EDIT.
// Regenerate this file using `make sharedchannel-mocks`.
@@ -22,6 +22,10 @@ type MockAppIface struct {
func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError) {
ret := _m.Called(c, user, channel, skipTeamMemberIntegrityCheck)
if len(ret) == 0 {
panic("no return value specified for AddUserToChannel")
}
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 {
@@ -50,6 +54,10 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe
func (_m *MockAppIface) AddUserToTeamByTeamId(c request.CTX, teamId string, user *model.User) *model.AppError {
ret := _m.Called(c, teamId, user)
if len(ret) == 0 {
panic("no return value specified for AddUserToTeamByTeamId")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.User) *model.AppError); ok {
r0 = rf(c, teamId, user)
@@ -66,6 +74,10 @@ func (_m *MockAppIface) AddUserToTeamByTeamId(c request.CTX, teamId string, user
func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Channel, userId string) (*model.Channel, *model.AppError) {
ret := _m.Called(c, channel, userId)
if len(ret) == 0 {
panic("no return value specified for CreateChannelWithUser")
}
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 {
@@ -94,6 +106,10 @@ func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Chan
func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (*model.Post, *model.AppError) {
ret := _m.Called(c, post, channel, triggerWebhooks, setOnline)
if len(ret) == 0 {
panic("no return value specified for CreatePost")
}
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 {
@@ -122,6 +138,10 @@ func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *mod
func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSession) (*model.UploadSession, *model.AppError) {
ret := _m.Called(c, us)
if len(ret) == 0 {
panic("no return value specified for CreateUploadSession")
}
var r0 *model.UploadSession
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) (*model.UploadSession, *model.AppError)); ok {
@@ -150,6 +170,10 @@ func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSessi
func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID string) (*model.Post, *model.AppError) {
ret := _m.Called(c, postID, deleteByID)
if len(ret) == 0 {
panic("no return value specified for DeletePost")
}
var r0 *model.Post
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.Post, *model.AppError)); ok {
@@ -178,6 +202,10 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri
func (_m *MockAppIface) DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError {
ret := _m.Called(c, reaction)
if len(ret) == 0 {
panic("no return value specified for DeleteReactionForPost")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.AppError); ok {
r0 = rf(c, reaction)
@@ -194,6 +222,10 @@ func (_m *MockAppIface) DeleteReactionForPost(c request.CTX, reaction *model.Rea
func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) {
ret := _m.Called(path)
if len(ret) == 0 {
panic("no return value specified for FileReader")
}
var r0 filestore.ReadCloseSeeker
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string) (filestore.ReadCloseSeeker, *model.AppError)); ok {
@@ -229,6 +261,10 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for GetOrCreateDirectChannel")
}
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 {
@@ -257,6 +293,10 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o
func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) {
ret := _m.Called(user)
if len(ret) == 0 {
panic("no return value specified for GetProfileImage")
}
var r0 []byte
var r1 bool
var r2 *model.AppError
@@ -292,6 +332,10 @@ func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model.
func (_m *MockAppIface) MentionsToTeamMembers(c request.CTX, message string, teamID string) model.UserMentionMap {
ret := _m.Called(c, message, teamID)
if len(ret) == 0 {
panic("no return value specified for MentionsToTeamMembers")
}
var r0 model.UserMentionMap
if rf, ok := ret.Get(0).(func(request.CTX, string, string) model.UserMentionMap); ok {
r0 = rf(c, message, teamID)
@@ -313,6 +357,10 @@ func (_m *MockAppIface) NotifySharedChannelUserUpdate(user *model.User) {
func (_m *MockAppIface) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error {
ret := _m.Called(fi, post, rc)
if len(ret) == 0 {
panic("no return value specified for OnSharedChannelsAttachmentSyncMsg")
}
var r0 error
if rf, ok := ret.Get(0).(func(*model.FileInfo, *model.Post, *model.RemoteCluster) error); ok {
r0 = rf(fi, post, rc)
@@ -327,6 +375,10 @@ func (_m *MockAppIface) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, po
func (_m *MockAppIface) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error {
ret := _m.Called(user, rc)
if len(ret) == 0 {
panic("no return value specified for OnSharedChannelsProfileImageSyncMsg")
}
var r0 error
if rf, ok := ret.Get(0).(func(*model.User, *model.RemoteCluster) error); ok {
r0 = rf(user, rc)
@@ -341,6 +393,10 @@ func (_m *MockAppIface) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc
func (_m *MockAppIface) OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error) {
ret := _m.Called(msg, rc)
if len(ret) == 0 {
panic("no return value specified for OnSharedChannelsSyncMsg")
}
var r0 model.SyncResponse
var r1 error
if rf, ok := ret.Get(0).(func(*model.SyncMsg, *model.RemoteCluster) (model.SyncResponse, error)); ok {
@@ -365,6 +421,10 @@ func (_m *MockAppIface) OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.Re
func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) {
ret := _m.Called(c, channel, channelModerationsPatch)
if len(ret) == 0 {
panic("no return value specified for PatchChannelModerationsForChannel")
}
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 {
@@ -393,6 +453,10 @@ func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel
func (_m *MockAppIface) PermanentDeleteChannel(c request.CTX, channel *model.Channel) *model.AppError {
ret := _m.Called(c, channel)
if len(ret) == 0 {
panic("no return value specified for PermanentDeleteChannel")
}
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel) *model.AppError); ok {
r0 = rf(c, channel)
@@ -414,6 +478,10 @@ func (_m *MockAppIface) Publish(message *model.WebSocketEvent) {
func (_m *MockAppIface) SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
ret := _m.Called(c, reaction)
if len(ret) == 0 {
panic("no return value specified for SaveReactionForPost")
}
var r0 *model.Reaction
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) (*model.Reaction, *model.AppError)); ok {
@@ -442,6 +510,10 @@ func (_m *MockAppIface) SaveReactionForPost(c request.CTX, reaction *model.React
func (_m *MockAppIface) SendEphemeralPost(c request.CTX, userId string, post *model.Post) *model.Post {
ret := _m.Called(c, userId, post)
if len(ret) == 0 {
panic("no return value specified for SendEphemeralPost")
}
var r0 *model.Post
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.Post) *model.Post); ok {
r0 = rf(c, userId, post)
@@ -458,6 +530,10 @@ func (_m *MockAppIface) SendEphemeralPost(c request.CTX, userId string, post *mo
func (_m *MockAppIface) UpdatePost(c request.CTX, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
ret := _m.Called(c, post, safeUpdate)
if len(ret) == 0 {
panic("no return value specified for UpdatePost")
}
var r0 *model.Post
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, bool) (*model.Post, *model.AppError)); ok {
@@ -482,13 +558,12 @@ func (_m *MockAppIface) UpdatePost(c request.CTX, post *model.Post, safeUpdate b
return r0, r1
}
type mockConstructorTestingTNewMockAppIface interface {
// 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.
// The first argument is typically a *testing.T value.
func NewMockAppIface(t 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 {
}) *MockAppIface {
mock := &MockAppIface{}
mock.Mock.Test(t)

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Code generated by mockery v2.42.2. DO NOT EDIT.
// Regenerate this file using `make sharedchannel-mocks`.
@@ -26,6 +26,10 @@ type MockServerIface struct {
func (_m *MockServerIface) AddClusterLeaderChangedListener(listener func()) string {
ret := _m.Called(listener)
if len(ret) == 0 {
panic("no return value specified for AddClusterLeaderChangedListener")
}
var r0 string
if rf, ok := ret.Get(0).(func(func()) string); ok {
r0 = rf(listener)
@@ -40,6 +44,10 @@ func (_m *MockServerIface) AddClusterLeaderChangedListener(listener func()) stri
func (_m *MockServerIface) Config() *model.Config {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Config")
}
var r0 *model.Config
if rf, ok := ret.Get(0).(func() *model.Config); ok {
r0 = rf()
@@ -56,6 +64,10 @@ func (_m *MockServerIface) Config() *model.Config {
func (_m *MockServerIface) GetMetrics() einterfaces.MetricsInterface {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetMetrics")
}
var r0 einterfaces.MetricsInterface
if rf, ok := ret.Get(0).(func() einterfaces.MetricsInterface); ok {
r0 = rf()
@@ -72,6 +84,10 @@ func (_m *MockServerIface) GetMetrics() einterfaces.MetricsInterface {
func (_m *MockServerIface) GetRemoteClusterService() remotecluster.RemoteClusterServiceIFace {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetRemoteClusterService")
}
var r0 remotecluster.RemoteClusterServiceIFace
if rf, ok := ret.Get(0).(func() remotecluster.RemoteClusterServiceIFace); ok {
r0 = rf()
@@ -88,6 +104,10 @@ func (_m *MockServerIface) GetRemoteClusterService() remotecluster.RemoteCluster
func (_m *MockServerIface) GetStore() store.Store {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetStore")
}
var r0 store.Store
if rf, ok := ret.Get(0).(func() store.Store); ok {
r0 = rf()
@@ -104,6 +124,10 @@ func (_m *MockServerIface) GetStore() store.Store {
func (_m *MockServerIface) IsLeader() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsLeader")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -118,6 +142,10 @@ func (_m *MockServerIface) IsLeader() bool {
func (_m *MockServerIface) Log() *mlog.Logger {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Log")
}
var r0 *mlog.Logger
if rf, ok := ret.Get(0).(func() *mlog.Logger); ok {
r0 = rf()
@@ -135,13 +163,12 @@ func (_m *MockServerIface) RemoveClusterLeaderChangedListener(id string) {
_m.Called(id)
}
type mockConstructorTestingTNewMockServerIface interface {
// 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.
// The first argument is typically a *testing.T value.
func NewMockServerIface(t 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 {
}) *MockServerIface {
mock := &MockServerIface{}
mock.Mock.Test(t)

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Code generated by mockery v2.42.2. DO NOT EDIT.
// Regenerate this file using `make telemetry-mocks`.
@@ -24,6 +24,10 @@ type ServerIface struct {
func (_m *ServerIface) Config() *model.Config {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Config")
}
var r0 *model.Config
if rf, ok := ret.Get(0).(func() *model.Config); ok {
r0 = rf()
@@ -40,6 +44,10 @@ func (_m *ServerIface) Config() *model.Config {
func (_m *ServerIface) GetPluginsEnvironment() *plugin.Environment {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetPluginsEnvironment")
}
var r0 *plugin.Environment
if rf, ok := ret.Get(0).(func() *plugin.Environment); ok {
r0 = rf()
@@ -56,6 +64,10 @@ func (_m *ServerIface) GetPluginsEnvironment() *plugin.Environment {
func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Role, *model.AppError) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetRoleByName")
}
var r0 *model.Role
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(context.Context, string) (*model.Role, *model.AppError)); ok {
@@ -84,6 +96,10 @@ func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Ro
func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme, *model.AppError) {
ret := _m.Called(_a0, _a1, _a2)
if len(ret) == 0 {
panic("no return value specified for GetSchemes")
}
var r0 []*model.Scheme
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Scheme, *model.AppError)); ok {
@@ -112,6 +128,10 @@ func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme
func (_m *ServerIface) HTTPService() httpservice.HTTPService {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for HTTPService")
}
var r0 httpservice.HTTPService
if rf, ok := ret.Get(0).(func() httpservice.HTTPService); ok {
r0 = rf()
@@ -128,6 +148,10 @@ func (_m *ServerIface) HTTPService() httpservice.HTTPService {
func (_m *ServerIface) IsLeader() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsLeader")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
@@ -142,6 +166,10 @@ func (_m *ServerIface) IsLeader() bool {
func (_m *ServerIface) License() *model.License {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for License")
}
var r0 *model.License
if rf, ok := ret.Get(0).(func() *model.License); ok {
r0 = rf()
@@ -154,13 +182,12 @@ func (_m *ServerIface) License() *model.License {
return r0
}
type mockConstructorTestingTNewServerIface interface {
// 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.
// The first argument is typically a *testing.T value.
func NewServerIface(t 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 {
}) *ServerIface {
mock := &ServerIface{}
mock.Mock.Test(t)