mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* ci: standardize checkout action inputs across workflows (#36876) * ci: standardize checkout action inputs across workflows * ci: checkout in claude pipeline use default * ci: make setup-go-work a Makefile prereq, remove explicit CI steps (#37268) * ci: auto-build missing buildenv images for in-flight Go version bumps (#37286) * ci: replace volatile e2e-platform-pkgs cache with shared webapp-setup (#37182) * ci: replace volatile e2e-platform-pkgs cache with shared webapp-setup * ci: replace volatile e2e-platform-pkgs cache in cypress template v2 * ci: tighten prep-deps comments * fix: typo in webapp-setup comment * chore(ci): warm node and npm caches daily; make CI jobs restore read-only (#37393) * chore(ci): warm node and npm caches daily; make CI jobs restore read-only Add daily scheduled workflows on master that warm two independent caches, each in its own workflow mirroring its consumers: - webapp-ci-cache-warm.yml warms the webapp node_modules cache (keyed on webapp/package-lock.json) - e2e-ci-cache-warm.yml warms the E2E ~/.npm registry cache (keyed on the cypress/playwright/api lockfiles) Webapp CI and the E2E/api CI jobs now restore these caches read-only instead of writing them, so the daily jobs keep the caches warm. The E2E ~/.npm restore is factored into a reusable restore-e2e-npm-cache composite action, and webapp-setup gains a read-only mode for the node_modules cache. * chore(ci): guard cache-warm workflows with a concurrency group * chore(ci): drop unused node-cache-dependency-path output * chore(ci): reuse webapp-setup for node_modules in e2e-tests-check * Move e2e npm registry cache out of the node-cache- namespace (#37427) The e2e npm registry cache keyed on node-cache-<os>-<arch>-npm-e2e-, sharing the node-cache- prefix that actions/setup-node generates automatically for its built-in npm cache (node-cache-<os>-<arch>-npm-). Because the arch segment differs only by case (setup-node uses Node's process.arch 'x64'; this action uses runner.arch 'X64') and GitHub matches restore-key prefixes case-insensitively, the two buckets share a common prefix. A future broad restore-key such as node-cache-<os>-<arch>-npm- could then cross-restore one bucket's ~/.npm into the other. Rename the key to e2e-npm-registry-<os>-<arch>-, giving it a distinct namespace that is not a prefix of node-cache- in either direction and matches the repo's content-descriptive e2e cache keys (e2e-cypress-deps-, e2e-playwright-deps-, e2e-platform-pkgs-). Existing entries orphan and age out; the daily warm job repopulates under the new key on next run. * Adopt per-target .PHONY directives in server Makefiles (#37447) * Converge generated-file CI checks on a single make generated target The server-ci.yml workflow had many separate "run a make target, then fail on any git diff" jobs, but make generated only covered a few of them, so the target and CI drifted apart. Expand make generated to regenerate every committed asset, adding gen-serialized, migrations-extract, build-templates, mmctl-docs, and modules-tidy, and collapse the per-asset check jobs into a single check-generated job. Split the backport migration guard into its own check-backport-migrations job and make target, renaming the script to match. * make generated * git status --porcelain * simplify permissions block given defaults --------- Co-authored-by: Nuno Simões <[email protected]>
858 lines
25 KiB
Go
858 lines
25 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make sharedchannel-mocks`.
|
|
|
|
package sharedchannel
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
filestore "github.com/mattermost/mattermost/server/v8/platform/shared/filestore"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockAppIface is an autogenerated mock type for the AppIface type
|
|
type MockAppIface struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AddUserToChannel provides a mock function with given fields: rctx, user, channel, skipTeamMemberIntegrityCheck
|
|
func (_m *MockAppIface) AddUserToChannel(rctx request.CTX, user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) *model.ChannelMember); ok {
|
|
r0 = rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.User, *model.Channel, bool) *model.AppError); ok {
|
|
r1 = rf(rctx, user, channel, skipTeamMemberIntegrityCheck)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// AddUserToTeamByTeamId provides a mock function with given fields: rctx, teamId, user
|
|
func (_m *MockAppIface) AddUserToTeamByTeamId(rctx request.CTX, teamId string, user *model.User) *model.AppError {
|
|
ret := _m.Called(rctx, 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(rctx, teamId, user)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// CreateChannelWithUser provides a mock function with given fields: rctx, channel, userId
|
|
func (_m *MockAppIface) CreateChannelWithUser(rctx request.CTX, channel *model.Channel, userId string) (*model.Channel, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, channel, userId)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) *model.Channel); ok {
|
|
r0 = rf(rctx, channel, userId)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, string) *model.AppError); ok {
|
|
r1 = rf(rctx, channel, userId)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreateGroupChannel provides a mock function with given fields: rctx, userIDs, creatorId, channelOptions
|
|
func (_m *MockAppIface) CreateGroupChannel(rctx request.CTX, userIDs []string, creatorId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) {
|
|
_va := make([]interface{}, len(channelOptions))
|
|
for _i := range channelOptions {
|
|
_va[_i] = channelOptions[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, rctx, userIDs, creatorId)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateGroupChannel")
|
|
}
|
|
|
|
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(rctx, userIDs, creatorId, channelOptions...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, ...model.ChannelOption) *model.Channel); ok {
|
|
r0 = rf(rctx, userIDs, creatorId, channelOptions...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, []string, string, ...model.ChannelOption) *model.AppError); ok {
|
|
r1 = rf(rctx, userIDs, creatorId, channelOptions...)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreatePost provides a mock function with given fields: rctx, post, channel, flags
|
|
func (_m *MockAppIface) CreatePost(rctx request.CTX, post *model.Post, channel *model.Channel, flags model.CreatePostFlags) (*model.Post, bool, *model.AppError) {
|
|
ret := _m.Called(rctx, post, channel, flags)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreatePost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 bool
|
|
var r2 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) (*model.Post, bool, *model.AppError)); ok {
|
|
return rf(rctx, post, channel, flags)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) *model.Post); ok {
|
|
r0 = rf(rctx, post, channel, flags)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) bool); ok {
|
|
r1 = rf(rctx, post, channel, flags)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(request.CTX, *model.Post, *model.Channel, model.CreatePostFlags) *model.AppError); ok {
|
|
r2 = rf(rctx, post, channel, flags)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// CreateUploadSession provides a mock function with given fields: rctx, us
|
|
func (_m *MockAppIface) CreateUploadSession(rctx request.CTX, us *model.UploadSession) (*model.UploadSession, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, us)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) *model.UploadSession); ok {
|
|
r0 = rf(rctx, us)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.UploadSession)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.UploadSession) *model.AppError); ok {
|
|
r1 = rf(rctx, us)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeleteAcknowledgementForPostWithModel provides a mock function with given fields: rctx, acknowledgement
|
|
func (_m *MockAppIface) DeleteAcknowledgementForPostWithModel(rctx request.CTX, acknowledgement *model.PostAcknowledgement) *model.AppError {
|
|
ret := _m.Called(rctx, acknowledgement)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteAcknowledgementForPostWithModel")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) *model.AppError); ok {
|
|
r0 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DeletePost provides a mock function with given fields: rctx, postID, deleteByID
|
|
func (_m *MockAppIface) DeletePost(rctx request.CTX, postID string, deleteByID string) (*model.Post, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, postID, deleteByID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.Post); ok {
|
|
r0 = rf(rctx, postID, deleteByID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
|
r1 = rf(rctx, postID, deleteByID)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeleteReactionForPost provides a mock function with given fields: rctx, reaction
|
|
func (_m *MockAppIface) DeleteReactionForPost(rctx request.CTX, reaction *model.Reaction) *model.AppError {
|
|
ret := _m.Called(rctx, 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(rctx, reaction)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// FileReader provides a mock function with given fields: path
|
|
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 {
|
|
return rf(path)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(filestore.ReadCloseSeeker)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAcknowledgementsForPost provides a mock function with given fields: postID
|
|
func (_m *MockAppIface) GetAcknowledgementsForPost(postID string) ([]*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(postID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAcknowledgementsForPost")
|
|
}
|
|
|
|
var r0 []*model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(postID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) []*model.PostAcknowledgement); ok {
|
|
r0 = rf(postID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(postID)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetOrCreateDirectChannel provides a mock function with given fields: rctx, userId, otherUserId, channelOptions
|
|
func (_m *MockAppIface) GetOrCreateDirectChannel(rctx request.CTX, userId string, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) {
|
|
_va := make([]interface{}, len(channelOptions))
|
|
for _i := range channelOptions {
|
|
_va[_i] = channelOptions[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, rctx, userId, otherUserId)
|
|
_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 {
|
|
return rf(rctx, userId, otherUserId, channelOptions...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) *model.Channel); ok {
|
|
r0 = rf(rctx, userId, otherUserId, channelOptions...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string, ...model.ChannelOption) *model.AppError); ok {
|
|
r1 = rf(rctx, userId, otherUserId, channelOptions...)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetProfileImage provides a mock function with given fields: user
|
|
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
|
|
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 {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.User) bool); ok {
|
|
r1 = rf(user)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(*model.User) *model.AppError); ok {
|
|
r2 = rf(user)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GetSystemBot provides a mock function with given fields: rctx
|
|
func (_m *MockAppIface) GetSystemBot(rctx request.CTX) (*model.Bot, *model.AppError) {
|
|
ret := _m.Called(rctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetSystemBot")
|
|
}
|
|
|
|
var r0 *model.Bot
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX) (*model.Bot, *model.AppError)); ok {
|
|
return rf(rctx)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX) *model.Bot); ok {
|
|
r0 = rf(rctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Bot)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX) *model.AppError); ok {
|
|
r1 = rf(rctx)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MentionsToTeamMembers provides a mock function with given fields: rctx, message, teamID
|
|
func (_m *MockAppIface) MentionsToTeamMembers(rctx request.CTX, message string, teamID string) model.UserMentionMap {
|
|
ret := _m.Called(rctx, 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(rctx, message, teamID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(model.UserMentionMap)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NotifySharedChannelUserUpdate provides a mock function with given fields: user
|
|
func (_m *MockAppIface) NotifySharedChannelUserUpdate(user *model.User) {
|
|
_m.Called(user)
|
|
}
|
|
|
|
// OnSharedChannelsAttachmentSyncMsg provides a mock function with given fields: fi, post, rc
|
|
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)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// OnSharedChannelsProfileImageSyncMsg provides a mock function with given fields: user, rc
|
|
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)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// OnSharedChannelsSyncMsg provides a mock function with given fields: msg, 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 {
|
|
return rf(msg, rc)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.SyncMsg, *model.RemoteCluster) model.SyncResponse); ok {
|
|
r0 = rf(msg, rc)
|
|
} else {
|
|
r0 = ret.Get(0).(model.SyncResponse)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.SyncMsg, *model.RemoteCluster) error); ok {
|
|
r1 = rf(msg, rc)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PatchChannelModerationsForChannel provides a mock function with given fields: rctx, channel, channelModerationsPatch
|
|
func (_m *MockAppIface) PatchChannelModerationsForChannel(rctx request.CTX, channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, channel, channelModerationsPatch)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) []*model.ChannelModeration); ok {
|
|
r0 = rf(rctx, channel, channelModerationsPatch)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.ChannelModeration)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) *model.AppError); ok {
|
|
r1 = rf(rctx, channel, channelModerationsPatch)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PermanentDeleteChannel provides a mock function with given fields: rctx, channel
|
|
func (_m *MockAppIface) PermanentDeleteChannel(rctx request.CTX, channel *model.Channel) *model.AppError {
|
|
ret := _m.Called(rctx, 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(rctx, channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// PreparePostForClient provides a mock function with given fields: rctx, post, opts
|
|
func (_m *MockAppIface) PreparePostForClient(rctx request.CTX, post *model.Post, opts *model.PreparePostForClientOpts) *model.Post {
|
|
ret := _m.Called(rctx, post, opts)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for PreparePostForClient")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.PreparePostForClientOpts) *model.Post); ok {
|
|
r0 = rf(rctx, post, opts)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Publish provides a mock function with given fields: message
|
|
func (_m *MockAppIface) Publish(message *model.WebSocketEvent) {
|
|
_m.Called(message)
|
|
}
|
|
|
|
// RemoveUserFromChannel provides a mock function with given fields: rctx, userID, removerUserId, channel
|
|
func (_m *MockAppIface) RemoveUserFromChannel(rctx request.CTX, userID string, removerUserId string, channel *model.Channel) *model.AppError {
|
|
ret := _m.Called(rctx, userID, removerUserId, channel)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveUserFromChannel")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, *model.Channel) *model.AppError); ok {
|
|
r0 = rf(rctx, userID, removerUserId, channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SaveAcknowledgementForPostWithModel provides a mock function with given fields: rctx, acknowledgement
|
|
func (_m *MockAppIface) SaveAcknowledgementForPostWithModel(rctx request.CTX, acknowledgement *model.PostAcknowledgement) (*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(rctx, acknowledgement)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAcknowledgementForPostWithModel")
|
|
}
|
|
|
|
var r0 *model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) (*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(rctx, acknowledgement)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.PostAcknowledgement) *model.PostAcknowledgement); ok {
|
|
r0 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.PostAcknowledgement) *model.AppError); ok {
|
|
r1 = rf(rctx, acknowledgement)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveAcknowledgementsForPost provides a mock function with given fields: rctx, postID, userIDs
|
|
func (_m *MockAppIface) SaveAcknowledgementsForPost(rctx request.CTX, postID string, userIDs []string) ([]*model.PostAcknowledgement, *model.AppError) {
|
|
ret := _m.Called(rctx, postID, userIDs)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAcknowledgementsForPost")
|
|
}
|
|
|
|
var r0 []*model.PostAcknowledgement
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) ([]*model.PostAcknowledgement, *model.AppError)); ok {
|
|
return rf(rctx, postID, userIDs)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) []*model.PostAcknowledgement); ok {
|
|
r0 = rf(rctx, postID, userIDs)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, []string) *model.AppError); ok {
|
|
r1 = rf(rctx, postID, userIDs)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveAndBroadcastStatus provides a mock function with given fields: status
|
|
func (_m *MockAppIface) SaveAndBroadcastStatus(status *model.Status) {
|
|
_m.Called(status)
|
|
}
|
|
|
|
// SaveReactionForPost provides a mock function with given fields: rctx, reaction
|
|
func (_m *MockAppIface) SaveReactionForPost(rctx request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
|
ret := _m.Called(rctx, 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 {
|
|
return rf(rctx, reaction)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.Reaction); ok {
|
|
r0 = rf(rctx, reaction)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Reaction)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Reaction) *model.AppError); ok {
|
|
r1 = rf(rctx, reaction)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SendEphemeralPost provides a mock function with given fields: rctx, userId, post
|
|
func (_m *MockAppIface) SendEphemeralPost(rctx request.CTX, userId string, post *model.Post) (*model.Post, bool) {
|
|
ret := _m.Called(rctx, userId, post)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SendEphemeralPost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 bool
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.Post) (*model.Post, bool)); ok {
|
|
return rf(rctx, userId, post)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.Post) *model.Post); ok {
|
|
r0 = rf(rctx, userId, post)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, *model.Post) bool); ok {
|
|
r1 = rf(rctx, userId, post)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdatePost provides a mock function with given fields: rctx, post, updatePostOptions
|
|
func (_m *MockAppIface) UpdatePost(rctx request.CTX, post *model.Post, updatePostOptions *model.UpdatePostOptions) (*model.Post, bool, *model.AppError) {
|
|
ret := _m.Called(rctx, post, updatePostOptions)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdatePost")
|
|
}
|
|
|
|
var r0 *model.Post
|
|
var r1 bool
|
|
var r2 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.UpdatePostOptions) (*model.Post, bool, *model.AppError)); ok {
|
|
return rf(rctx, post, updatePostOptions)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.UpdatePostOptions) *model.Post); ok {
|
|
r0 = rf(rctx, post, updatePostOptions)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.UpdatePostOptions) bool); ok {
|
|
r1 = rf(rctx, post, updatePostOptions)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(request.CTX, *model.Post, *model.UpdatePostOptions) *model.AppError); ok {
|
|
r2 = rf(rctx, post, updatePostOptions)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// UserCanSeeOtherUser provides a mock function with given fields: rctx, userID, otherUserId
|
|
func (_m *MockAppIface) UserCanSeeOtherUser(rctx request.CTX, userID string, otherUserId string) (bool, *model.AppError) {
|
|
ret := _m.Called(rctx, userID, otherUserId)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UserCanSeeOtherUser")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (bool, *model.AppError)); ok {
|
|
return rf(rctx, userID, otherUserId)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) bool); ok {
|
|
r0 = rf(rctx, userID, otherUserId)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
|
r1 = rf(rctx, userID, otherUserId)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// 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())
|
|
}) *MockAppIface {
|
|
mock := &MockAppIface{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|