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 plugin-mocks`.
@@ -29,6 +29,10 @@ func (_m *Hooks) ChannelHasBeenCreated(c *plugin.Context, channel *model.Channel
func (_m *Hooks) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error) {
ret := _m.Called(newCfg)
if len(ret) == 0 {
panic("no return value specified for ConfigurationWillBeSaved")
}
var r0 *model.Config
var r1 error
if rf, ok := ret.Get(0).(func(*model.Config) (*model.Config, error)); ok {
@@ -55,6 +59,10 @@ func (_m *Hooks) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config,
func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
ret := _m.Called(c, args)
if len(ret) == 0 {
panic("no return value specified for ExecuteCommand")
}
var r0 *model.CommandResponse
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.CommandArgs) (*model.CommandResponse, *model.AppError)); ok {
@@ -83,6 +91,10 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo
func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string) {
ret := _m.Called(c, info, file, output)
if len(ret) == 0 {
panic("no return value specified for FileWillBeUploaded")
}
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 {
@@ -109,6 +121,10 @@ func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, fil
func (_m *Hooks) GenerateSupportData(c *plugin.Context) ([]*model.FileData, error) {
ret := _m.Called(c)
if len(ret) == 0 {
panic("no return value specified for GenerateSupportData")
}
var r0 []*model.FileData
var r1 error
if rf, ok := ret.Get(0).(func(*plugin.Context) ([]*model.FileData, error)); ok {
@@ -135,6 +151,10 @@ func (_m *Hooks) GenerateSupportData(c *plugin.Context) ([]*model.FileData, erro
func (_m *Hooks) Implemented() ([]string, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Implemented")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func() ([]string, error)); ok {
@@ -176,6 +196,10 @@ func (_m *Hooks) MessageHasBeenUpdated(c *plugin.Context, newPost *model.Post, o
func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*model.Post, string) {
ret := _m.Called(c, post)
if len(ret) == 0 {
panic("no return value specified for MessageWillBePosted")
}
var r0 *model.Post
var r1 string
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) (*model.Post, string)); ok {
@@ -202,6 +226,10 @@ func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*mode
func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, oldPost *model.Post) (*model.Post, string) {
ret := _m.Called(c, newPost, oldPost)
if len(ret) == 0 {
panic("no return value specified for MessageWillBeUpdated")
}
var r0 *model.Post
var r1 string
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) (*model.Post, string)); ok {
@@ -228,6 +256,10 @@ func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, ol
func (_m *Hooks) MessagesWillBeConsumed(posts []*model.Post) []*model.Post {
ret := _m.Called(posts)
if len(ret) == 0 {
panic("no return value specified for MessagesWillBeConsumed")
}
var r0 []*model.Post
if rf, ok := ret.Get(0).(func([]*model.Post) []*model.Post); ok {
r0 = rf(posts)
@@ -244,6 +276,10 @@ func (_m *Hooks) MessagesWillBeConsumed(posts []*model.Post) []*model.Post {
func (_m *Hooks) NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string) {
ret := _m.Called(pushNotification, userID)
if len(ret) == 0 {
panic("no return value specified for NotificationWillBePushed")
}
var r0 *model.PushNotification
var r1 string
if rf, ok := ret.Get(0).(func(*model.PushNotification, string) (*model.PushNotification, string)); ok {
@@ -270,6 +306,10 @@ func (_m *Hooks) NotificationWillBePushed(pushNotification *model.PushNotificati
func (_m *Hooks) OnActivate() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for OnActivate")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
@@ -289,6 +329,10 @@ func (_m *Hooks) OnCloudLimitsUpdated(limits *model.ProductLimits) {
func (_m *Hooks) OnConfigurationChange() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for OnConfigurationChange")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
@@ -303,6 +347,10 @@ func (_m *Hooks) OnConfigurationChange() error {
func (_m *Hooks) OnDeactivate() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for OnDeactivate")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
@@ -317,6 +365,10 @@ func (_m *Hooks) OnDeactivate() error {
func (_m *Hooks) OnInstall(c *plugin.Context, event model.OnInstallEvent) error {
ret := _m.Called(c, event)
if len(ret) == 0 {
panic("no return value specified for OnInstall")
}
var r0 error
if rf, ok := ret.Get(0).(func(*plugin.Context, model.OnInstallEvent) error); ok {
r0 = rf(c, event)
@@ -341,6 +393,10 @@ func (_m *Hooks) OnSendDailyTelemetry() {
func (_m *Hooks) 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)
@@ -355,6 +411,10 @@ func (_m *Hooks) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *mod
func (_m *Hooks) OnSharedChannelsPing(rc *model.RemoteCluster) bool {
ret := _m.Called(rc)
if len(ret) == 0 {
panic("no return value specified for OnSharedChannelsPing")
}
var r0 bool
if rf, ok := ret.Get(0).(func(*model.RemoteCluster) bool); ok {
r0 = rf(rc)
@@ -369,6 +429,10 @@ func (_m *Hooks) OnSharedChannelsPing(rc *model.RemoteCluster) bool {
func (_m *Hooks) 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)
@@ -383,6 +447,10 @@ func (_m *Hooks) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model
func (_m *Hooks) 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 {
@@ -432,6 +500,10 @@ func (_m *Hooks) ReactionHasBeenRemoved(c *plugin.Context, reaction *model.React
func (_m *Hooks) RunDataRetention(nowTime int64, batchSize int64) (int64, error) {
ret := _m.Called(nowTime, batchSize)
if len(ret) == 0 {
panic("no return value specified for RunDataRetention")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok {
@@ -501,6 +573,10 @@ func (_m *Hooks) UserHasLoggedIn(c *plugin.Context, user *model.User) {
func (_m *Hooks) UserWillLogIn(c *plugin.Context, user *model.User) string {
ret := _m.Called(c, user)
if len(ret) == 0 {
panic("no return value specified for UserWillLogIn")
}
var r0 string
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.User) string); ok {
r0 = rf(c, user)
@@ -516,13 +592,12 @@ func (_m *Hooks) WebSocketMessageHasBeenPosted(webConnID string, userID string,
_m.Called(webConnID, userID, req)
}
type mockConstructorTestingTNewHooks interface {
// 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.
// The first argument is typically a *testing.T value.
func NewHooks(t 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 {
}) *Hooks {
mock := &Hooks{}
mock.Mock.Test(t)