snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,333 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// AccessControlPolicyStore is an autogenerated mock type for the AccessControlPolicyStore type
|
||||
type AccessControlPolicyStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ClearEtagCache provides a mock function with no fields
|
||||
func (_m *AccessControlPolicyStore) ClearEtagCache() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: rctx, id
|
||||
func (_m *AccessControlPolicyStore) Delete(rctx request.CTX, id string) error {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id
|
||||
func (_m *AccessControlPolicyStore) Get(rctx request.CTX, id string) (*model.AccessControlPolicy, error) {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.AccessControlPolicy
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.AccessControlPolicy, error)); ok {
|
||||
return rf(rctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetActionsForPolicies provides a mock function with given fields: rctx, policyIDs
|
||||
func (_m *AccessControlPolicyStore) GetActionsForPolicies(rctx request.CTX, policyIDs []string) (map[string]map[string]bool, error) {
|
||||
ret := _m.Called(rctx, policyIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetActionsForPolicies")
|
||||
}
|
||||
|
||||
var r0 map[string]map[string]bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string) (map[string]map[string]bool, error)); ok {
|
||||
return rf(rctx, policyIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string) map[string]map[string]bool); ok {
|
||||
r0 = rf(rctx, policyIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]map[string]bool)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string) error); ok {
|
||||
r1 = rf(rctx, policyIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetActionsForPolicy provides a mock function with given fields: rctx, policyID
|
||||
func (_m *AccessControlPolicyStore) GetActionsForPolicy(rctx request.CTX, policyID string) (map[string]bool, error) {
|
||||
ret := _m.Called(rctx, policyID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetActionsForPolicy")
|
||||
}
|
||||
|
||||
var r0 map[string]bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (map[string]bool, error)); ok {
|
||||
return rf(rctx, policyID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) map[string]bool); ok {
|
||||
r0 = rf(rctx, policyID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]bool)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, policyID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEtagEpoch provides a mock function with given fields: rctx, channelID
|
||||
func (_m *AccessControlPolicyStore) GetEtagEpoch(rctx request.CTX, channelID string) (string, error) {
|
||||
ret := _m.Called(rctx, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEtagEpoch")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (string, error)); ok {
|
||||
return rf(rctx, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(rctx, channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetPoliciesByFieldID provides a mock function with given fields: rctx, fieldID
|
||||
func (_m *AccessControlPolicyStore) GetPoliciesByFieldID(rctx request.CTX, fieldID string) ([]*model.AccessControlPolicy, error) {
|
||||
ret := _m.Called(rctx, fieldID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPoliciesByFieldID")
|
||||
}
|
||||
|
||||
var r0 []*model.AccessControlPolicy
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.AccessControlPolicy, error)); ok {
|
||||
return rf(rctx, fieldID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, fieldID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, fieldID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateEtagForChannel provides a mock function with given fields: channelID
|
||||
func (_m *AccessControlPolicyStore) InvalidateEtagForChannel(channelID string) {
|
||||
_m.Called(channelID)
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, policy
|
||||
func (_m *AccessControlPolicyStore) Save(rctx request.CTX, policy *model.AccessControlPolicy) (*model.AccessControlPolicy, error) {
|
||||
ret := _m.Called(rctx, policy)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.AccessControlPolicy
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) (*model.AccessControlPolicy, error)); ok {
|
||||
return rf(rctx, policy)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) *model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, policy)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.AccessControlPolicy) error); ok {
|
||||
r1 = rf(rctx, policy)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchPolicies provides a mock function with given fields: rctx, opts
|
||||
func (_m *AccessControlPolicyStore) SearchPolicies(rctx request.CTX, opts model.AccessControlPolicySearch) ([]*model.AccessControlPolicy, int64, error) {
|
||||
ret := _m.Called(rctx, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SearchPolicies")
|
||||
}
|
||||
|
||||
var r0 []*model.AccessControlPolicy
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessControlPolicySearch) ([]*model.AccessControlPolicy, int64, error)); ok {
|
||||
return rf(rctx, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessControlPolicySearch) []*model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, model.AccessControlPolicySearch) int64); ok {
|
||||
r1 = rf(rctx, opts)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(request.CTX, model.AccessControlPolicySearch) error); ok {
|
||||
r2 = rf(rctx, opts)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// SetActiveStatus provides a mock function with given fields: rctx, id, active
|
||||
func (_m *AccessControlPolicyStore) SetActiveStatus(rctx request.CTX, id string, active bool) (*model.AccessControlPolicy, error) {
|
||||
ret := _m.Called(rctx, id, active)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetActiveStatus")
|
||||
}
|
||||
|
||||
var r0 *model.AccessControlPolicy
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) (*model.AccessControlPolicy, error)); ok {
|
||||
return rf(rctx, id, active)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) *model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, id, active)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, bool) error); ok {
|
||||
r1 = rf(rctx, id, active)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetActiveStatusMultiple provides a mock function with given fields: rctx, list
|
||||
func (_m *AccessControlPolicyStore) SetActiveStatusMultiple(rctx request.CTX, list []model.AccessControlPolicyActiveUpdate) ([]*model.AccessControlPolicy, error) {
|
||||
ret := _m.Called(rctx, list)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetActiveStatusMultiple")
|
||||
}
|
||||
|
||||
var r0 []*model.AccessControlPolicy
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []model.AccessControlPolicyActiveUpdate) ([]*model.AccessControlPolicy, error)); ok {
|
||||
return rf(rctx, list)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []model.AccessControlPolicyActiveUpdate) []*model.AccessControlPolicy); ok {
|
||||
r0 = rf(rctx, list)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.AccessControlPolicy)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []model.AccessControlPolicyActiveUpdate) error); ok {
|
||||
r1 = rf(rctx, list)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewAccessControlPolicyStore creates a new instance of AccessControlPolicyStore. 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 NewAccessControlPolicyStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *AccessControlPolicyStore {
|
||||
mock := &AccessControlPolicyStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
213
server/channels/store/storetest/mocks/AttributesStore.go
Normal file
213
server/channels/store/storetest/mocks/AttributesStore.go
Normal file
@@ -0,0 +1,213 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// AttributesStore is an autogenerated mock type for the AttributesStore type
|
||||
type AttributesStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ClearUserPropertyValuesEpochCache provides a mock function with no fields
|
||||
func (_m *AttributesStore) ClearUserPropertyValuesEpochCache() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// GetChannelMembersToRemove provides a mock function with given fields: rctx, channelID, opts
|
||||
func (_m *AttributesStore) GetChannelMembersToRemove(rctx request.CTX, channelID string, opts model.SubjectSearchOptions) ([]*model.ChannelMember, error) {
|
||||
ret := _m.Called(rctx, channelID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelMembersToRemove")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelMember
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) ([]*model.ChannelMember, error)); ok {
|
||||
return rf(rctx, channelID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) []*model.ChannelMember); ok {
|
||||
r0 = rf(rctx, channelID, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelMember)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, model.SubjectSearchOptions) error); ok {
|
||||
r1 = rf(rctx, channelID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSubject provides a mock function with given fields: rctx, ID, groupID, objectType
|
||||
func (_m *AttributesStore) GetSubject(rctx request.CTX, ID string, groupID string, objectType string) (*model.Subject, error) {
|
||||
ret := _m.Called(rctx, ID, groupID, objectType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSubject")
|
||||
}
|
||||
|
||||
var r0 *model.Subject
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) (*model.Subject, error)); ok {
|
||||
return rf(rctx, ID, groupID, objectType)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) *model.Subject); ok {
|
||||
r0 = rf(rctx, ID, groupID, objectType)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Subject)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string, string) error); ok {
|
||||
r1 = rf(rctx, ID, groupID, objectType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamMembersToRemove provides a mock function with given fields: rctx, teamID, opts
|
||||
func (_m *AttributesStore) GetTeamMembersToRemove(rctx request.CTX, teamID string, opts model.SubjectSearchOptions) ([]*model.TeamMember, error) {
|
||||
ret := _m.Called(rctx, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamMembersToRemove")
|
||||
}
|
||||
|
||||
var r0 []*model.TeamMember
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) ([]*model.TeamMember, error)); ok {
|
||||
return rf(rctx, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) []*model.TeamMember); ok {
|
||||
r0 = rf(rctx, teamID, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.TeamMember)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, model.SubjectSearchOptions) error); ok {
|
||||
r1 = rf(rctx, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUserPropertyValuesEpoch provides a mock function with given fields: rctx, userID
|
||||
func (_m *AttributesStore) GetUserPropertyValuesEpoch(rctx request.CTX, userID string) (string, error) {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserPropertyValuesEpoch")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (string, error)); ok {
|
||||
return rf(rctx, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateUserPropertyValuesEpoch provides a mock function with given fields: userID
|
||||
func (_m *AttributesStore) InvalidateUserPropertyValuesEpoch(userID string) {
|
||||
_m.Called(userID)
|
||||
}
|
||||
|
||||
// RefreshAttributes provides a mock function with no fields
|
||||
func (_m *AttributesStore) RefreshAttributes() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RefreshAttributes")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SearchUsers provides a mock function with given fields: rctx, opts
|
||||
func (_m *AttributesStore) SearchUsers(rctx request.CTX, opts model.SubjectSearchOptions) ([]*model.User, int64, error) {
|
||||
ret := _m.Called(rctx, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SearchUsers")
|
||||
}
|
||||
|
||||
var r0 []*model.User
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.SubjectSearchOptions) ([]*model.User, int64, error)); ok {
|
||||
return rf(rctx, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.SubjectSearchOptions) []*model.User); ok {
|
||||
r0 = rf(rctx, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, model.SubjectSearchOptions) int64); ok {
|
||||
r1 = rf(rctx, opts)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(request.CTX, model.SubjectSearchOptions) error); ok {
|
||||
r2 = rf(rctx, opts)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// NewAttributesStore creates a new instance of AttributesStore. 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 NewAttributesStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *AttributesStore {
|
||||
mock := &AttributesStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
95
server/channels/store/storetest/mocks/AuditStore.go
Normal file
95
server/channels/store/storetest/mocks/AuditStore.go
Normal file
@@ -0,0 +1,95 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// AuditStore is an autogenerated mock type for the AuditStore type
|
||||
type AuditStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *AuditStore) Get(userID string, offset int, limit int) (model.Audits, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 model.Audits
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) (model.Audits, error)); ok {
|
||||
return rf(userID, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) model.Audits); ok {
|
||||
r0 = rf(userID, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Audits)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userID
|
||||
func (_m *AuditStore) PermanentDeleteByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: audit
|
||||
func (_m *AuditStore) Save(audit *model.Audit) error {
|
||||
ret := _m.Called(audit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Audit) error); ok {
|
||||
r0 = rf(audit)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewAuditStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *AuditStore {
|
||||
mock := &AuditStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
331
server/channels/store/storetest/mocks/AutoTranslationStore.go
Normal file
331
server/channels/store/storetest/mocks/AutoTranslationStore.go
Normal file
@@ -0,0 +1,331 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// AutoTranslationStore is an autogenerated mock type for the AutoTranslationStore type
|
||||
type AutoTranslationStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ClearCaches provides a mock function with no fields
|
||||
func (_m *AutoTranslationStore) ClearCaches() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: objectType, objectID, dstLang
|
||||
func (_m *AutoTranslationStore) Get(objectType string, objectID string, dstLang string) (*model.Translation, error) {
|
||||
ret := _m.Called(objectType, objectID, dstLang)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.Translation
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) (*model.Translation, error)); ok {
|
||||
return rf(objectType, objectID, dstLang)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) *model.Translation); ok {
|
||||
r0 = rf(objectType, objectID, dstLang)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Translation)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(objectType, objectID, dstLang)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetActiveDestinationLanguages provides a mock function with given fields: channelID, excludeUserID, filterUserIDs
|
||||
func (_m *AutoTranslationStore) GetActiveDestinationLanguages(channelID string, excludeUserID string, filterUserIDs []string) ([]string, error) {
|
||||
ret := _m.Called(channelID, excludeUserID, filterUserIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetActiveDestinationLanguages")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, []string) ([]string, error)); ok {
|
||||
return rf(channelID, excludeUserID, filterUserIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, []string) []string); ok {
|
||||
r0 = rf(channelID, excludeUserID, filterUserIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, []string) error); ok {
|
||||
r1 = rf(channelID, excludeUserID, filterUserIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllForObject provides a mock function with given fields: objectType, objectID
|
||||
func (_m *AutoTranslationStore) GetAllForObject(objectType string, objectID string) ([]*model.Translation, error) {
|
||||
ret := _m.Called(objectType, objectID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllForObject")
|
||||
}
|
||||
|
||||
var r0 []*model.Translation
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) ([]*model.Translation, error)); ok {
|
||||
return rf(objectType, objectID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) []*model.Translation); ok {
|
||||
r0 = rf(objectType, objectID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Translation)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(objectType, objectID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetBatch provides a mock function with given fields: objectType, objectIDs, dstLang
|
||||
func (_m *AutoTranslationStore) GetBatch(objectType string, objectIDs []string, dstLang string) (map[string]*model.Translation, error) {
|
||||
ret := _m.Called(objectType, objectIDs, dstLang)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetBatch")
|
||||
}
|
||||
|
||||
var r0 map[string]*model.Translation
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string, string) (map[string]*model.Translation, error)); ok {
|
||||
return rf(objectType, objectIDs, dstLang)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string, string) map[string]*model.Translation); ok {
|
||||
r0 = rf(objectType, objectIDs, dstLang)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]*model.Translation)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string, string) error); ok {
|
||||
r1 = rf(objectType, objectIDs, dstLang)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByStateOlderThan provides a mock function with given fields: state, olderThanMillis, limit
|
||||
func (_m *AutoTranslationStore) GetByStateOlderThan(state model.TranslationState, olderThanMillis int64, limit int) ([]*model.Translation, error) {
|
||||
ret := _m.Called(state, olderThanMillis, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByStateOlderThan")
|
||||
}
|
||||
|
||||
var r0 []*model.Translation
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(model.TranslationState, int64, int) ([]*model.Translation, error)); ok {
|
||||
return rf(state, olderThanMillis, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.TranslationState, int64, int) []*model.Translation); ok {
|
||||
r0 = rf(state, olderThanMillis, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Translation)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.TranslationState, int64, int) error); ok {
|
||||
r1 = rf(state, olderThanMillis, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLatestPostUpdateAtForChannel provides a mock function with given fields: channelID
|
||||
func (_m *AutoTranslationStore) GetLatestPostUpdateAtForChannel(channelID string) (int64, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLatestPostUpdateAtForChannel")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTranslationsSinceForChannel provides a mock function with given fields: channelID, dstLang, since
|
||||
func (_m *AutoTranslationStore) GetTranslationsSinceForChannel(channelID string, dstLang string, since int64) (map[string]*model.Translation, error) {
|
||||
ret := _m.Called(channelID, dstLang, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTranslationsSinceForChannel")
|
||||
}
|
||||
|
||||
var r0 map[string]*model.Translation
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) (map[string]*model.Translation, error)); ok {
|
||||
return rf(channelID, dstLang, since)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) map[string]*model.Translation); ok {
|
||||
r0 = rf(channelID, dstLang, since)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]*model.Translation)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
|
||||
r1 = rf(channelID, dstLang, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUserLanguage provides a mock function with given fields: userID, channelID
|
||||
func (_m *AutoTranslationStore) GetUserLanguage(userID string, channelID string) (string, error) {
|
||||
ret := _m.Called(userID, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserLanguage")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok {
|
||||
return rf(userID, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) string); ok {
|
||||
r0 = rf(userID, channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidatePostTranslationEtag provides a mock function with given fields: channelID
|
||||
func (_m *AutoTranslationStore) InvalidatePostTranslationEtag(channelID string) {
|
||||
_m.Called(channelID)
|
||||
}
|
||||
|
||||
// InvalidateUserAutoTranslation provides a mock function with given fields: userID, channelID
|
||||
func (_m *AutoTranslationStore) InvalidateUserAutoTranslation(userID string, channelID string) {
|
||||
_m.Called(userID, channelID)
|
||||
}
|
||||
|
||||
// InvalidateUserLocaleCache provides a mock function with given fields: userID
|
||||
func (_m *AutoTranslationStore) InvalidateUserLocaleCache(userID string) {
|
||||
_m.Called(userID)
|
||||
}
|
||||
|
||||
// IsUserEnabled provides a mock function with given fields: userID, channelID
|
||||
func (_m *AutoTranslationStore) IsUserEnabled(userID string, channelID string) (bool, error) {
|
||||
ret := _m.Called(userID, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IsUserEnabled")
|
||||
}
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok {
|
||||
return rf(userID, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) bool); ok {
|
||||
r0 = rf(userID, channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: translation
|
||||
func (_m *AutoTranslationStore) Save(translation *model.Translation) error {
|
||||
ret := _m.Called(translation)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Translation) error); ok {
|
||||
r0 = rf(translation)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewAutoTranslationStore creates a new instance of AutoTranslationStore. 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 NewAutoTranslationStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *AutoTranslationStore {
|
||||
mock := &AutoTranslationStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
227
server/channels/store/storetest/mocks/BotStore.go
Normal file
227
server/channels/store/storetest/mocks/BotStore.go
Normal file
@@ -0,0 +1,227 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// BotStore is an autogenerated mock type for the BotStore type
|
||||
type BotStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userID, includeDeleted
|
||||
func (_m *BotStore) Get(userID string, includeDeleted bool) (*model.Bot, error) {
|
||||
ret := _m.Called(userID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(userID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: options
|
||||
func (_m *BotStore) GetAll(options *model.BotGetOptions) ([]*model.Bot, error) {
|
||||
ret := _m.Called(options)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.BotGetOptions) error); ok {
|
||||
r1 = rf(options)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllAfter provides a mock function with given fields: limit, afterId
|
||||
func (_m *BotStore) GetAllAfter(limit int, afterId string) ([]*model.Bot, error) {
|
||||
ret := _m.Called(limit, afterId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllAfter")
|
||||
}
|
||||
|
||||
var r0 []*model.Bot
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int, string) ([]*model.Bot, error)); ok {
|
||||
return rf(limit, afterId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int, string) []*model.Bot); ok {
|
||||
r0 = rf(limit, afterId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, string) error); ok {
|
||||
r1 = rf(limit, afterId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByUsername provides a mock function with given fields: username
|
||||
func (_m *BotStore) GetByUsername(username string) (*model.Bot, error) {
|
||||
ret := _m.Called(username)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByUsername")
|
||||
}
|
||||
|
||||
var r0 *model.Bot
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.Bot, error)); ok {
|
||||
return rf(username)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.Bot); ok {
|
||||
r0 = rf(username)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(username)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDelete provides a mock function with given fields: userID
|
||||
func (_m *BotStore) PermanentDelete(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDelete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: bot
|
||||
func (_m *BotStore) Save(bot *model.Bot) (*model.Bot, error) {
|
||||
ret := _m.Called(bot)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Bot) error); ok {
|
||||
r1 = rf(bot)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: bot
|
||||
func (_m *BotStore) Update(bot *model.Bot) (*model.Bot, error) {
|
||||
ret := _m.Called(bot)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Bot) error); ok {
|
||||
r1 = rf(bot)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewBotStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *BotStore {
|
||||
mock := &BotStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
203
server/channels/store/storetest/mocks/ChannelBookmarkStore.go
Normal file
203
server/channels/store/storetest/mocks/ChannelBookmarkStore.go
Normal file
@@ -0,0 +1,203 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ChannelBookmarkStore is an autogenerated mock type for the ChannelBookmarkStore type
|
||||
type ChannelBookmarkStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: bookmarkID, deleteFile
|
||||
func (_m *ChannelBookmarkStore) Delete(bookmarkID string, deleteFile bool) error {
|
||||
ret := _m.Called(bookmarkID, deleteFile)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) error); ok {
|
||||
r0 = rf(bookmarkID, deleteFile)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ErrorIfBookmarkFileInfoAlreadyAttached provides a mock function with given fields: fileID, channelID
|
||||
func (_m *ChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileID string, channelID string) error {
|
||||
ret := _m.Called(fileID, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ErrorIfBookmarkFileInfoAlreadyAttached")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(fileID, channelID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: Id, includeDeleted
|
||||
func (_m *ChannelBookmarkStore) Get(Id string, includeDeleted bool) (*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(Id, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) (*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(Id, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, bool) *model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(Id, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelBookmarkWithFileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(Id, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetBookmarksForChannelSince provides a mock function with given fields: channelID, since
|
||||
func (_m *ChannelBookmarkStore) GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(channelID, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetBookmarksForChannelSince")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) ([]*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(channelID, since)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64) []*model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(channelID, since)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelBookmarkWithFileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(channelID, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: bookmark, increaseSortOrder
|
||||
func (_m *ChannelBookmarkStore) Save(bookmark *model.ChannelBookmark, increaseSortOrder bool) (*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(bookmark, increaseSortOrder)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelBookmark, bool) (*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(bookmark, increaseSortOrder)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelBookmark, bool) *model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(bookmark, increaseSortOrder)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelBookmarkWithFileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ChannelBookmark, bool) error); ok {
|
||||
r1 = rf(bookmark, increaseSortOrder)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: bookmark
|
||||
func (_m *ChannelBookmarkStore) Update(bookmark *model.ChannelBookmark) error {
|
||||
ret := _m.Called(bookmark)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelBookmark) error); ok {
|
||||
r0 = rf(bookmark)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateSortOrder provides a mock function with given fields: bookmarkID, channelID, newIndex
|
||||
func (_m *ChannelBookmarkStore) UpdateSortOrder(bookmarkID string, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(bookmarkID, channelID, newIndex)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateSortOrder")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) ([]*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(bookmarkID, channelID, newIndex)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) []*model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(bookmarkID, channelID, newIndex)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelBookmarkWithFileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
|
||||
r1 = rf(bookmarkID, channelID, newIndex)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewChannelBookmarkStore creates a new instance of ChannelBookmarkStore. 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 NewChannelBookmarkStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ChannelBookmarkStore {
|
||||
mock := &ChannelBookmarkStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
136
server/channels/store/storetest/mocks/ChannelGuardStore.go
Normal file
136
server/channels/store/storetest/mocks/ChannelGuardStore.go
Normal file
@@ -0,0 +1,136 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
store "github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ChannelGuardStore is an autogenerated mock type for the ChannelGuardStore type
|
||||
type ChannelGuardStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: rctx, channelID, pluginID
|
||||
func (_m *ChannelGuardStore) Delete(rctx request.CTX, channelID string, pluginID string) (int64, error) {
|
||||
ret := _m.Called(rctx, channelID, pluginID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (int64, error)); ok {
|
||||
return rf(rctx, channelID, pluginID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) int64); ok {
|
||||
r0 = rf(rctx, channelID, pluginID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, channelID, pluginID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: rctx
|
||||
func (_m *ChannelGuardStore) GetAll(rctx request.CTX) ([]*store.ChannelGuard, error) {
|
||||
ret := _m.Called(rctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
var r0 []*store.ChannelGuard
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) ([]*store.ChannelGuard, error)); ok {
|
||||
return rf(rctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) []*store.ChannelGuard); ok {
|
||||
r0 = rf(rctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*store.ChannelGuard)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) error); ok {
|
||||
r1 = rf(rctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForChannel provides a mock function with given fields: rctx, channelID
|
||||
func (_m *ChannelGuardStore) GetForChannel(rctx request.CTX, channelID string) ([]*store.ChannelGuard, error) {
|
||||
ret := _m.Called(rctx, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForChannel")
|
||||
}
|
||||
|
||||
var r0 []*store.ChannelGuard
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*store.ChannelGuard, error)); ok {
|
||||
return rf(rctx, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*store.ChannelGuard); ok {
|
||||
r0 = rf(rctx, channelID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*store.ChannelGuard)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, guard
|
||||
func (_m *ChannelGuardStore) Save(rctx request.CTX, guard *store.ChannelGuard) error {
|
||||
ret := _m.Called(rctx, guard)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *store.ChannelGuard) error); ok {
|
||||
r0 = rf(rctx, guard)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewChannelGuardStore creates a new instance of ChannelGuardStore. 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 NewChannelGuardStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ChannelGuardStore {
|
||||
mock := &ChannelGuardStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
251
server/channels/store/storetest/mocks/ChannelJoinRequestStore.go
Normal file
251
server/channels/store/storetest/mocks/ChannelJoinRequestStore.go
Normal file
@@ -0,0 +1,251 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ChannelJoinRequestStore is an autogenerated mock type for the ChannelJoinRequestStore type
|
||||
type ChannelJoinRequestStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountPending provides a mock function with given fields: channelId
|
||||
func (_m *ChannelJoinRequestStore) CountPending(channelId string) (int64, error) {
|
||||
ret := _m.Called(channelId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountPending")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ChannelJoinRequestStore) Get(id string) (*model.ChannelJoinRequest, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelJoinRequest
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.ChannelJoinRequest, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.ChannelJoinRequest); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForChannel provides a mock function with given fields: channelId, opts
|
||||
func (_m *ChannelJoinRequestStore) GetForChannel(channelId string, opts model.GetChannelJoinRequestsOpts) ([]*model.ChannelJoinRequest, int64, error) {
|
||||
ret := _m.Called(channelId, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForChannel")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelJoinRequest
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.GetChannelJoinRequestsOpts) ([]*model.ChannelJoinRequest, int64, error)); ok {
|
||||
return rf(channelId, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, model.GetChannelJoinRequestsOpts) []*model.ChannelJoinRequest); ok {
|
||||
r0 = rf(channelId, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.GetChannelJoinRequestsOpts) int64); ok {
|
||||
r1 = rf(channelId, opts)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(string, model.GetChannelJoinRequestsOpts) error); ok {
|
||||
r2 = rf(channelId, opts)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GetForUser provides a mock function with given fields: userId, opts
|
||||
func (_m *ChannelJoinRequestStore) GetForUser(userId string, opts model.GetChannelJoinRequestsOpts) ([]*model.ChannelJoinRequest, int64, error) {
|
||||
ret := _m.Called(userId, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForUser")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelJoinRequest
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.GetChannelJoinRequestsOpts) ([]*model.ChannelJoinRequest, int64, error)); ok {
|
||||
return rf(userId, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, model.GetChannelJoinRequestsOpts) []*model.ChannelJoinRequest); ok {
|
||||
r0 = rf(userId, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.GetChannelJoinRequestsOpts) int64); ok {
|
||||
r1 = rf(userId, opts)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(string, model.GetChannelJoinRequestsOpts) error); ok {
|
||||
r2 = rf(userId, opts)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GetPendingForChannelAndUser provides a mock function with given fields: channelId, userId
|
||||
func (_m *ChannelJoinRequestStore) GetPendingForChannelAndUser(channelId string, userId string) (*model.ChannelJoinRequest, error) {
|
||||
ret := _m.Called(channelId, userId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPendingForChannelAndUser")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelJoinRequest
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelJoinRequest, error)); ok {
|
||||
return rf(channelId, userId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.ChannelJoinRequest); ok {
|
||||
r0 = rf(channelId, userId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelId, userId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: req
|
||||
func (_m *ChannelJoinRequestStore) Save(req *model.ChannelJoinRequest) (*model.ChannelJoinRequest, error) {
|
||||
ret := _m.Called(req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelJoinRequest
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelJoinRequest) (*model.ChannelJoinRequest, error)); ok {
|
||||
return rf(req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelJoinRequest) *model.ChannelJoinRequest); ok {
|
||||
r0 = rf(req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ChannelJoinRequest) error); ok {
|
||||
r1 = rf(req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: req
|
||||
func (_m *ChannelJoinRequestStore) Update(req *model.ChannelJoinRequest) (*model.ChannelJoinRequest, error) {
|
||||
ret := _m.Called(req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 *model.ChannelJoinRequest
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelJoinRequest) (*model.ChannelJoinRequest, error)); ok {
|
||||
return rf(req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ChannelJoinRequest) *model.ChannelJoinRequest); ok {
|
||||
r0 = rf(req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ChannelJoinRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ChannelJoinRequest) error); ok {
|
||||
r1 = rf(req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewChannelJoinRequestStore creates a new instance of ChannelJoinRequestStore. 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 NewChannelJoinRequestStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ChannelJoinRequestStore {
|
||||
mock := &ChannelJoinRequestStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ChannelMemberHistoryStore is an autogenerated mock type for the ChannelMemberHistoryStore type
|
||||
type ChannelMemberHistoryStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteOrphanedRows provides a mock function with given fields: limit
|
||||
func (_m *ChannelMemberHistoryStore) DeleteOrphanedRows(limit int) (int64, error) {
|
||||
ret := _m.Called(limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanedRows")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int) error); ok {
|
||||
r1 = rf(limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelsLeftSince provides a mock function with given fields: userID, since
|
||||
func (_m *ChannelMemberHistoryStore) GetChannelsLeftSince(userID string, since int64) ([]string, error) {
|
||||
ret := _m.Called(userID, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelsLeftSince")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(userID, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelsWithActivityDuring provides a mock function with given fields: startTime, endTime
|
||||
func (_m *ChannelMemberHistoryStore) GetChannelsWithActivityDuring(startTime int64, endTime int64) ([]string, error) {
|
||||
ret := _m.Called(startTime, endTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelsWithActivityDuring")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) ([]string, error)); ok {
|
||||
return rf(startTime, endTime)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) []string); ok {
|
||||
r0 = rf(startTime, endTime)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
|
||||
r1 = rf(startTime, endTime)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEverMembersInChannel provides a mock function with given fields: channelID, userIDs
|
||||
func (_m *ChannelMemberHistoryStore) GetEverMembersInChannel(channelID string, userIDs []string) ([]string, error) {
|
||||
ret := _m.Called(channelID, userIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEverMembersInChannel")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) ([]string, error)); ok {
|
||||
return rf(channelID, userIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string) []string); ok {
|
||||
r0 = rf(channelID, userIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(channelID, userIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMembershipChanges provides a mock function with given fields: channelID, since, limit
|
||||
func (_m *ChannelMemberHistoryStore) GetMembershipChanges(channelID string, since int64, limit int) ([]*model.ChannelMemberHistory, error) {
|
||||
ret := _m.Called(channelID, since, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMembershipChanges")
|
||||
}
|
||||
|
||||
var r0 []*model.ChannelMemberHistory
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, int) ([]*model.ChannelMemberHistory, error)); ok {
|
||||
return rf(channelID, since, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64, int) []*model.ChannelMemberHistory); ok {
|
||||
r0 = rf(channelID, since, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelMemberHistory)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64, int) error); ok {
|
||||
r1 = rf(channelID, since, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUsersInChannelDuring provides a mock function with given fields: startTime, endTime, channelID
|
||||
func (_m *ChannelMemberHistoryStore) GetUsersInChannelDuring(startTime int64, endTime int64, channelID []string) ([]*model.ChannelMemberHistoryResult, error) {
|
||||
ret := _m.Called(startTime, endTime, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUsersInChannelDuring")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelMemberHistoryResult)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int64, []string) error); ok {
|
||||
r1 = rf(startTime, endTime, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// LogJoinEvent provides a mock function with given fields: userID, channelID, joinTime
|
||||
func (_m *ChannelMemberHistoryStore) LogJoinEvent(userID string, channelID string, joinTime int64) error {
|
||||
ret := _m.Called(userID, channelID, joinTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for LogJoinEvent")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) error); ok {
|
||||
r0 = rf(userID, channelID, joinTime)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// LogLeaveEvent provides a mock function with given fields: rctx, userID, channelID, leaveTime
|
||||
func (_m *ChannelMemberHistoryStore) LogLeaveEvent(rctx request.CTX, userID string, channelID string, leaveTime int64) error {
|
||||
ret := _m.Called(rctx, userID, channelID, leaveTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for LogLeaveEvent")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, int64) error); ok {
|
||||
r0 = rf(rctx, userID, channelID, leaveTime)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteBatch provides a mock function with given fields: endTime, limit
|
||||
func (_m *ChannelMemberHistoryStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, error) {
|
||||
ret := _m.Called(endTime, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatch")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
|
||||
r1 = rf(endTime, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteBatchForRetentionPolicies provides a mock function with given fields: retentionPolicyBatchConfigs, cursor
|
||||
func (_m *ChannelMemberHistoryStore) PermanentDeleteBatchForRetentionPolicies(retentionPolicyBatchConfigs model.RetentionPolicyBatchConfigs, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error) {
|
||||
ret := _m.Called(retentionPolicyBatchConfigs, cursor)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatchForRetentionPolicies")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 model.RetentionPolicyCursor
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok {
|
||||
return rf(retentionPolicyBatchConfigs, cursor)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) int64); ok {
|
||||
r0 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok {
|
||||
r1 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r1 = ret.Get(1).(model.RetentionPolicyCursor)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) error); ok {
|
||||
r2 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewChannelMemberHistoryStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ChannelMemberHistoryStore {
|
||||
mock := &ChannelMemberHistoryStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
3484
server/channels/store/storetest/mocks/ChannelStore.go
Normal file
3484
server/channels/store/storetest/mocks/ChannelStore.go
Normal file
File diff suppressed because it is too large
Load Diff
169
server/channels/store/storetest/mocks/ClusterDiscoveryStore.go
Normal file
169
server/channels/store/storetest/mocks/ClusterDiscoveryStore.go
Normal file
@@ -0,0 +1,169 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ClusterDiscoveryStore is an autogenerated mock type for the ClusterDiscoveryStore type
|
||||
type ClusterDiscoveryStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Cleanup provides a mock function with no fields
|
||||
func (_m *ClusterDiscoveryStore) Cleanup() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Cleanup")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: discovery
|
||||
func (_m *ClusterDiscoveryStore) Delete(discovery *model.ClusterDiscovery) (bool, error) {
|
||||
ret := _m.Called(discovery)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ClusterDiscovery) error); ok {
|
||||
r1 = rf(discovery)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Exists provides a mock function with given fields: discovery
|
||||
func (_m *ClusterDiscoveryStore) Exists(discovery *model.ClusterDiscovery) (bool, error) {
|
||||
ret := _m.Called(discovery)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Exists")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ClusterDiscovery) error); ok {
|
||||
r1 = rf(discovery)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: discoveryType, clusterName
|
||||
func (_m *ClusterDiscoveryStore) GetAll(discoveryType string, clusterName string) ([]*model.ClusterDiscovery, error) {
|
||||
ret := _m.Called(discoveryType, clusterName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ClusterDiscovery)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(discoveryType, clusterName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: discovery
|
||||
func (_m *ClusterDiscoveryStore) Save(discovery *model.ClusterDiscovery) error {
|
||||
ret := _m.Called(discovery)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) error); ok {
|
||||
r0 = rf(discovery)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SetLastPingAt provides a mock function with given fields: discovery
|
||||
func (_m *ClusterDiscoveryStore) SetLastPingAt(discovery *model.ClusterDiscovery) error {
|
||||
ret := _m.Called(discovery)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetLastPingAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ClusterDiscovery) error); ok {
|
||||
r0 = rf(discovery)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewClusterDiscoveryStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ClusterDiscoveryStore {
|
||||
mock := &ClusterDiscoveryStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
261
server/channels/store/storetest/mocks/CommandStore.go
Normal file
261
server/channels/store/storetest/mocks/CommandStore.go
Normal file
@@ -0,0 +1,261 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// CommandStore is an autogenerated mock type for the CommandStore type
|
||||
type CommandStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AnalyticsCommandCount provides a mock function with given fields: teamID
|
||||
func (_m *CommandStore) AnalyticsCommandCount(teamID string) (int64, error) {
|
||||
ret := _m.Called(teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AnalyticsCommandCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: commandID, timestamp
|
||||
func (_m *CommandStore) Delete(commandID string, timestamp int64) error {
|
||||
ret := _m.Called(commandID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(commandID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *CommandStore) Get(id string) (*model.Command, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Command)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByTeam provides a mock function with given fields: teamID
|
||||
func (_m *CommandStore) GetByTeam(teamID string) ([]*model.Command, error) {
|
||||
ret := _m.Called(teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByTeam")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Command)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByTrigger provides a mock function with given fields: teamID, trigger
|
||||
func (_m *CommandStore) GetByTrigger(teamID string, trigger string) (*model.Command, error) {
|
||||
ret := _m.Called(teamID, trigger)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByTrigger")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Command)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(teamID, trigger)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByTeam provides a mock function with given fields: teamID
|
||||
func (_m *CommandStore) PermanentDeleteByTeam(teamID string) error {
|
||||
ret := _m.Called(teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByTeam")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(teamID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userID
|
||||
func (_m *CommandStore) PermanentDeleteByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: webhook
|
||||
func (_m *CommandStore) Save(webhook *model.Command) (*model.Command, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Command)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Command) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: hook
|
||||
func (_m *CommandStore) Update(hook *model.Command) (*model.Command, error) {
|
||||
ret := _m.Called(hook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Command)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Command) error); ok {
|
||||
r1 = rf(hook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewCommandStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *CommandStore {
|
||||
mock := &CommandStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
112
server/channels/store/storetest/mocks/CommandWebhookStore.go
Normal file
112
server/channels/store/storetest/mocks/CommandWebhookStore.go
Normal file
@@ -0,0 +1,112 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// CommandWebhookStore is an autogenerated mock type for the CommandWebhookStore type
|
||||
type CommandWebhookStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Cleanup provides a mock function with no fields
|
||||
func (_m *CommandWebhookStore) Cleanup() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *CommandWebhookStore) Get(id string) (*model.CommandWebhook, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.CommandWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: webhook
|
||||
func (_m *CommandWebhookStore) Save(webhook *model.CommandWebhook) (*model.CommandWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.CommandWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.CommandWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// TryUse provides a mock function with given fields: id, limit
|
||||
func (_m *CommandWebhookStore) TryUse(id string, limit int) error {
|
||||
ret := _m.Called(id, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for TryUse")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int) error); ok {
|
||||
r0 = rf(id, limit)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewCommandWebhookStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *CommandWebhookStore {
|
||||
mock := &CommandWebhookStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
224
server/channels/store/storetest/mocks/ComplianceStore.go
Normal file
224
server/channels/store/storetest/mocks/ComplianceStore.go
Normal file
@@ -0,0 +1,224 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ComplianceStore is an autogenerated mock type for the ComplianceStore type
|
||||
type ComplianceStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ComplianceExport provides a mock function with given fields: compliance, cursor, limit
|
||||
func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance, cursor model.ComplianceExportCursor, limit int) ([]*model.CompliancePost, model.ComplianceExportCursor, error) {
|
||||
ret := _m.Called(compliance, cursor, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ComplianceExport")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.CompliancePost)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(*model.Compliance, model.ComplianceExportCursor, int) error); ok {
|
||||
r2 = rf(compliance, cursor, limit)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ComplianceStore) Get(id string) (*model.Compliance, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Compliance)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit
|
||||
func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Compliances)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MessageExport provides a mock function with given fields: rctx, cursor, limit
|
||||
func (_m *ComplianceStore) MessageExport(rctx request.CTX, cursor model.MessageExportCursor, limit int) ([]*model.MessageExport, model.MessageExportCursor, error) {
|
||||
ret := _m.Called(rctx, cursor, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MessageExport")
|
||||
}
|
||||
|
||||
var r0 []*model.MessageExport
|
||||
var r1 model.MessageExportCursor
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.MessageExportCursor, int) ([]*model.MessageExport, model.MessageExportCursor, error)); ok {
|
||||
return rf(rctx, cursor, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.MessageExportCursor, int) []*model.MessageExport); ok {
|
||||
r0 = rf(rctx, cursor, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.MessageExport)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, model.MessageExportCursor, int) model.MessageExportCursor); ok {
|
||||
r1 = rf(rctx, cursor, limit)
|
||||
} else {
|
||||
r1 = ret.Get(1).(model.MessageExportCursor)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(request.CTX, model.MessageExportCursor, int) error); ok {
|
||||
r2 = rf(rctx, cursor, limit)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: compliance
|
||||
func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
ret := _m.Called(compliance)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Compliance)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok {
|
||||
r1 = rf(compliance)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: compliance
|
||||
func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
ret := _m.Called(compliance)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Compliance)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok {
|
||||
r1 = rf(compliance)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewComplianceStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ComplianceStore {
|
||||
mock := &ComplianceStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ContentFlaggingStore is an autogenerated mock type for the ContentFlaggingStore type
|
||||
type ContentFlaggingStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ClearCaches provides a mock function with no fields
|
||||
func (_m *ContentFlaggingStore) ClearCaches() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// GetReviewerSettings provides a mock function with no fields
|
||||
func (_m *ContentFlaggingStore) GetReviewerSettings() (*model.ReviewerIDsSettings, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetReviewerSettings")
|
||||
}
|
||||
|
||||
var r0 *model.ReviewerIDsSettings
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func() (*model.ReviewerIDsSettings, error)); ok {
|
||||
return rf()
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func() *model.ReviewerIDsSettings); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReviewerIDsSettings)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveReviewerSettings provides a mock function with given fields: reviewerSettings
|
||||
func (_m *ContentFlaggingStore) SaveReviewerSettings(reviewerSettings model.ReviewerIDsSettings) error {
|
||||
ret := _m.Called(reviewerSettings)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveReviewerSettings")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(model.ReviewerIDsSettings) error); ok {
|
||||
r0 = rf(reviewerSettings)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewContentFlaggingStore creates a new instance of ContentFlaggingStore. 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 NewContentFlaggingStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ContentFlaggingStore {
|
||||
mock := &ContentFlaggingStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
138
server/channels/store/storetest/mocks/DeliveryTrackingStore.go
Normal file
138
server/channels/store/storetest/mocks/DeliveryTrackingStore.go
Normal file
@@ -0,0 +1,138 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// DeliveryTrackingStore is an autogenerated mock type for the DeliveryTrackingStore type
|
||||
type DeliveryTrackingStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ClearCaches provides a mock function with no fields
|
||||
func (_m *DeliveryTrackingStore) ClearCaches() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// GetTrackedChannelIDs provides a mock function with given fields: rctx
|
||||
func (_m *DeliveryTrackingStore) GetTrackedChannelIDs(rctx request.CTX) ([]string, error) {
|
||||
ret := _m.Called(rctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTrackedChannelIDs")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) ([]string, error)); ok {
|
||||
return rf(rctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) []string); ok {
|
||||
r0 = rf(rctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) error); ok {
|
||||
r1 = rf(rctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// IsChannelTrackable provides a mock function with given fields: rctx, channelID
|
||||
func (_m *DeliveryTrackingStore) IsChannelTrackable(rctx request.CTX, channelID string) (bool, error) {
|
||||
ret := _m.Called(rctx, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IsChannelTrackable")
|
||||
}
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (bool, error)); ok {
|
||||
return rf(rctx, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) bool); ok {
|
||||
r0 = rf(rctx, channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// IsChannelTracked provides a mock function with given fields: rctx, channelID
|
||||
func (_m *DeliveryTrackingStore) IsChannelTracked(rctx request.CTX, channelID string) (bool, error) {
|
||||
ret := _m.Called(rctx, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IsChannelTracked")
|
||||
}
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (bool, error)); ok {
|
||||
return rf(rctx, channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) bool); ok {
|
||||
r0 = rf(rctx, channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveTrackedChannelIDs provides a mock function with given fields: rctx, channelIDs
|
||||
func (_m *DeliveryTrackingStore) SaveTrackedChannelIDs(rctx request.CTX, channelIDs []string) error {
|
||||
ret := _m.Called(rctx, channelIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveTrackedChannelIDs")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string) error); ok {
|
||||
r0 = rf(rctx, channelIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewDeliveryTrackingStore creates a new instance of DeliveryTrackingStore. 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 NewDeliveryTrackingStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DeliveryTrackingStore {
|
||||
mock := &DeliveryTrackingStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
128
server/channels/store/storetest/mocks/DesktopTokensStore.go
Normal file
128
server/channels/store/storetest/mocks/DesktopTokensStore.go
Normal file
@@ -0,0 +1,128 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
|
||||
// DesktopTokensStore is an autogenerated mock type for the DesktopTokensStore type
|
||||
type DesktopTokensStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: token
|
||||
func (_m *DesktopTokensStore) Delete(token string) error {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(token)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByUserId provides a mock function with given fields: userID
|
||||
func (_m *DesktopTokensStore) DeleteByUserId(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByUserId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOlderThan provides a mock function with given fields: minCreatedAt
|
||||
func (_m *DesktopTokensStore) DeleteOlderThan(minCreatedAt int64) error {
|
||||
ret := _m.Called(minCreatedAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOlderThan")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64) error); ok {
|
||||
r0 = rf(minCreatedAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetUserId provides a mock function with given fields: token, minCreatedAt
|
||||
func (_m *DesktopTokensStore) GetUserId(token string, minCreatedAt int64) (*string, error) {
|
||||
ret := _m.Called(token, minCreatedAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserId")
|
||||
}
|
||||
|
||||
var r0 *string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) (*string, error)); ok {
|
||||
return rf(token, minCreatedAt)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64) *string); ok {
|
||||
r0 = rf(token, minCreatedAt)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(token, minCreatedAt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Insert provides a mock function with given fields: token, createAt, userID
|
||||
func (_m *DesktopTokensStore) Insert(token string, createAt int64, userID string) error {
|
||||
ret := _m.Called(token, createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Insert")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string) error); ok {
|
||||
r0 = rf(token, createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewDesktopTokensStore creates a new instance of DesktopTokensStore. 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 NewDesktopTokensStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DesktopTokensStore {
|
||||
mock := &DesktopTokensStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
244
server/channels/store/storetest/mocks/DraftStore.go
Normal file
244
server/channels/store/storetest/mocks/DraftStore.go
Normal file
@@ -0,0 +1,244 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// DraftStore is an autogenerated mock type for the DraftStore type
|
||||
type DraftStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: userID, channelID, rootID
|
||||
func (_m *DraftStore) Delete(userID string, channelID string, rootID string) error {
|
||||
ret := _m.Called(userID, channelID, rootID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = rf(userID, channelID, rootID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteDraftsAssociatedWithPost provides a mock function with given fields: channelID, rootID
|
||||
func (_m *DraftStore) DeleteDraftsAssociatedWithPost(channelID string, rootID string) error {
|
||||
ret := _m.Called(channelID, rootID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteDraftsAssociatedWithPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(channelID, rootID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteEmptyDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteEmptyDraftsByCreateAtAndUserId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOrphanDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanDraftsByCreateAtAndUserId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userID, channelID, rootID, includeDeleted
|
||||
func (_m *DraftStore) Get(userID string, channelID string, rootID string, includeDeleted bool) (*model.Draft, error) {
|
||||
ret := _m.Called(userID, channelID, rootID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Draft)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
|
||||
r1 = rf(userID, channelID, rootID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetDraftsForUser provides a mock function with given fields: userID, teamID
|
||||
func (_m *DraftStore) GetDraftsForUser(userID string, teamID string) ([]*model.Draft, error) {
|
||||
ret := _m.Called(userID, teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDraftsForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Draft)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error) {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) (int64, string, error)); ok {
|
||||
return rf(createAt, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, string) int64); ok {
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, string) string); ok {
|
||||
r1 = rf(createAt, userID)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(int64, string) error); ok {
|
||||
r2 = rf(createAt, userID)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userId
|
||||
func (_m *DraftStore) PermanentDeleteByUser(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Upsert provides a mock function with given fields: d
|
||||
func (_m *DraftStore) Upsert(d *model.Draft) (*model.Draft, error) {
|
||||
ret := _m.Called(d)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Upsert")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Draft)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Draft) error); ok {
|
||||
r1 = rf(d)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewDraftStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DraftStore {
|
||||
mock := &DraftStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
228
server/channels/store/storetest/mocks/EmojiStore.go
Normal file
228
server/channels/store/storetest/mocks/EmojiStore.go
Normal file
@@ -0,0 +1,228 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// EmojiStore is an autogenerated mock type for the EmojiStore type
|
||||
type EmojiStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: emoji, timestamp
|
||||
func (_m *EmojiStore) Delete(emoji *model.Emoji, timestamp int64) error {
|
||||
ret := _m.Called(emoji, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Emoji, int64) error); ok {
|
||||
r0 = rf(emoji, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id, allowFromCache
|
||||
func (_m *EmojiStore) Get(rctx request.CTX, id string, allowFromCache bool) (*model.Emoji, error) {
|
||||
ret := _m.Called(rctx, id, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.Emoji
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) (*model.Emoji, error)); ok {
|
||||
return rf(rctx, id, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) *model.Emoji); ok {
|
||||
r0 = rf(rctx, id, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, bool) error); ok {
|
||||
r1 = rf(rctx, id, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByName provides a mock function with given fields: rctx, name, allowFromCache
|
||||
func (_m *EmojiStore) GetByName(rctx request.CTX, name string, allowFromCache bool) (*model.Emoji, error) {
|
||||
ret := _m.Called(rctx, name, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByName")
|
||||
}
|
||||
|
||||
var r0 *model.Emoji
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) (*model.Emoji, error)); ok {
|
||||
return rf(rctx, name, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) *model.Emoji); ok {
|
||||
r0 = rf(rctx, name, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, bool) error); ok {
|
||||
r1 = rf(rctx, name, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetList provides a mock function with given fields: offset, limit, sort
|
||||
func (_m *EmojiStore) GetList(offset int, limit int, sort string) ([]*model.Emoji, error) {
|
||||
ret := _m.Called(offset, limit, sort)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetList")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int, string) error); ok {
|
||||
r1 = rf(offset, limit, sort)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMultipleByName provides a mock function with given fields: rctx, names
|
||||
func (_m *EmojiStore) GetMultipleByName(rctx request.CTX, names []string) ([]*model.Emoji, error) {
|
||||
ret := _m.Called(rctx, names)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMultipleByName")
|
||||
}
|
||||
|
||||
var r0 []*model.Emoji
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string) ([]*model.Emoji, error)); ok {
|
||||
return rf(rctx, names)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string) []*model.Emoji); ok {
|
||||
r0 = rf(rctx, names)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string) error); ok {
|
||||
r1 = rf(rctx, names)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: emoji
|
||||
func (_m *EmojiStore) Save(emoji *model.Emoji) (*model.Emoji, error) {
|
||||
ret := _m.Called(emoji)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Emoji) error); ok {
|
||||
r1 = rf(emoji)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: name, prefixOnly, limit
|
||||
func (_m *EmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model.Emoji, error) {
|
||||
ret := _m.Called(name, prefixOnly, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Emoji)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool, int) error); ok {
|
||||
r1 = rf(name, prefixOnly, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewEmojiStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *EmojiStore {
|
||||
mock := &EmojiStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
664
server/channels/store/storetest/mocks/FileInfoStore.go
Normal file
664
server/channels/store/storetest/mocks/FileInfoStore.go
Normal file
@@ -0,0 +1,664 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// FileInfoStore is an autogenerated mock type for the FileInfoStore type
|
||||
type FileInfoStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AttachToPost provides a mock function with given fields: rctx, fileID, postID, channelID, creatorID
|
||||
func (_m *FileInfoStore) AttachToPost(rctx request.CTX, fileID string, postID string, channelID string, creatorID string) error {
|
||||
ret := _m.Called(rctx, fileID, postID, channelID, creatorID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AttachToPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string, string) error); ok {
|
||||
r0 = rf(rctx, fileID, postID, channelID, creatorID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ClearCaches provides a mock function with no fields
|
||||
func (_m *FileInfoStore) ClearCaches() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// CountAll provides a mock function with no fields
|
||||
func (_m *FileInfoStore) CountAll() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountAll")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteForPost provides a mock function with given fields: rctx, postID
|
||||
func (_m *FileInfoStore) DeleteForPost(rctx request.CTX, postID string) (string, error) {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteForPost")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (string, error)); ok {
|
||||
return rf(rctx, postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteForPostByIds provides a mock function with given fields: rctx, postId, fileIDs
|
||||
func (_m *FileInfoStore) DeleteForPostByIds(rctx request.CTX, postId string, fileIDs []string) error {
|
||||
ret := _m.Called(rctx, postId, fileIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteForPostByIds")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) error); ok {
|
||||
r0 = rf(rctx, postId, fileIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *FileInfoStore) Get(id string) (*model.FileInfo, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByIds provides a mock function with given fields: ids, includeDeleted, allowFromCache, readFromMaster
|
||||
func (_m *FileInfoStore) GetByIds(ids []string, includeDeleted bool, allowFromCache bool, readFromMaster bool) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(ids, includeDeleted, allowFromCache, readFromMaster)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByIds")
|
||||
}
|
||||
|
||||
var r0 []*model.FileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]string, bool, bool, bool) ([]*model.FileInfo, error)); ok {
|
||||
return rf(ids, includeDeleted, allowFromCache, readFromMaster)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]string, bool, bool, bool) []*model.FileInfo); ok {
|
||||
r0 = rf(ids, includeDeleted, allowFromCache, readFromMaster)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string, bool, bool, bool) error); ok {
|
||||
r1 = rf(ids, includeDeleted, allowFromCache, readFromMaster)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByPath provides a mock function with given fields: path
|
||||
func (_m *FileInfoStore) GetByPath(path string) (*model.FileInfo, error) {
|
||||
ret := _m.Called(path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByPath")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(path)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetFilesBatchForIndexing provides a mock function with given fields: startTime, startFileID, includeDeleted, limit
|
||||
func (_m *FileInfoStore) GetFilesBatchForIndexing(startTime int64, startFileID string, includeDeleted bool, limit int) ([]*model.FileForIndexing, error) {
|
||||
ret := _m.Called(startTime, startFileID, includeDeleted, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFilesBatchForIndexing")
|
||||
}
|
||||
|
||||
var r0 []*model.FileForIndexing
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string, bool, int) ([]*model.FileForIndexing, error)); ok {
|
||||
return rf(startTime, startFileID, includeDeleted, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, string, bool, int) []*model.FileForIndexing); ok {
|
||||
r0 = rf(startTime, startFileID, includeDeleted, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileForIndexing)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, string, bool, int) error); ok {
|
||||
r1 = rf(startTime, startFileID, includeDeleted, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPost provides a mock function with given fields: postID, readFromMaster, includeDeleted, allowFromCache
|
||||
func (_m *FileInfoStore) GetForPost(postID string, readFromMaster bool, includeDeleted bool, allowFromCache bool) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(postID, readFromMaster, includeDeleted, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPost")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool, bool, bool) error); ok {
|
||||
r1 = rf(postID, readFromMaster, includeDeleted, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForUser provides a mock function with given fields: userID
|
||||
func (_m *FileInfoStore) GetForUser(userID string) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetFromMaster provides a mock function with given fields: id
|
||||
func (_m *FileInfoStore) GetFromMaster(id string) (*model.FileInfo, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFromMaster")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetStorageUsage provides a mock function with given fields: allowFromCache, includeDeleted
|
||||
func (_m *FileInfoStore) GetStorageUsage(allowFromCache bool, includeDeleted bool) (int64, error) {
|
||||
ret := _m.Called(allowFromCache, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetStorageUsage")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(bool, bool) error); ok {
|
||||
r1 = rf(allowFromCache, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUptoNSizeFileTime provides a mock function with given fields: n
|
||||
func (_m *FileInfoStore) GetUptoNSizeFileTime(n int64) (int64, error) {
|
||||
ret := _m.Called(n)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUptoNSizeFileTime")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
||||
r1 = rf(n)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetWithOptions provides a mock function with given fields: page, perPage, opt
|
||||
func (_m *FileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, error) {
|
||||
ret := _m.Called(page, perPage, opt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetWithOptions")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int, *model.GetFileInfosOptions) error); ok {
|
||||
r1 = rf(page, perPage, opt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateFileInfosForPostCache provides a mock function with given fields: postID, deleted
|
||||
func (_m *FileInfoStore) InvalidateFileInfosForPostCache(postID string, deleted bool) {
|
||||
_m.Called(postID, deleted)
|
||||
}
|
||||
|
||||
// PermanentDelete provides a mock function with given fields: rctx, fileID
|
||||
func (_m *FileInfoStore) PermanentDelete(rctx request.CTX, fileID string) error {
|
||||
ret := _m.Called(rctx, fileID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDelete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, fileID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteBatch provides a mock function with given fields: rctx, endTime, limit
|
||||
func (_m *FileInfoStore) PermanentDeleteBatch(rctx request.CTX, endTime int64, limit int64) (int64, error) {
|
||||
ret := _m.Called(rctx, endTime, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatch")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64) (int64, error)); ok {
|
||||
return rf(rctx, endTime, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64) int64); ok {
|
||||
r0 = rf(rctx, endTime, limit)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, int64, int64) error); ok {
|
||||
r1 = rf(rctx, endTime, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: rctx, userID
|
||||
func (_m *FileInfoStore) PermanentDeleteByUser(rctx request.CTX, userID string) (int64, error) {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (int64, error)); ok {
|
||||
return rf(rctx, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) int64); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteForPost provides a mock function with given fields: rctx, postID
|
||||
func (_m *FileInfoStore) PermanentDeleteForPost(rctx request.CTX, postID string) error {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteForPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RefreshFileStats provides a mock function with no fields
|
||||
func (_m *FileInfoStore) RefreshFileStats() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RefreshFileStats")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RestoreForPostByIds provides a mock function with given fields: rctx, postId, fileIDs
|
||||
func (_m *FileInfoStore) RestoreForPostByIds(rctx request.CTX, postId string, fileIDs []string) error {
|
||||
ret := _m.Called(rctx, postId, fileIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RestoreForPostByIds")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) error); ok {
|
||||
r0 = rf(rctx, postId, fileIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, info
|
||||
func (_m *FileInfoStore) Save(rctx request.CTX, info *model.FileInfo) (*model.FileInfo, error) {
|
||||
ret := _m.Called(rctx, info)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.FileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.FileInfo) (*model.FileInfo, error)); ok {
|
||||
return rf(rctx, info)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.FileInfo) *model.FileInfo); ok {
|
||||
r0 = rf(rctx, info)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.FileInfo) error); ok {
|
||||
r1 = rf(rctx, info)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: rctx, paramsList, userID, teamID, page, perPage
|
||||
func (_m *FileInfoStore) Search(rctx request.CTX, paramsList []*model.SearchParams, userID string, teamID string, page int, perPage int) (*model.FileInfoList, error) {
|
||||
ret := _m.Called(rctx, paramsList, userID, teamID, page, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
var r0 *model.FileInfoList
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []*model.SearchParams, string, string, int, int) (*model.FileInfoList, error)); ok {
|
||||
return rf(rctx, paramsList, userID, teamID, page, perPage)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []*model.SearchParams, string, string, int, int) *model.FileInfoList); ok {
|
||||
r0 = rf(rctx, paramsList, userID, teamID, page, perPage)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfoList)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []*model.SearchParams, string, string, int, int) error); ok {
|
||||
r1 = rf(rctx, paramsList, userID, teamID, page, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetContent provides a mock function with given fields: rctx, fileID, content
|
||||
func (_m *FileInfoStore) SetContent(rctx request.CTX, fileID string, content string) error {
|
||||
ret := _m.Called(rctx, fileID, content)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetContent")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) error); ok {
|
||||
r0 = rf(rctx, fileID, content)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Upsert provides a mock function with given fields: rctx, info
|
||||
func (_m *FileInfoStore) Upsert(rctx request.CTX, info *model.FileInfo) (*model.FileInfo, error) {
|
||||
ret := _m.Called(rctx, info)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Upsert")
|
||||
}
|
||||
|
||||
var r0 *model.FileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.FileInfo) (*model.FileInfo, error)); ok {
|
||||
return rf(rctx, info)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.FileInfo) *model.FileInfo); ok {
|
||||
r0 = rf(rctx, info)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.FileInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.FileInfo) error); ok {
|
||||
r1 = rf(rctx, info)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewFileInfoStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *FileInfoStore {
|
||||
mock := &FileInfoStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
1639
server/channels/store/storetest/mocks/GroupStore.go
Normal file
1639
server/channels/store/storetest/mocks/GroupStore.go
Normal file
File diff suppressed because it is too large
Load Diff
591
server/channels/store/storetest/mocks/JobStore.go
Normal file
591
server/channels/store/storetest/mocks/JobStore.go
Normal file
@@ -0,0 +1,591 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// JobStore is an autogenerated mock type for the JobStore type
|
||||
type JobStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Cleanup provides a mock function with given fields: expiryTime, batchSize
|
||||
func (_m *JobStore) Cleanup(expiryTime int64, batchSize int) error {
|
||||
ret := _m.Called(expiryTime, batchSize)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Cleanup")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int) error); ok {
|
||||
r0 = rf(expiryTime, batchSize)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *JobStore) Delete(id string) (string, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id
|
||||
func (_m *JobStore) Get(rctx request.CTX, id string) (*model.Job, error) {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Job, error)); ok {
|
||||
return rf(rctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Job); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByStatus provides a mock function with given fields: rctx, status
|
||||
func (_m *JobStore) GetAllByStatus(rctx request.CTX, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, status)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByStatus")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(rctx, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByType provides a mock function with given fields: rctx, jobType
|
||||
func (_m *JobStore) GetAllByType(rctx request.CTX, jobType string) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, jobType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByType")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobType)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobType)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypeAndStatus provides a mock function with given fields: rctx, jobType, status
|
||||
func (_m *JobStore) GetAllByTypeAndStatus(rctx request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, jobType, status)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypeAndStatus")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobType, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobType, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, jobType, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypePage provides a mock function with given fields: rctx, jobType, offset, limit
|
||||
func (_m *JobStore) GetAllByTypePage(rctx request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, jobType, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypePage")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobType, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobType, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, int, int) error); ok {
|
||||
r1 = rf(rctx, jobType, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypesAndStatusesPage provides a mock function with given fields: rctx, jobType, status, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesAndStatusesPage(rctx request.CTX, jobType []string, status []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, jobType, status, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypesAndStatusesPage")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, []string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobType, status, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, []string, int, int) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobType, status, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, []string, int, int) error); ok {
|
||||
r1 = rf(rctx, jobType, status, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypesPage provides a mock function with given fields: rctx, jobTypes, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesPage(rctx request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(rctx, jobTypes, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypesPage")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobTypes, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobTypes, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, int, int) error); ok {
|
||||
r1 = rf(rctx, jobTypes, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByTypeAndData provides a mock function with given fields: rctx, jobType, data, useMaster, statuses
|
||||
func (_m *JobStore) GetByTypeAndData(rctx request.CTX, jobType string, data map[string]string, useMaster bool, statuses ...string) ([]*model.Job, error) {
|
||||
_va := make([]interface{}, len(statuses))
|
||||
for _i := range statuses {
|
||||
_va[_i] = statuses[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, rctx, jobType, data, useMaster)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByTypeAndData")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string, bool, ...string) ([]*model.Job, error)); ok {
|
||||
return rf(rctx, jobType, data, useMaster, statuses...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string, bool, ...string) []*model.Job); ok {
|
||||
r0 = rf(rctx, jobType, data, useMaster, statuses...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, map[string]string, bool, ...string) error); ok {
|
||||
r1 = rf(rctx, jobType, data, useMaster, statuses...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetCountByStatusAndType provides a mock function with given fields: status, jobType
|
||||
func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int64, error) {
|
||||
ret := _m.Called(status, jobType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetCountByStatusAndType")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(status, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetNewestJobByStatusAndType provides a mock function with given fields: status, jobType
|
||||
func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, error) {
|
||||
ret := _m.Called(status, jobType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetNewestJobByStatusAndType")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(status, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetNewestJobByStatusesAndType provides a mock function with given fields: statuses, jobType
|
||||
func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, error) {
|
||||
ret := _m.Called(statuses, jobType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetNewestJobByStatusesAndType")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string, string) error); ok {
|
||||
r1 = rf(statuses, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: job
|
||||
func (_m *JobStore) Save(job *model.Job) (*model.Job, error) {
|
||||
ret := _m.Called(job)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Job) error); ok {
|
||||
r1 = rf(job)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveOnce provides a mock function with given fields: job
|
||||
func (_m *JobStore) SaveOnce(job *model.Job) (*model.Job, error) {
|
||||
ret := _m.Called(job)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOnce")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Job) error); ok {
|
||||
r1 = rf(job)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveOnceByTypeAndData provides a mock function with given fields: job, data
|
||||
func (_m *JobStore) SaveOnceByTypeAndData(job *model.Job, data map[string]string) (*model.Job, error) {
|
||||
ret := _m.Called(job, data)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOnceByTypeAndData")
|
||||
}
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Job, map[string]string) (*model.Job, error)); ok {
|
||||
return rf(job, data)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.Job, map[string]string) *model.Job); ok {
|
||||
r0 = rf(job, data)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Job, map[string]string) error); ok {
|
||||
r1 = rf(job, data)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateOptimistically provides a mock function with given fields: job, currentStatus
|
||||
func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (*model.Job, error) {
|
||||
ret := _m.Called(job, currentStatus)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateOptimistically")
|
||||
}
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Job, string) (*model.Job, error)); ok {
|
||||
return rf(job, currentStatus)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.Job, string) *model.Job); ok {
|
||||
r0 = rf(job, currentStatus)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Job, string) error); ok {
|
||||
r1 = rf(job, currentStatus)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateStatus provides a mock function with given fields: id, status
|
||||
func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, error) {
|
||||
ret := _m.Called(id, status)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateStatus")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(id, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateStatusOptimistically provides a mock function with given fields: id, currentStatus, newStatus
|
||||
func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (*model.Job, error) {
|
||||
ret := _m.Called(id, currentStatus, newStatus)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateStatusOptimistically")
|
||||
}
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) (*model.Job, error)); ok {
|
||||
return rf(id, currentStatus, newStatus)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) *model.Job); ok {
|
||||
r0 = rf(id, currentStatus, newStatus)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(id, currentStatus, newStatus)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewJobStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *JobStore {
|
||||
mock := &JobStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
108
server/channels/store/storetest/mocks/LicenseStore.go
Normal file
108
server/channels/store/storetest/mocks/LicenseStore.go
Normal file
@@ -0,0 +1,108 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// LicenseStore is an autogenerated mock type for the LicenseStore type
|
||||
type LicenseStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id
|
||||
func (_m *LicenseStore) Get(rctx request.CTX, id string) (*model.LicenseRecord, error) {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.LicenseRecord
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.LicenseRecord, error)); ok {
|
||||
return rf(rctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.LicenseRecord); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.LicenseRecord)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with no fields
|
||||
func (_m *LicenseStore) GetAll() ([]*model.LicenseRecord, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.LicenseRecord)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: license
|
||||
func (_m *LicenseStore) Save(license *model.LicenseRecord) error {
|
||||
ret := _m.Called(license)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.LicenseRecord) error); ok {
|
||||
r0 = rf(license)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewLicenseStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *LicenseStore {
|
||||
mock := &LicenseStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
89
server/channels/store/storetest/mocks/LinkMetadataStore.go
Normal file
89
server/channels/store/storetest/mocks/LinkMetadataStore.go
Normal file
@@ -0,0 +1,89 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// LinkMetadataStore is an autogenerated mock type for the LinkMetadataStore type
|
||||
type LinkMetadataStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: url, timestamp
|
||||
func (_m *LinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetadata, error) {
|
||||
ret := _m.Called(url, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.LinkMetadata)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(url, timestamp)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: linkMetadata
|
||||
func (_m *LinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.LinkMetadata, error) {
|
||||
ret := _m.Called(linkMetadata)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.LinkMetadata)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.LinkMetadata) error); ok {
|
||||
r1 = rf(linkMetadata)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewLinkMetadataStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *LinkMetadataStore {
|
||||
mock := &LinkMetadataStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
155
server/channels/store/storetest/mocks/NotifyAdminStore.go
Normal file
155
server/channels/store/storetest/mocks/NotifyAdminStore.go
Normal file
@@ -0,0 +1,155 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NotifyAdminStore is an autogenerated mock type for the NotifyAdminStore type
|
||||
type NotifyAdminStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteBefore provides a mock function with given fields: trial, now
|
||||
func (_m *NotifyAdminStore) DeleteBefore(trial bool, now int64) error {
|
||||
ret := _m.Called(trial, now)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteBefore")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(bool, int64) error); ok {
|
||||
r0 = rf(trial, now)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: trial
|
||||
func (_m *NotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData, error) {
|
||||
ret := _m.Called(trial)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.NotifyAdminData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(bool) error); ok {
|
||||
r1 = rf(trial)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetDataByUserIdAndFeature provides a mock function with given fields: userID, feature
|
||||
func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
ret := _m.Called(userID, feature)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDataByUserIdAndFeature")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.NotifyAdminData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.MattermostFeature) error); ok {
|
||||
r1 = rf(userID, feature)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: data
|
||||
func (_m *NotifyAdminStore) Save(data *model.NotifyAdminData) (*model.NotifyAdminData, error) {
|
||||
ret := _m.Called(data)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.NotifyAdminData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.NotifyAdminData) error); ok {
|
||||
r1 = rf(data)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: userID, requiredPlan, requiredFeature, now
|
||||
func (_m *NotifyAdminStore) Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
ret := _m.Called(userID, requiredPlan, requiredFeature, now)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.MattermostFeature, int64) error); ok {
|
||||
r0 = rf(userID, requiredPlan, requiredFeature, now)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewNotifyAdminStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *NotifyAdminStore {
|
||||
mock := &NotifyAdminStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
575
server/channels/store/storetest/mocks/OAuthStore.go
Normal file
575
server/channels/store/storetest/mocks/OAuthStore.go
Normal file
@@ -0,0 +1,575 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// OAuthStore is an autogenerated mock type for the OAuthStore type
|
||||
type OAuthStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteApp provides a mock function with given fields: id
|
||||
func (_m *OAuthStore) DeleteApp(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteApp")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetAccessData provides a mock function with given fields: token
|
||||
func (_m *OAuthStore) GetAccessData(token string) (*model.AccessData, error) {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAccessData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(token)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAccessDataByRefreshToken provides a mock function with given fields: token
|
||||
func (_m *OAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessData, error) {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAccessDataByRefreshToken")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(token)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAccessDataByUserForApp provides a mock function with given fields: userID, clientID
|
||||
func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAccessDataByUserForApp")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, clientID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetApp provides a mock function with given fields: id
|
||||
func (_m *OAuthStore) GetApp(id string) (*model.OAuthApp, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetApp")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAppByUser provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *OAuthStore) GetAppByUser(userID string, offset int, limit int) ([]*model.OAuthApp, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAppByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetApps provides a mock function with given fields: offset, limit
|
||||
func (_m *OAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetApps")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAuthData provides a mock function with given fields: code
|
||||
func (_m *OAuthStore) GetAuthData(code string) (*model.AuthData, error) {
|
||||
ret := _m.Called(code)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAuthData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AuthData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(code)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAuthorizedApps provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *OAuthStore) GetAuthorizedApps(userID string, offset int, limit int) ([]*model.OAuthApp, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAuthorizedApps")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetPreviousAccessData provides a mock function with given fields: userID, clientID
|
||||
func (_m *OAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPreviousAccessData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, clientID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteAuthDataByUser provides a mock function with given fields: userID
|
||||
func (_m *OAuthStore) PermanentDeleteAuthDataByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteAuthDataByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAccessData provides a mock function with given fields: token
|
||||
func (_m *OAuthStore) RemoveAccessData(token string) error {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAccessData")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(token)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAllAccessData provides a mock function with no fields
|
||||
func (_m *OAuthStore) RemoveAllAccessData() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAllAccessData")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAuthData provides a mock function with given fields: code
|
||||
func (_m *OAuthStore) RemoveAuthData(code string) error {
|
||||
ret := _m.Called(code)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAuthData")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(code)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAuthDataByClientId provides a mock function with given fields: clientID, userID
|
||||
func (_m *OAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
||||
ret := _m.Called(clientID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAuthDataByClientId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(clientID, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAuthDataByUserId provides a mock function with given fields: userID
|
||||
func (_m *OAuthStore) RemoveAuthDataByUserId(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAuthDataByUserId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveAccessData provides a mock function with given fields: accessData
|
||||
func (_m *OAuthStore) SaveAccessData(accessData *model.AccessData) (*model.AccessData, error) {
|
||||
ret := _m.Called(accessData)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveAccessData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok {
|
||||
r1 = rf(accessData)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveApp provides a mock function with given fields: app
|
||||
func (_m *OAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, error) {
|
||||
ret := _m.Called(app)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveApp")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok {
|
||||
r1 = rf(app)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveAuthData provides a mock function with given fields: authData
|
||||
func (_m *OAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, error) {
|
||||
ret := _m.Called(authData)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveAuthData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AuthData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.AuthData) error); ok {
|
||||
r1 = rf(authData)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateAccessData provides a mock function with given fields: accessData
|
||||
func (_m *OAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.AccessData, error) {
|
||||
ret := _m.Called(accessData)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateAccessData")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok {
|
||||
r1 = rf(accessData)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateApp provides a mock function with given fields: app
|
||||
func (_m *OAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, error) {
|
||||
ret := _m.Called(app)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateApp")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OAuthApp)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok {
|
||||
r1 = rf(app)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewOAuthStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *OAuthStore {
|
||||
mock := &OAuthStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// OutgoingOAuthConnectionStore is an autogenerated mock type for the OutgoingOAuthConnectionStore type
|
||||
type OutgoingOAuthConnectionStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteConnection provides a mock function with given fields: rctx, id
|
||||
func (_m *OutgoingOAuthConnectionStore) DeleteConnection(rctx request.CTX, id string) error {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteConnection")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetConnection provides a mock function with given fields: rctx, id
|
||||
func (_m *OutgoingOAuthConnectionStore) GetConnection(rctx request.CTX, id string) (*model.OutgoingOAuthConnection, error) {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetConnection")
|
||||
}
|
||||
|
||||
var r0 *model.OutgoingOAuthConnection
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.OutgoingOAuthConnection, error)); ok {
|
||||
return rf(rctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.OutgoingOAuthConnection); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingOAuthConnection)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetConnections provides a mock function with given fields: rctx, filters
|
||||
func (_m *OutgoingOAuthConnectionStore) GetConnections(rctx request.CTX, filters model.OutgoingOAuthConnectionGetConnectionsFilter) ([]*model.OutgoingOAuthConnection, error) {
|
||||
ret := _m.Called(rctx, filters)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetConnections")
|
||||
}
|
||||
|
||||
var r0 []*model.OutgoingOAuthConnection
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.OutgoingOAuthConnectionGetConnectionsFilter) ([]*model.OutgoingOAuthConnection, error)); ok {
|
||||
return rf(rctx, filters)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, model.OutgoingOAuthConnectionGetConnectionsFilter) []*model.OutgoingOAuthConnection); ok {
|
||||
r0 = rf(rctx, filters)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingOAuthConnection)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, model.OutgoingOAuthConnectionGetConnectionsFilter) error); ok {
|
||||
r1 = rf(rctx, filters)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveConnection provides a mock function with given fields: rctx, conn
|
||||
func (_m *OutgoingOAuthConnectionStore) SaveConnection(rctx request.CTX, conn *model.OutgoingOAuthConnection) (*model.OutgoingOAuthConnection, error) {
|
||||
ret := _m.Called(rctx, conn)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveConnection")
|
||||
}
|
||||
|
||||
var r0 *model.OutgoingOAuthConnection
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.OutgoingOAuthConnection) (*model.OutgoingOAuthConnection, error)); ok {
|
||||
return rf(rctx, conn)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.OutgoingOAuthConnection) *model.OutgoingOAuthConnection); ok {
|
||||
r0 = rf(rctx, conn)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingOAuthConnection)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.OutgoingOAuthConnection) error); ok {
|
||||
r1 = rf(rctx, conn)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateConnection provides a mock function with given fields: rctx, conn
|
||||
func (_m *OutgoingOAuthConnectionStore) UpdateConnection(rctx request.CTX, conn *model.OutgoingOAuthConnection) (*model.OutgoingOAuthConnection, error) {
|
||||
ret := _m.Called(rctx, conn)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateConnection")
|
||||
}
|
||||
|
||||
var r0 *model.OutgoingOAuthConnection
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.OutgoingOAuthConnection) (*model.OutgoingOAuthConnection, error)); ok {
|
||||
return rf(rctx, conn)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.OutgoingOAuthConnection) *model.OutgoingOAuthConnection); ok {
|
||||
r0 = rf(rctx, conn)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingOAuthConnection)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.OutgoingOAuthConnection) error); ok {
|
||||
r1 = rf(rctx, conn)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewOutgoingOAuthConnectionStore creates a new instance of OutgoingOAuthConnectionStore. 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 NewOutgoingOAuthConnectionStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *OutgoingOAuthConnectionStore {
|
||||
mock := &OutgoingOAuthConnectionStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
257
server/channels/store/storetest/mocks/PluginStore.go
Normal file
257
server/channels/store/storetest/mocks/PluginStore.go
Normal file
@@ -0,0 +1,257 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PluginStore is an autogenerated mock type for the PluginStore type
|
||||
type PluginStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CompareAndDelete provides a mock function with given fields: keyVal, oldValue
|
||||
func (_m *PluginStore) CompareAndDelete(keyVal *model.PluginKeyValue, oldValue []byte) (bool, error) {
|
||||
ret := _m.Called(keyVal, oldValue)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CompareAndDelete")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PluginKeyValue, []byte) error); ok {
|
||||
r1 = rf(keyVal, oldValue)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CompareAndSet provides a mock function with given fields: keyVal, oldValue
|
||||
func (_m *PluginStore) CompareAndSet(keyVal *model.PluginKeyValue, oldValue []byte) (bool, error) {
|
||||
ret := _m.Called(keyVal, oldValue)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CompareAndSet")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PluginKeyValue, []byte) error); ok {
|
||||
r1 = rf(keyVal, oldValue)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: pluginID, key
|
||||
func (_m *PluginStore) Delete(pluginID string, key string) error {
|
||||
ret := _m.Called(pluginID, key)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(pluginID, key)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteAllExpired provides a mock function with no fields
|
||||
func (_m *PluginStore) DeleteAllExpired() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteAllExpired")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteAllForPlugin provides a mock function with given fields: PluginID
|
||||
func (_m *PluginStore) DeleteAllForPlugin(PluginID string) error {
|
||||
ret := _m.Called(PluginID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteAllForPlugin")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(PluginID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: pluginID, key
|
||||
func (_m *PluginStore) Get(pluginID string, key string) (*model.PluginKeyValue, error) {
|
||||
ret := _m.Called(pluginID, key)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PluginKeyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(pluginID, key)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// List provides a mock function with given fields: pluginID, page, perPage
|
||||
func (_m *PluginStore) List(pluginID string, page int, perPage int) ([]string, error) {
|
||||
ret := _m.Called(pluginID, page, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for List")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(pluginID, page, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveOrUpdate provides a mock function with given fields: keyVal
|
||||
func (_m *PluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*model.PluginKeyValue, error) {
|
||||
ret := _m.Called(keyVal)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOrUpdate")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PluginKeyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PluginKeyValue) error); ok {
|
||||
r1 = rf(keyVal)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetWithOptions provides a mock function with given fields: pluginID, key, value, options
|
||||
func (_m *PluginStore) SetWithOptions(pluginID string, key string, value []byte, options model.PluginKVSetOptions) (bool, error) {
|
||||
ret := _m.Called(pluginID, key, value, options)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetWithOptions")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, []byte, model.PluginKVSetOptions) error); ok {
|
||||
r1 = rf(pluginID, key, value, options)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPluginStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PluginStore {
|
||||
mock := &PluginStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PostAcknowledgementStore is an autogenerated mock type for the PostAcknowledgementStore type
|
||||
type PostAcknowledgementStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// BatchDelete provides a mock function with given fields: acknowledgements
|
||||
func (_m *PostAcknowledgementStore) BatchDelete(acknowledgements []*model.PostAcknowledgement) error {
|
||||
ret := _m.Called(acknowledgements)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for BatchDelete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.PostAcknowledgement) error); ok {
|
||||
r0 = rf(acknowledgements)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// BatchSave provides a mock function with given fields: acknowledgements
|
||||
func (_m *PostAcknowledgementStore) BatchSave(acknowledgements []*model.PostAcknowledgement) ([]*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(acknowledgements)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for BatchSave")
|
||||
}
|
||||
|
||||
var r0 []*model.PostAcknowledgement
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.PostAcknowledgement) ([]*model.PostAcknowledgement, error)); ok {
|
||||
return rf(acknowledgements)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]*model.PostAcknowledgement) []*model.PostAcknowledgement); ok {
|
||||
r0 = rf(acknowledgements)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]*model.PostAcknowledgement) error); ok {
|
||||
r1 = rf(acknowledgements)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: acknowledgement
|
||||
func (_m *PostAcknowledgementStore) Delete(acknowledgement *model.PostAcknowledgement) error {
|
||||
ret := _m.Called(acknowledgement)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PostAcknowledgement) error); ok {
|
||||
r0 = rf(acknowledgement)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteAllForPost provides a mock function with given fields: postID
|
||||
func (_m *PostAcknowledgementStore) DeleteAllForPost(postID string) error {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteAllForPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: postID, userID
|
||||
func (_m *PostAcknowledgementStore) Get(postID string, userID string) (*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(postID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(postID, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPost provides a mock function with given fields: postID
|
||||
func (_m *PostAcknowledgementStore) GetForPost(postID string) ([]*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPost")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPostSince provides a mock function with given fields: postID, since, excludeRemoteID, inclDeleted
|
||||
func (_m *PostAcknowledgementStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(postID, since, excludeRemoteID, inclDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPostSince")
|
||||
}
|
||||
|
||||
var r0 []*model.PostAcknowledgement
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string, bool) ([]*model.PostAcknowledgement, error)); ok {
|
||||
return rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string, bool) []*model.PostAcknowledgement); ok {
|
||||
r0 = rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64, string, bool) error); ok {
|
||||
r1 = rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPosts provides a mock function with given fields: postIds
|
||||
func (_m *PostAcknowledgementStore) GetForPosts(postIds []string) ([]*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(postIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPosts")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(postIds)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSingle provides a mock function with given fields: userID, postID, remoteID
|
||||
func (_m *PostAcknowledgementStore) GetSingle(userID string, postID string, remoteID string) (*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(userID, postID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSingle")
|
||||
}
|
||||
|
||||
var r0 *model.PostAcknowledgement
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) (*model.PostAcknowledgement, error)); ok {
|
||||
return rf(userID, postID, remoteID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) *model.PostAcknowledgement); ok {
|
||||
r0 = rf(userID, postID, remoteID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(userID, postID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveWithModel provides a mock function with given fields: acknowledgement
|
||||
func (_m *PostAcknowledgementStore) SaveWithModel(acknowledgement *model.PostAcknowledgement) (*model.PostAcknowledgement, error) {
|
||||
ret := _m.Called(acknowledgement)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveWithModel")
|
||||
}
|
||||
|
||||
var r0 *model.PostAcknowledgement
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PostAcknowledgement) (*model.PostAcknowledgement, error)); ok {
|
||||
return rf(acknowledgement)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PostAcknowledgement) *model.PostAcknowledgement); ok {
|
||||
r0 = rf(acknowledgement)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostAcknowledgement)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PostAcknowledgement) error); ok {
|
||||
r1 = rf(acknowledgement)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPostAcknowledgementStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PostAcknowledgementStore {
|
||||
mock := &PostAcknowledgementStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PostPersistentNotificationStore is an autogenerated mock type for the PostPersistentNotificationStore type
|
||||
type PostPersistentNotificationStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: postIds
|
||||
func (_m *PostPersistentNotificationStore) Delete(postIds []string) error {
|
||||
ret := _m.Called(postIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(postIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByChannel provides a mock function with given fields: channelIds
|
||||
func (_m *PostPersistentNotificationStore) DeleteByChannel(channelIds []string) error {
|
||||
ret := _m.Called(channelIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByChannel")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(channelIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByTeam provides a mock function with given fields: teamIds
|
||||
func (_m *PostPersistentNotificationStore) DeleteByTeam(teamIds []string) error {
|
||||
ret := _m.Called(teamIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByTeam")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(teamIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteExpired provides a mock function with given fields: maxSentCount
|
||||
func (_m *PostPersistentNotificationStore) DeleteExpired(maxSentCount int16) error {
|
||||
ret := _m.Called(maxSentCount)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteExpired")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int16) error); ok {
|
||||
r0 = rf(maxSentCount)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: params
|
||||
func (_m *PostPersistentNotificationStore) Get(params model.GetPersistentNotificationsPostsParams) ([]*model.PostPersistentNotifications, error) {
|
||||
ret := _m.Called(params)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 []*model.PostPersistentNotifications
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(model.GetPersistentNotificationsPostsParams) ([]*model.PostPersistentNotifications, error)); ok {
|
||||
return rf(params)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.GetPersistentNotificationsPostsParams) []*model.PostPersistentNotifications); ok {
|
||||
r0 = rf(params)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostPersistentNotifications)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.GetPersistentNotificationsPostsParams) error); ok {
|
||||
r1 = rf(params)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSingle provides a mock function with given fields: postID
|
||||
func (_m *PostPersistentNotificationStore) GetSingle(postID string) (*model.PostPersistentNotifications, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSingle")
|
||||
}
|
||||
|
||||
var r0 *model.PostPersistentNotifications
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.PostPersistentNotifications, error)); ok {
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.PostPersistentNotifications); ok {
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostPersistentNotifications)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateLastActivity provides a mock function with given fields: postIds
|
||||
func (_m *PostPersistentNotificationStore) UpdateLastActivity(postIds []string) error {
|
||||
ret := _m.Called(postIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateLastActivity")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(postIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewPostPersistentNotificationStore creates a new instance of PostPersistentNotificationStore. 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 NewPostPersistentNotificationStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PostPersistentNotificationStore {
|
||||
mock := &PostPersistentNotificationStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
168
server/channels/store/storetest/mocks/PostPriorityStore.go
Normal file
168
server/channels/store/storetest/mocks/PostPriorityStore.go
Normal file
@@ -0,0 +1,168 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PostPriorityStore is an autogenerated mock type for the PostPriorityStore type
|
||||
type PostPriorityStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: postID
|
||||
func (_m *PostPriorityStore) Delete(postID string) error {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetForPost provides a mock function with given fields: postID
|
||||
func (_m *PostPriorityStore) GetForPost(postID string) (*model.PostPriority, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPost")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostPriority)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPostWithContext provides a mock function with given fields: rctx, postID
|
||||
func (_m *PostPriorityStore) GetForPostWithContext(rctx request.CTX, postID string) (*model.PostPriority, error) {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPostWithContext")
|
||||
}
|
||||
|
||||
var r0 *model.PostPriority
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.PostPriority, error)); ok {
|
||||
return rf(rctx, postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.PostPriority); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostPriority)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPosts provides a mock function with given fields: ids
|
||||
func (_m *PostPriorityStore) GetForPosts(ids []string) ([]*model.PostPriority, error) {
|
||||
ret := _m.Called(ids)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPosts")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PostPriority)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(ids)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: priority
|
||||
func (_m *PostPriorityStore) Save(priority *model.PostPriority) (*model.PostPriority, error) {
|
||||
ret := _m.Called(priority)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.PostPriority
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PostPriority) (*model.PostPriority, error)); ok {
|
||||
return rf(priority)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PostPriority) *model.PostPriority); ok {
|
||||
r0 = rf(priority)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostPriority)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PostPriority) error); ok {
|
||||
r1 = rf(priority)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPostPriorityStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PostPriorityStore {
|
||||
mock := &PostPriorityStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
1537
server/channels/store/storetest/mocks/PostStore.go
Normal file
1537
server/channels/store/storetest/mocks/PostStore.go
Normal file
File diff suppressed because it is too large
Load Diff
323
server/channels/store/storetest/mocks/PreferenceStore.go
Normal file
323
server/channels/store/storetest/mocks/PreferenceStore.go
Normal file
@@ -0,0 +1,323 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PreferenceStore is an autogenerated mock type for the PreferenceStore type
|
||||
type PreferenceStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CleanupFlagsBatch provides a mock function with given fields: limit
|
||||
func (_m *PreferenceStore) CleanupFlagsBatch(limit int64) (int64, error) {
|
||||
ret := _m.Called(limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CleanupFlagsBatch")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
||||
r1 = rf(limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: userID, category, name
|
||||
func (_m *PreferenceStore) Delete(userID string, category string, name string) error {
|
||||
ret := _m.Called(userID, category, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = rf(userID, category, name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteCategory provides a mock function with given fields: userID, category
|
||||
func (_m *PreferenceStore) DeleteCategory(userID string, category string) error {
|
||||
ret := _m.Called(userID, category)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteCategory")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, category)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteCategoryAndName provides a mock function with given fields: category, name
|
||||
func (_m *PreferenceStore) DeleteCategoryAndName(category string, name string) error {
|
||||
ret := _m.Called(category, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteCategoryAndName")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(category, name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteInvalidVisibleDmsGms provides a mock function with no fields
|
||||
func (_m *PreferenceStore) DeleteInvalidVisibleDmsGms() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteInvalidVisibleDmsGms")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteOrphanedRows provides a mock function with given fields: limit
|
||||
func (_m *PreferenceStore) DeleteOrphanedRows(limit int) (int64, error) {
|
||||
ret := _m.Called(limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanedRows")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int) error); ok {
|
||||
r1 = rf(limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userID, category, name
|
||||
func (_m *PreferenceStore) Get(userID string, category string, name string) (*model.Preference, error) {
|
||||
ret := _m.Called(userID, category, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Preference)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(userID, category, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: userID
|
||||
func (_m *PreferenceStore) GetAll(userID string) (model.Preferences, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Preferences)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetCategory provides a mock function with given fields: userID, category
|
||||
func (_m *PreferenceStore) GetCategory(userID string, category string) (model.Preferences, error) {
|
||||
ret := _m.Called(userID, category)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetCategory")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Preferences)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, category)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetCategoryAndName provides a mock function with given fields: category, name
|
||||
func (_m *PreferenceStore) GetCategoryAndName(category string, name string) (model.Preferences, error) {
|
||||
ret := _m.Called(category, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetCategoryAndName")
|
||||
}
|
||||
|
||||
var r0 model.Preferences
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (model.Preferences, error)); ok {
|
||||
return rf(category, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) model.Preferences); ok {
|
||||
r0 = rf(category, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Preferences)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(category, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userID
|
||||
func (_m *PreferenceStore) PermanentDeleteByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: preferences
|
||||
func (_m *PreferenceStore) Save(preferences model.Preferences) error {
|
||||
ret := _m.Called(preferences)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(model.Preferences) error); ok {
|
||||
r0 = rf(preferences)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPreferenceStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PreferenceStore {
|
||||
mock := &PreferenceStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
113
server/channels/store/storetest/mocks/ProductNoticesStore.go
Normal file
113
server/channels/store/storetest/mocks/ProductNoticesStore.go
Normal file
@@ -0,0 +1,113 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ProductNoticesStore is an autogenerated mock type for the ProductNoticesStore type
|
||||
type ProductNoticesStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Clear provides a mock function with given fields: notices
|
||||
func (_m *ProductNoticesStore) Clear(notices []string) error {
|
||||
ret := _m.Called(notices)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Clear")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(notices)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ClearOldNotices provides a mock function with given fields: currentNotices
|
||||
func (_m *ProductNoticesStore) ClearOldNotices(currentNotices model.ProductNotices) error {
|
||||
ret := _m.Called(currentNotices)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ClearOldNotices")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(model.ProductNotices) error); ok {
|
||||
r0 = rf(currentNotices)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetViews provides a mock function with given fields: userID
|
||||
func (_m *ProductNoticesStore) GetViews(userID string) ([]model.ProductNoticeViewState, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetViews")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]model.ProductNoticeViewState)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// View provides a mock function with given fields: userID, notices
|
||||
func (_m *ProductNoticesStore) View(userID string, notices []string) error {
|
||||
ret := _m.Called(userID, notices)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for View")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(userID, notices)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewProductNoticesStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ProductNoticesStore {
|
||||
mock := &ProductNoticesStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
428
server/channels/store/storetest/mocks/PropertyFieldStore.go
Normal file
428
server/channels/store/storetest/mocks/PropertyFieldStore.go
Normal file
@@ -0,0 +1,428 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PropertyFieldStore is an autogenerated mock type for the PropertyFieldStore type
|
||||
type PropertyFieldStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CheckPropertyNameConflict provides a mock function with given fields: field, excludeID
|
||||
func (_m *PropertyFieldStore) CheckPropertyNameConflict(field *model.PropertyField, excludeID string) (model.PropertyFieldTargetLevel, error) {
|
||||
ret := _m.Called(field, excludeID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CheckPropertyNameConflict")
|
||||
}
|
||||
|
||||
var r0 model.PropertyFieldTargetLevel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyField, string) (model.PropertyFieldTargetLevel, error)); ok {
|
||||
return rf(field, excludeID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyField, string) model.PropertyFieldTargetLevel); ok {
|
||||
r0 = rf(field, excludeID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(model.PropertyFieldTargetLevel)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PropertyField, string) error); ok {
|
||||
r1 = rf(field, excludeID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CountForGroup provides a mock function with given fields: groupID, includeDeleted
|
||||
func (_m *PropertyFieldStore) CountForGroup(groupID string, includeDeleted bool) (int64, error) {
|
||||
ret := _m.Called(groupID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForGroup")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok {
|
||||
return rf(groupID, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, bool) int64); ok {
|
||||
r0 = rf(groupID, includeDeleted)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(groupID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CountForGroupObjectType provides a mock function with given fields: groupID, objectType, includeDeleted
|
||||
func (_m *PropertyFieldStore) CountForGroupObjectType(groupID string, objectType string, includeDeleted bool) (int64, error) {
|
||||
ret := _m.Called(groupID, objectType, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForGroupObjectType")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) (int64, error)); ok {
|
||||
return rf(groupID, objectType, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) int64); ok {
|
||||
r0 = rf(groupID, objectType, includeDeleted)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(groupID, objectType, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CountForTarget provides a mock function with given fields: groupID, targetType, targetID, includeDeleted
|
||||
func (_m *PropertyFieldStore) CountForTarget(groupID string, targetType string, targetID string, includeDeleted bool) (int64, error) {
|
||||
ret := _m.Called(groupID, targetType, targetID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForTarget")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string, bool) (int64, error)); ok {
|
||||
return rf(groupID, targetType, targetID, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, string, bool) int64); ok {
|
||||
r0 = rf(groupID, targetType, targetID, includeDeleted)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
|
||||
r1 = rf(groupID, targetType, targetID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CountLinkedFields provides a mock function with given fields: fieldID
|
||||
func (_m *PropertyFieldStore) CountLinkedFields(fieldID string) (int64, error) {
|
||||
ret := _m.Called(fieldID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountLinkedFields")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (int64, error)); ok {
|
||||
return rf(fieldID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) int64); ok {
|
||||
r0 = rf(fieldID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(fieldID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Create provides a mock function with given fields: field
|
||||
func (_m *PropertyFieldStore) Create(field *model.PropertyField) (*model.PropertyField, error) {
|
||||
ret := _m.Called(field)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Create")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyField) (*model.PropertyField, error)); ok {
|
||||
return rf(field)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyField) *model.PropertyField); ok {
|
||||
r0 = rf(field)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PropertyField) error); ok {
|
||||
r1 = rf(field)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: groupID, id
|
||||
func (_m *PropertyFieldStore) Delete(groupID string, id string) error {
|
||||
ret := _m.Called(groupID, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(groupID, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, groupID, id
|
||||
func (_m *PropertyFieldStore) Get(rctx request.CTX, groupID string, id string) (*model.PropertyField, error) {
|
||||
ret := _m.Called(rctx, groupID, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.PropertyField, error)); ok {
|
||||
return rf(rctx, groupID, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.PropertyField); ok {
|
||||
r0 = rf(rctx, groupID, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, groupID, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetFieldByName provides a mock function with given fields: rctx, groupID, targetID, name
|
||||
func (_m *PropertyFieldStore) GetFieldByName(rctx request.CTX, groupID string, targetID string, name string) (*model.PropertyField, error) {
|
||||
ret := _m.Called(rctx, groupID, targetID, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFieldByName")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) (*model.PropertyField, error)); ok {
|
||||
return rf(rctx, groupID, targetID, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) *model.PropertyField); ok {
|
||||
r0 = rf(rctx, groupID, targetID, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string, string) error); ok {
|
||||
r1 = rf(rctx, groupID, targetID, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetFieldByNameForObjectType provides a mock function with given fields: rctx, groupID, targetID, objectType, name
|
||||
func (_m *PropertyFieldStore) GetFieldByNameForObjectType(rctx request.CTX, groupID string, targetID string, objectType string, name string) (*model.PropertyField, error) {
|
||||
ret := _m.Called(rctx, groupID, targetID, objectType, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFieldByNameForObjectType")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string, string) (*model.PropertyField, error)); ok {
|
||||
return rf(rctx, groupID, targetID, objectType, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string, string) *model.PropertyField); ok {
|
||||
r0 = rf(rctx, groupID, targetID, objectType, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string, string, string) error); ok {
|
||||
r1 = rf(rctx, groupID, targetID, objectType, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForGroup provides a mock function with given fields: rctx, groupID
|
||||
func (_m *PropertyFieldStore) GetForGroup(rctx request.CTX, groupID string) ([]*model.PropertyField, error) {
|
||||
ret := _m.Called(rctx, groupID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForGroup")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.PropertyField, error)); ok {
|
||||
return rf(rctx, groupID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.PropertyField); ok {
|
||||
r0 = rf(rctx, groupID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, groupID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMany provides a mock function with given fields: rctx, groupID, ids
|
||||
func (_m *PropertyFieldStore) GetMany(rctx request.CTX, groupID string, ids []string) ([]*model.PropertyField, error) {
|
||||
ret := _m.Called(rctx, groupID, ids)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMany")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) ([]*model.PropertyField, error)); ok {
|
||||
return rf(rctx, groupID, ids)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, []string) []*model.PropertyField); ok {
|
||||
r0 = rf(rctx, groupID, ids)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, []string) error); ok {
|
||||
r1 = rf(rctx, groupID, ids)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchPropertyFields provides a mock function with given fields: opts
|
||||
func (_m *PropertyFieldStore) SearchPropertyFields(opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error) {
|
||||
ret := _m.Called(opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SearchPropertyFields")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(model.PropertyFieldSearchOpts) ([]*model.PropertyField, error)); ok {
|
||||
return rf(opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.PropertyFieldSearchOpts) []*model.PropertyField); ok {
|
||||
r0 = rf(opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.PropertyFieldSearchOpts) error); ok {
|
||||
r1 = rf(opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: groupID, fields, expectedUpdateAts
|
||||
func (_m *PropertyFieldStore) Update(groupID string, fields []*model.PropertyField, expectedUpdateAts map[string]int64) ([]*model.PropertyField, error) {
|
||||
ret := _m.Called(groupID, fields, expectedUpdateAts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyField
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []*model.PropertyField, map[string]int64) ([]*model.PropertyField, error)); ok {
|
||||
return rf(groupID, fields, expectedUpdateAts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []*model.PropertyField, map[string]int64) []*model.PropertyField); ok {
|
||||
r0 = rf(groupID, fields, expectedUpdateAts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyField)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []*model.PropertyField, map[string]int64) error); ok {
|
||||
r1 = rf(groupID, fields, expectedUpdateAts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewPropertyFieldStore creates a new instance of PropertyFieldStore. 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 NewPropertyFieldStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PropertyFieldStore {
|
||||
mock := &PropertyFieldStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
137
server/channels/store/storetest/mocks/PropertyGroupStore.go
Normal file
137
server/channels/store/storetest/mocks/PropertyGroupStore.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PropertyGroupStore is an autogenerated mock type for the PropertyGroupStore type
|
||||
type PropertyGroupStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: name
|
||||
func (_m *PropertyGroupStore) Get(name string) (*model.PropertyGroup, error) {
|
||||
ret := _m.Called(name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyGroup
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
||||
return rf(name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
||||
r0 = rf(name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyGroup)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByID provides a mock function with given fields: id
|
||||
func (_m *PropertyGroupStore) GetByID(id string) (*model.PropertyGroup, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByID")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyGroup
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyGroup)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// IncrementVersion provides a mock function with given fields: name
|
||||
func (_m *PropertyGroupStore) IncrementVersion(name string) error {
|
||||
ret := _m.Called(name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IncrementVersion")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Register provides a mock function with given fields: group
|
||||
func (_m *PropertyGroupStore) Register(group *model.PropertyGroup) (*model.PropertyGroup, error) {
|
||||
ret := _m.Called(group)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Register")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyGroup
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyGroup) (*model.PropertyGroup, error)); ok {
|
||||
return rf(group)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyGroup) *model.PropertyGroup); ok {
|
||||
r0 = rf(group)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyGroup)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PropertyGroup) error); ok {
|
||||
r1 = rf(group)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewPropertyGroupStore creates a new instance of PropertyGroupStore. 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 NewPropertyGroupStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PropertyGroupStore {
|
||||
mock := &PropertyGroupStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
293
server/channels/store/storetest/mocks/PropertyValueStore.go
Normal file
293
server/channels/store/storetest/mocks/PropertyValueStore.go
Normal file
@@ -0,0 +1,293 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// PropertyValueStore is an autogenerated mock type for the PropertyValueStore type
|
||||
type PropertyValueStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Create provides a mock function with given fields: value
|
||||
func (_m *PropertyValueStore) Create(value *model.PropertyValue) (*model.PropertyValue, error) {
|
||||
ret := _m.Called(value)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Create")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyValue) (*model.PropertyValue, error)); ok {
|
||||
return rf(value)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.PropertyValue) *model.PropertyValue); ok {
|
||||
r0 = rf(value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.PropertyValue) error); ok {
|
||||
r1 = rf(value)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CreateMany provides a mock function with given fields: values
|
||||
func (_m *PropertyValueStore) CreateMany(values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
||||
ret := _m.Called(values)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateMany")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) ([]*model.PropertyValue, error)); ok {
|
||||
return rf(values)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) []*model.PropertyValue); ok {
|
||||
r0 = rf(values)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]*model.PropertyValue) error); ok {
|
||||
r1 = rf(values)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: groupID, id
|
||||
func (_m *PropertyValueStore) Delete(groupID string, id string) error {
|
||||
ret := _m.Called(groupID, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(groupID, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteForField provides a mock function with given fields: groupID, fieldID
|
||||
func (_m *PropertyValueStore) DeleteForField(groupID string, fieldID string) error {
|
||||
ret := _m.Called(groupID, fieldID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteForField")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(groupID, fieldID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteForTarget provides a mock function with given fields: groupID, targetType, targetID
|
||||
func (_m *PropertyValueStore) DeleteForTarget(groupID string, targetType string, targetID string) error {
|
||||
ret := _m.Called(groupID, targetType, targetID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteForTarget")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = rf(groupID, targetType, targetID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: groupID, id
|
||||
func (_m *PropertyValueStore) Get(groupID string, id string) (*model.PropertyValue, error) {
|
||||
ret := _m.Called(groupID, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.PropertyValue, error)); ok {
|
||||
return rf(groupID, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.PropertyValue); ok {
|
||||
r0 = rf(groupID, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(groupID, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMany provides a mock function with given fields: groupID, ids
|
||||
func (_m *PropertyValueStore) GetMany(groupID string, ids []string) ([]*model.PropertyValue, error) {
|
||||
ret := _m.Called(groupID, ids)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMany")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) ([]*model.PropertyValue, error)); ok {
|
||||
return rf(groupID, ids)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string) []*model.PropertyValue); ok {
|
||||
r0 = rf(groupID, ids)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(groupID, ids)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchPropertyValues provides a mock function with given fields: opts
|
||||
func (_m *PropertyValueStore) SearchPropertyValues(opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error) {
|
||||
ret := _m.Called(opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SearchPropertyValues")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(model.PropertyValueSearchOpts) ([]*model.PropertyValue, error)); ok {
|
||||
return rf(opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.PropertyValueSearchOpts) []*model.PropertyValue); ok {
|
||||
r0 = rf(opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.PropertyValueSearchOpts) error); ok {
|
||||
r1 = rf(opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: groupID, values
|
||||
func (_m *PropertyValueStore) Update(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
||||
ret := _m.Called(groupID, values)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []*model.PropertyValue) ([]*model.PropertyValue, error)); ok {
|
||||
return rf(groupID, values)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []*model.PropertyValue) []*model.PropertyValue); ok {
|
||||
r0 = rf(groupID, values)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []*model.PropertyValue) error); ok {
|
||||
r1 = rf(groupID, values)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Upsert provides a mock function with given fields: values
|
||||
func (_m *PropertyValueStore) Upsert(values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
||||
ret := _m.Called(values)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Upsert")
|
||||
}
|
||||
|
||||
var r0 []*model.PropertyValue
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) ([]*model.PropertyValue, error)); ok {
|
||||
return rf(values)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) []*model.PropertyValue); ok {
|
||||
r0 = rf(values)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.PropertyValue)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]*model.PropertyValue) error); ok {
|
||||
r1 = rf(values)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewPropertyValueStore creates a new instance of PropertyValueStore. 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 NewPropertyValueStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *PropertyValueStore {
|
||||
mock := &PropertyValueStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
328
server/channels/store/storetest/mocks/ReactionStore.go
Normal file
328
server/channels/store/storetest/mocks/ReactionStore.go
Normal file
@@ -0,0 +1,328 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ReactionStore is an autogenerated mock type for the ReactionStore type
|
||||
type ReactionStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: reaction
|
||||
func (_m *ReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, error) {
|
||||
ret := _m.Called(reaction)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Reaction)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok {
|
||||
r1 = rf(reaction)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteAllWithEmojiName provides a mock function with given fields: rctx, emojiName
|
||||
func (_m *ReactionStore) DeleteAllWithEmojiName(rctx request.CTX, emojiName string) error {
|
||||
ret := _m.Called(rctx, emojiName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteAllWithEmojiName")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, emojiName)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOrphanedRowsByIds provides a mock function with given fields: r
|
||||
func (_m *ReactionStore) DeleteOrphanedRowsByIds(r *model.RetentionIdsForDeletion) (int64, error) {
|
||||
ret := _m.Called(r)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanedRowsByIds")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.RetentionIdsForDeletion) (int64, error)); ok {
|
||||
return rf(r)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.RetentionIdsForDeletion) int64); ok {
|
||||
r0 = rf(r)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.RetentionIdsForDeletion) error); ok {
|
||||
r1 = rf(r)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ExistsOnPost provides a mock function with given fields: postID, emojiName
|
||||
func (_m *ReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
|
||||
ret := _m.Called(postID, emojiName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ExistsOnPost")
|
||||
}
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok {
|
||||
return rf(postID, emojiName)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) bool); ok {
|
||||
r0 = rf(postID, emojiName)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(postID, emojiName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPost provides a mock function with given fields: postID, allowFromCache
|
||||
func (_m *ReactionStore) GetForPost(postID string, allowFromCache bool) ([]*model.Reaction, error) {
|
||||
ret := _m.Called(postID, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPost")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Reaction)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(postID, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPostSince provides a mock function with given fields: postID, since, excludeRemoteID, inclDeleted
|
||||
func (_m *ReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
ret := _m.Called(postID, since, excludeRemoteID, inclDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPostSince")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Reaction)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64, string, bool) error); ok {
|
||||
r1 = rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSingle provides a mock function with given fields: userID, postID, remoteID, emojiName
|
||||
func (_m *ReactionStore) GetSingle(userID string, postID string, remoteID string, emojiName string) (*model.Reaction, error) {
|
||||
ret := _m.Called(userID, postID, remoteID, emojiName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSingle")
|
||||
}
|
||||
|
||||
var r0 *model.Reaction
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string, string) (*model.Reaction, error)); ok {
|
||||
return rf(userID, postID, remoteID, emojiName)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, string, string) *model.Reaction); ok {
|
||||
r0 = rf(userID, postID, remoteID, emojiName)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Reaction)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, string) error); ok {
|
||||
r1 = rf(userID, postID, remoteID, emojiName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUniqueCountForPost provides a mock function with given fields: postID
|
||||
func (_m *ReactionStore) GetUniqueCountForPost(postID string) (int, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUniqueCountForPost")
|
||||
}
|
||||
|
||||
var r0 int
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (int, error)); ok {
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) int); ok {
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteBatch provides a mock function with given fields: endTime, limit
|
||||
func (_m *ReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, error) {
|
||||
ret := _m.Called(endTime, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatch")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
|
||||
r1 = rf(endTime, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: rctx, userID
|
||||
func (_m *ReactionStore) PermanentDeleteByUser(rctx request.CTX, userID string) error {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: reaction
|
||||
func (_m *ReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error) {
|
||||
ret := _m.Called(reaction)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Reaction)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok {
|
||||
r1 = rf(reaction)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewReactionStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ReactionStore {
|
||||
mock := &ReactionStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
247
server/channels/store/storetest/mocks/ReadReceiptStore.go
Normal file
247
server/channels/store/storetest/mocks/ReadReceiptStore.go
Normal file
@@ -0,0 +1,247 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ReadReceiptStore is an autogenerated mock type for the ReadReceiptStore type
|
||||
type ReadReceiptStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: rctx, postID, userID
|
||||
func (_m *ReadReceiptStore) Delete(rctx request.CTX, postID string, userID string) error {
|
||||
ret := _m.Called(rctx, postID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) error); ok {
|
||||
r0 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByPost provides a mock function with given fields: rctx, postID
|
||||
func (_m *ReadReceiptStore) DeleteByPost(rctx request.CTX, postID string) error {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, postID, userID
|
||||
func (_m *ReadReceiptStore) Get(rctx request.CTX, postID string, userID string) (*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, postID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, postID, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByPost provides a mock function with given fields: rctx, postID
|
||||
func (_m *ReadReceiptStore) GetByPost(rctx request.CTX, postID string) ([]*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByPost")
|
||||
}
|
||||
|
||||
var r0 []*model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetReadCountForPost provides a mock function with given fields: rctx, postID
|
||||
func (_m *ReadReceiptStore) GetReadCountForPost(rctx request.CTX, postID string) (int64, error) {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetReadCountForPost")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (int64, error)); ok {
|
||||
return rf(rctx, postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) int64); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUnreadCountForPost provides a mock function with given fields: rctx, post
|
||||
func (_m *ReadReceiptStore) GetUnreadCountForPost(rctx request.CTX, post *model.Post) (int64, error) {
|
||||
ret := _m.Called(rctx, post)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUnreadCountForPost")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post) (int64, error)); ok {
|
||||
return rf(rctx, post)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post) int64); ok {
|
||||
r0 = rf(rctx, post)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post) error); ok {
|
||||
r1 = rf(rctx, post)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateReadReceiptForPostsCache provides a mock function with given fields: postID
|
||||
func (_m *ReadReceiptStore) InvalidateReadReceiptForPostsCache(postID string) {
|
||||
_m.Called(postID)
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, receipt
|
||||
func (_m *ReadReceiptStore) Save(rctx request.CTX, receipt *model.ReadReceipt) (*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, receipt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) (*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, receipt)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) *model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, receipt)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.ReadReceipt) error); ok {
|
||||
r1 = rf(rctx, receipt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: rctx, receipt
|
||||
func (_m *ReadReceiptStore) Update(rctx request.CTX, receipt *model.ReadReceipt) (*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, receipt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 *model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) (*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, receipt)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) *model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, receipt)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.ReadReceipt) error); ok {
|
||||
r1 = rf(rctx, receipt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewReadReceiptStore creates a new instance of ReadReceiptStore. 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 NewReadReceiptStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ReadReceiptStore {
|
||||
mock := &ReadReceiptStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
108
server/channels/store/storetest/mocks/ReadReceiptsStore.go
Normal file
108
server/channels/store/storetest/mocks/ReadReceiptsStore.go
Normal file
@@ -0,0 +1,108 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ReadReceiptsStore is an autogenerated mock type for the ReadReceiptsStore type
|
||||
type ReadReceiptsStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: rctx, postID, userID
|
||||
func (_m *ReadReceiptsStore) Delete(rctx request.CTX, postID string, userID string) error {
|
||||
ret := _m.Called(rctx, postID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) error); ok {
|
||||
r0 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, postID, userID
|
||||
func (_m *ReadReceiptsStore) Get(rctx request.CTX, postID string, userID string) (*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, postID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, postID, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, postID, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, receipt
|
||||
func (_m *ReadReceiptsStore) Save(rctx request.CTX, receipt *model.ReadReceipt) (*model.ReadReceipt, error) {
|
||||
ret := _m.Called(rctx, receipt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.ReadReceipt
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) (*model.ReadReceipt, error)); ok {
|
||||
return rf(rctx, receipt)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ReadReceipt) *model.ReadReceipt); ok {
|
||||
r0 = rf(rctx, receipt)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ReadReceipt)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.ReadReceipt) error); ok {
|
||||
r1 = rf(rctx, receipt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewReadReceiptsStore creates a new instance of ReadReceiptsStore. 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 NewReadReceiptsStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ReadReceiptsStore {
|
||||
mock := &ReadReceiptsStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
433
server/channels/store/storetest/mocks/RecapStore.go
Normal file
433
server/channels/store/storetest/mocks/RecapStore.go
Normal file
@@ -0,0 +1,433 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// RecapStore is an autogenerated mock type for the RecapStore type
|
||||
type RecapStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountForUserSince provides a mock function with given fields: userId, since
|
||||
func (_m *RecapStore) CountForUserSince(userId string, since int64) (int64, error) {
|
||||
ret := _m.Called(userId, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForUserSince")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) (int64, error)); ok {
|
||||
return rf(userId, since)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64) int64); ok {
|
||||
r0 = rf(userId, since)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(userId, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteRecap provides a mock function with given fields: id
|
||||
func (_m *RecapStore) DeleteRecap(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteRecap")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteRecapChannels provides a mock function with given fields: recapId
|
||||
func (_m *RecapStore) DeleteRecapChannels(recapId string) error {
|
||||
ret := _m.Called(recapId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteRecapChannels")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(recapId)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetLastCompletedManualRecap provides a mock function with given fields: userId
|
||||
func (_m *RecapStore) GetLastCompletedManualRecap(userId string) (*model.Recap, error) {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLastCompletedManualRecap")
|
||||
}
|
||||
|
||||
var r0 *model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.Recap, error)); ok {
|
||||
return rf(userId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.Recap); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRecap provides a mock function with given fields: id
|
||||
func (_m *RecapStore) GetRecap(id string) (*model.Recap, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRecap")
|
||||
}
|
||||
|
||||
var r0 *model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.Recap, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.Recap); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRecapChannelsByRecapId provides a mock function with given fields: recapId
|
||||
func (_m *RecapStore) GetRecapChannelsByRecapId(recapId string) ([]*model.RecapChannel, error) {
|
||||
ret := _m.Called(recapId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRecapChannelsByRecapId")
|
||||
}
|
||||
|
||||
var r0 []*model.RecapChannel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*model.RecapChannel, error)); ok {
|
||||
return rf(recapId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*model.RecapChannel); ok {
|
||||
r0 = rf(recapId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RecapChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(recapId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRecapsForUser provides a mock function with given fields: userId, page, perPage
|
||||
func (_m *RecapStore) GetRecapsForUser(userId string, page int, perPage int) ([]*model.Recap, error) {
|
||||
ret := _m.Called(userId, page, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRecapsForUser")
|
||||
}
|
||||
|
||||
var r0 []*model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Recap, error)); ok {
|
||||
return rf(userId, page, perPage)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) []*model.Recap); ok {
|
||||
r0 = rf(userId, page, perPage)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userId, page, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MarkRecapAsRead provides a mock function with given fields: id
|
||||
func (_m *RecapStore) MarkRecapAsRead(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkRecapAsRead")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MarkRecapSkipped provides a mock function with given fields: id, reason
|
||||
func (_m *RecapStore) MarkRecapSkipped(id string, reason string) error {
|
||||
ret := _m.Called(id, reason)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkRecapSkipped")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(id, reason)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MarkRecapsAsViewed provides a mock function with given fields: userId, statuses
|
||||
func (_m *RecapStore) MarkRecapsAsViewed(userId string, statuses []string) ([]string, error) {
|
||||
ret := _m.Called(userId, statuses)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkRecapsAsViewed")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) ([]string, error)); ok {
|
||||
return rf(userId, statuses)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string) []string); ok {
|
||||
r0 = rf(userId, statuses)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(userId, statuses)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveRecap provides a mock function with given fields: recap
|
||||
func (_m *RecapStore) SaveRecap(recap *model.Recap) (*model.Recap, error) {
|
||||
ret := _m.Called(recap)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveRecap")
|
||||
}
|
||||
|
||||
var r0 *model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap) (*model.Recap, error)); ok {
|
||||
return rf(recap)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap) *model.Recap); ok {
|
||||
r0 = rf(recap)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Recap) error); ok {
|
||||
r1 = rf(recap)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveRecapChannel provides a mock function with given fields: recapChannel
|
||||
func (_m *RecapStore) SaveRecapChannel(recapChannel *model.RecapChannel) error {
|
||||
ret := _m.Called(recapChannel)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveRecapChannel")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.RecapChannel) error); ok {
|
||||
r0 = rf(recapChannel)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveRecapIfUnderDailyLimit provides a mock function with given fields: recap, since, limit
|
||||
func (_m *RecapStore) SaveRecapIfUnderDailyLimit(recap *model.Recap, since int64, limit int) (*model.Recap, error) {
|
||||
ret := _m.Called(recap, since, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveRecapIfUnderDailyLimit")
|
||||
}
|
||||
|
||||
var r0 *model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap, int64, int) (*model.Recap, error)); ok {
|
||||
return rf(recap, since, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap, int64, int) *model.Recap); ok {
|
||||
r0 = rf(recap, since, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Recap, int64, int) error); ok {
|
||||
r1 = rf(recap, since, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SumTotalMessageCountForUserSince provides a mock function with given fields: userId, since
|
||||
func (_m *RecapStore) SumTotalMessageCountForUserSince(userId string, since int64) (int64, error) {
|
||||
ret := _m.Called(userId, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SumTotalMessageCountForUserSince")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) (int64, error)); ok {
|
||||
return rf(userId, since)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64) int64); ok {
|
||||
r0 = rf(userId, since)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(userId, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateRecap provides a mock function with given fields: recap
|
||||
func (_m *RecapStore) UpdateRecap(recap *model.Recap) (*model.Recap, error) {
|
||||
ret := _m.Called(recap)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRecap")
|
||||
}
|
||||
|
||||
var r0 *model.Recap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap) (*model.Recap, error)); ok {
|
||||
return rf(recap)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.Recap) *model.Recap); ok {
|
||||
r0 = rf(recap)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Recap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Recap) error); ok {
|
||||
r1 = rf(recap)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateRecapStatus provides a mock function with given fields: id, status
|
||||
func (_m *RecapStore) UpdateRecapStatus(id string, status string) error {
|
||||
ret := _m.Called(id, status)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRecapStatus")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(id, status)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewRecapStore creates a new instance of RecapStore. 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 NewRecapStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RecapStore {
|
||||
mock := &RecapStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
333
server/channels/store/storetest/mocks/RemoteClusterStore.go
Normal file
333
server/channels/store/storetest/mocks/RemoteClusterStore.go
Normal file
@@ -0,0 +1,333 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// RemoteClusterStore is an autogenerated mock type for the RemoteClusterStore type
|
||||
type RemoteClusterStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: remoteClusterID
|
||||
func (_m *RemoteClusterStore) Delete(remoteClusterID string) (bool, error) {
|
||||
ret := _m.Called(remoteClusterID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(remoteClusterID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: remoteClusterID, includeDeleted
|
||||
func (_m *RemoteClusterStore) Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) (*model.RemoteCluster, error)); ok {
|
||||
return rf(remoteClusterID, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, bool) *model.RemoteCluster); ok {
|
||||
r0 = rf(remoteClusterID, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(remoteClusterID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit, filter
|
||||
func (_m *RemoteClusterStore) GetAll(offset int, limit int, filter model.RemoteClusterQueryFilter) ([]*model.RemoteCluster, error) {
|
||||
ret := _m.Called(offset, limit, filter)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
var r0 []*model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int, int, model.RemoteClusterQueryFilter) ([]*model.RemoteCluster, error)); ok {
|
||||
return rf(offset, limit, filter)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int, int, model.RemoteClusterQueryFilter) []*model.RemoteCluster); ok {
|
||||
r0 = rf(offset, limit, filter)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int, model.RemoteClusterQueryFilter) error); ok {
|
||||
r1 = rf(offset, limit, filter)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByPluginID provides a mock function with given fields: pluginID
|
||||
func (_m *RemoteClusterStore) GetAllByPluginID(pluginID string) ([]*model.RemoteCluster, error) {
|
||||
ret := _m.Called(pluginID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByPluginID")
|
||||
}
|
||||
|
||||
var r0 []*model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*model.RemoteCluster, error)); ok {
|
||||
return rf(pluginID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*model.RemoteCluster); ok {
|
||||
r0 = rf(pluginID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(pluginID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByPluginID provides a mock function with given fields: pluginID
|
||||
func (_m *RemoteClusterStore) GetByPluginID(pluginID string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(pluginID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByPluginID")
|
||||
}
|
||||
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.RemoteCluster, error)); ok {
|
||||
return rf(pluginID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.RemoteCluster); ok {
|
||||
r0 = rf(pluginID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(pluginID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetBySiteURL provides a mock function with given fields: siteURL
|
||||
func (_m *RemoteClusterStore) GetBySiteURL(siteURL string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(siteURL)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetBySiteURL")
|
||||
}
|
||||
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.RemoteCluster, error)); ok {
|
||||
return rf(siteURL)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.RemoteCluster); ok {
|
||||
r0 = rf(siteURL)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(siteURL)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rc
|
||||
func (_m *RemoteClusterStore) Save(rc *model.RemoteCluster) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(rc)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.RemoteCluster) error); ok {
|
||||
r1 = rf(rc)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetLastPingAt provides a mock function with given fields: remoteClusterID
|
||||
func (_m *RemoteClusterStore) SetLastPingAt(remoteClusterID string) error {
|
||||
ret := _m.Called(remoteClusterID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetLastPingAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(remoteClusterID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: rc
|
||||
func (_m *RemoteClusterStore) Update(rc *model.RemoteCluster) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(rc)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.RemoteCluster) error); ok {
|
||||
r1 = rf(rc)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateLastGlobalUserSyncAt provides a mock function with given fields: remoteID, syncAt
|
||||
func (_m *RemoteClusterStore) UpdateLastGlobalUserSyncAt(remoteID string, syncAt int64) error {
|
||||
ret := _m.Called(remoteID, syncAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateLastGlobalUserSyncAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(remoteID, syncAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateTopics provides a mock function with given fields: remoteClusterID, topics
|
||||
func (_m *RemoteClusterStore) UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterID, topics)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTopics")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(remoteClusterID, topics)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRemoteClusterStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RemoteClusterStore {
|
||||
mock := &RemoteClusterStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
557
server/channels/store/storetest/mocks/RetentionPolicyStore.go
Normal file
557
server/channels/store/storetest/mocks/RetentionPolicyStore.go
Normal file
@@ -0,0 +1,557 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// RetentionPolicyStore is an autogenerated mock type for the RetentionPolicyStore type
|
||||
type RetentionPolicyStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AddChannels provides a mock function with given fields: policyID, channelIds
|
||||
func (_m *RetentionPolicyStore) AddChannels(policyID string, channelIds []string) error {
|
||||
ret := _m.Called(policyID, channelIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddChannels")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyID, channelIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// AddTeams provides a mock function with given fields: policyID, teamIds
|
||||
func (_m *RetentionPolicyStore) AddTeams(policyID string, teamIds []string) error {
|
||||
ret := _m.Called(policyID, teamIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddTeams")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyID, teamIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *RetentionPolicyStore) Delete(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOrphanedRows provides a mock function with given fields: limit
|
||||
func (_m *RetentionPolicyStore) DeleteOrphanedRows(limit int) (int64, error) {
|
||||
ret := _m.Called(limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanedRows")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int) error); ok {
|
||||
r1 = rf(limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *RetentionPolicyStore) Get(id string) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit
|
||||
func (_m *RetentionPolicyStore) GetAll(offset int, limit int) ([]*model.RetentionPolicyWithTeamAndChannelCounts, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RetentionPolicyWithTeamAndChannelCounts)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelPoliciesCountForUser provides a mock function with given fields: userID
|
||||
func (_m *RetentionPolicyStore) GetChannelPoliciesCountForUser(userID string) (int64, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelPoliciesCountForUser")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelPoliciesForUser provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset int, limit int) ([]*model.RetentionPolicyForChannel, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelPoliciesForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RetentionPolicyForChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannels provides a mock function with given fields: policyID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetChannels(policyID string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
ret := _m.Called(policyID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannels")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.ChannelListWithTeamData)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelsCount provides a mock function with given fields: policyID
|
||||
func (_m *RetentionPolicyStore) GetChannelsCount(policyID string) (int64, error) {
|
||||
ret := _m.Called(policyID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelsCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(policyID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetCount provides a mock function with no fields
|
||||
func (_m *RetentionPolicyStore) GetCount() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIdsForDeletionByTableName provides a mock function with given fields: tableName, limit
|
||||
func (_m *RetentionPolicyStore) GetIdsForDeletionByTableName(tableName string, limit int) ([]*model.RetentionIdsForDeletion, error) {
|
||||
ret := _m.Called(tableName, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIdsForDeletionByTableName")
|
||||
}
|
||||
|
||||
var r0 []*model.RetentionIdsForDeletion
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int) ([]*model.RetentionIdsForDeletion, error)); ok {
|
||||
return rf(tableName, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int) []*model.RetentionIdsForDeletion); ok {
|
||||
r0 = rf(tableName, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RetentionIdsForDeletion)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int) error); ok {
|
||||
r1 = rf(tableName, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamPoliciesCountForUser provides a mock function with given fields: userID
|
||||
func (_m *RetentionPolicyStore) GetTeamPoliciesCountForUser(userID string) (int64, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamPoliciesCountForUser")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamPoliciesForUser provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset int, limit int) ([]*model.RetentionPolicyForTeam, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamPoliciesForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.RetentionPolicyForTeam)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeams provides a mock function with given fields: policyID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetTeams(policyID string, offset int, limit int) ([]*model.Team, error) {
|
||||
ret := _m.Called(policyID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeams")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Team)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamsCount provides a mock function with given fields: policyID
|
||||
func (_m *RetentionPolicyStore) GetTeamsCount(policyID string) (int64, error) {
|
||||
ret := _m.Called(policyID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamsCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(policyID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Patch provides a mock function with given fields: patch
|
||||
func (_m *RetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
|
||||
ret := _m.Called(patch)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for 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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok {
|
||||
r1 = rf(patch)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// RemoveChannels provides a mock function with given fields: policyID, channelIds
|
||||
func (_m *RetentionPolicyStore) RemoveChannels(policyID string, channelIds []string) error {
|
||||
ret := _m.Called(policyID, channelIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveChannels")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyID, channelIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveTeams provides a mock function with given fields: policyID, teamIds
|
||||
func (_m *RetentionPolicyStore) RemoveTeams(policyID string, teamIds []string) error {
|
||||
ret := _m.Called(policyID, teamIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveTeams")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyID, teamIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: policy
|
||||
func (_m *RetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, error) {
|
||||
ret := _m.Called(policy)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RetentionPolicyWithTeamAndChannelCounts)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.RetentionPolicyWithTeamAndChannelIDs) error); ok {
|
||||
r1 = rf(policy)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRetentionPolicyStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RetentionPolicyStore {
|
||||
mock := &RetentionPolicyStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
348
server/channels/store/storetest/mocks/RoleStore.go
Normal file
348
server/channels/store/storetest/mocks/RoleStore.go
Normal file
@@ -0,0 +1,348 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// RoleStore is an autogenerated mock type for the RoleStore type
|
||||
type RoleStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AllChannelSchemeRoles provides a mock function with no fields
|
||||
func (_m *RoleStore) AllChannelSchemeRoles() ([]*model.Role, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AllChannelSchemeRoles")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ChannelHigherScopedPermissions provides a mock function with given fields: roleNames
|
||||
func (_m *RoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, error) {
|
||||
ret := _m.Called(roleNames)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ChannelHigherScopedPermissions")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]*model.RolePermissions)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(roleNames)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ChannelRolesUnderTeamRole provides a mock function with given fields: roleName
|
||||
func (_m *RoleStore) ChannelRolesUnderTeamRole(roleName string) ([]*model.Role, error) {
|
||||
ret := _m.Called(roleName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ChannelRolesUnderTeamRole")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(roleName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: roleID
|
||||
func (_m *RoleStore) Delete(roleID string) (*model.Role, error) {
|
||||
ret := _m.Called(roleID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(roleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: roleID
|
||||
func (_m *RoleStore) Get(roleID string) (*model.Role, error) {
|
||||
ret := _m.Called(roleID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(roleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with no fields
|
||||
func (_m *RoleStore) GetAll() ([]*model.Role, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByName provides a mock function with given fields: rctx, name
|
||||
func (_m *RoleStore) GetByName(rctx request.CTX, name string) (*model.Role, error) {
|
||||
ret := _m.Called(rctx, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByName")
|
||||
}
|
||||
|
||||
var r0 *model.Role
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Role, error)); ok {
|
||||
return rf(rctx, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Role); ok {
|
||||
r0 = rf(rctx, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByNames provides a mock function with given fields: names
|
||||
func (_m *RoleStore) GetByNames(names []string) ([]*model.Role, error) {
|
||||
ret := _m.Called(names)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByNames")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(names)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteAll provides a mock function with no fields
|
||||
func (_m *RoleStore) PermanentDeleteAll() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteAll")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: role
|
||||
func (_m *RoleStore) Save(role *model.Role) (*model.Role, error) {
|
||||
ret := _m.Called(role)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Role) error); ok {
|
||||
r1 = rf(role)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SavePreservingUnknownPermissions provides a mock function with given fields: role
|
||||
func (_m *RoleStore) SavePreservingUnknownPermissions(role *model.Role) (*model.Role, error) {
|
||||
ret := _m.Called(role)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SavePreservingUnknownPermissions")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Role)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Role) error); ok {
|
||||
r1 = rf(role)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRoleStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RoleStore {
|
||||
mock := &RoleStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
258
server/channels/store/storetest/mocks/ScheduledPostStore.go
Normal file
258
server/channels/store/storetest/mocks/ScheduledPostStore.go
Normal file
@@ -0,0 +1,258 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ScheduledPostStore is an autogenerated mock type for the ScheduledPostStore type
|
||||
type ScheduledPostStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CreateScheduledPost provides a mock function with given fields: rctx, scheduledPost
|
||||
func (_m *ScheduledPostStore) CreateScheduledPost(rctx request.CTX, scheduledPost *model.ScheduledPost) (*model.ScheduledPost, error) {
|
||||
ret := _m.Called(rctx, scheduledPost)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateScheduledPost")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ScheduledPost) (*model.ScheduledPost, error)); ok {
|
||||
return rf(rctx, scheduledPost)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ScheduledPost) *model.ScheduledPost); ok {
|
||||
r0 = rf(rctx, scheduledPost)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.ScheduledPost) error); ok {
|
||||
r1 = rf(rctx, scheduledPost)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, scheduledPostId
|
||||
func (_m *ScheduledPostStore) Get(rctx request.CTX, scheduledPostId string) (*model.ScheduledPost, error) {
|
||||
ret := _m.Called(rctx, scheduledPostId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.ScheduledPost, error)); ok {
|
||||
return rf(rctx, scheduledPostId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.ScheduledPost); ok {
|
||||
r0 = rf(rctx, scheduledPostId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, scheduledPostId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMaxMessageSize provides a mock function with no fields
|
||||
func (_m *ScheduledPostStore) GetMaxMessageSize() int {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMaxMessageSize")
|
||||
}
|
||||
|
||||
var r0 int
|
||||
if rf, ok := ret.Get(0).(func() int); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(int)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetPendingScheduledPosts provides a mock function with given fields: rctx, beforeTime, afterTime, lastScheduledPostId, perPage
|
||||
func (_m *ScheduledPostStore) GetPendingScheduledPosts(rctx request.CTX, beforeTime int64, afterTime int64, lastScheduledPostId string, perPage uint64) ([]*model.ScheduledPost, error) {
|
||||
ret := _m.Called(rctx, beforeTime, afterTime, lastScheduledPostId, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPendingScheduledPosts")
|
||||
}
|
||||
|
||||
var r0 []*model.ScheduledPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64, string, uint64) ([]*model.ScheduledPost, error)); ok {
|
||||
return rf(rctx, beforeTime, afterTime, lastScheduledPostId, perPage)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64, string, uint64) []*model.ScheduledPost); ok {
|
||||
r0 = rf(rctx, beforeTime, afterTime, lastScheduledPostId, perPage)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ScheduledPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, int64, int64, string, uint64) error); ok {
|
||||
r1 = rf(rctx, beforeTime, afterTime, lastScheduledPostId, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetScheduledPostsForUser provides a mock function with given fields: rctx, userId, teamId
|
||||
func (_m *ScheduledPostStore) GetScheduledPostsForUser(rctx request.CTX, userId string, teamId string) ([]*model.ScheduledPost, error) {
|
||||
ret := _m.Called(rctx, userId, teamId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetScheduledPostsForUser")
|
||||
}
|
||||
|
||||
var r0 []*model.ScheduledPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) ([]*model.ScheduledPost, error)); ok {
|
||||
return rf(rctx, userId, teamId)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) []*model.ScheduledPost); ok {
|
||||
r0 = rf(rctx, userId, teamId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ScheduledPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(rctx, userId, teamId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userId
|
||||
func (_m *ScheduledPostStore) PermanentDeleteByUser(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentlyDeleteScheduledPosts provides a mock function with given fields: scheduledPostIDs
|
||||
func (_m *ScheduledPostStore) PermanentlyDeleteScheduledPosts(scheduledPostIDs []string) error {
|
||||
ret := _m.Called(scheduledPostIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentlyDeleteScheduledPosts")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
||||
r0 = rf(scheduledPostIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateOldScheduledPosts provides a mock function with given fields: rctx, beforeTime
|
||||
func (_m *ScheduledPostStore) UpdateOldScheduledPosts(rctx request.CTX, beforeTime int64) error {
|
||||
ret := _m.Called(rctx, beforeTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateOldScheduledPosts")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64) error); ok {
|
||||
r0 = rf(rctx, beforeTime)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateRecurringScheduledPosts provides a mock function with given fields: rctx, scheduledPosts
|
||||
func (_m *ScheduledPostStore) UpdateRecurringScheduledPosts(rctx request.CTX, scheduledPosts []*model.ScheduledPost) error {
|
||||
ret := _m.Called(rctx, scheduledPosts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRecurringScheduledPosts")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []*model.ScheduledPost) error); ok {
|
||||
r0 = rf(rctx, scheduledPosts)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdatedScheduledPost provides a mock function with given fields: rctx, scheduledPost
|
||||
func (_m *ScheduledPostStore) UpdatedScheduledPost(rctx request.CTX, scheduledPost *model.ScheduledPost) error {
|
||||
ret := _m.Called(rctx, scheduledPost)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdatedScheduledPost")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ScheduledPost) error); ok {
|
||||
r0 = rf(rctx, scheduledPost)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewScheduledPostStore creates a new instance of ScheduledPostStore. 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 NewScheduledPostStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ScheduledPostStore {
|
||||
mock := &ScheduledPostStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
309
server/channels/store/storetest/mocks/ScheduledRecapStore.go
Normal file
309
server/channels/store/storetest/mocks/ScheduledRecapStore.go
Normal file
@@ -0,0 +1,309 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ScheduledRecapStore is an autogenerated mock type for the ScheduledRecapStore type
|
||||
type ScheduledRecapStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountForUser provides a mock function with given fields: userId
|
||||
func (_m *ScheduledRecapStore) CountForUser(userId string) (int64, error) {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForUser")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userId)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *ScheduledRecapStore) Delete(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ScheduledRecapStore) Get(id string) (*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.ScheduledRecap, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.ScheduledRecap); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetDueBefore provides a mock function with given fields: timestamp, limit
|
||||
func (_m *ScheduledRecapStore) GetDueBefore(timestamp int64, limit int) ([]*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(timestamp, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDueBefore")
|
||||
}
|
||||
|
||||
var r0 []*model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int) ([]*model.ScheduledRecap, error)); ok {
|
||||
return rf(timestamp, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, int) []*model.ScheduledRecap); ok {
|
||||
r0 = rf(timestamp, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int) error); ok {
|
||||
r1 = rf(timestamp, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForUser provides a mock function with given fields: userId, page, perPage
|
||||
func (_m *ScheduledRecapStore) GetForUser(userId string, page int, perPage int) ([]*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(userId, page, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForUser")
|
||||
}
|
||||
|
||||
var r0 []*model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.ScheduledRecap, error)); ok {
|
||||
return rf(userId, page, perPage)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) []*model.ScheduledRecap); ok {
|
||||
r0 = rf(userId, page, perPage)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userId, page, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MarkExecuted provides a mock function with given fields: id, lastRunAt, nextRunAt
|
||||
func (_m *ScheduledRecapStore) MarkExecuted(id string, lastRunAt int64, nextRunAt int64) error {
|
||||
ret := _m.Called(id, lastRunAt, nextRunAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkExecuted")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, int64) error); ok {
|
||||
r0 = rf(id, lastRunAt, nextRunAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: scheduledRecap
|
||||
func (_m *ScheduledRecapStore) Save(scheduledRecap *model.ScheduledRecap) (*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(scheduledRecap)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap) (*model.ScheduledRecap, error)); ok {
|
||||
return rf(scheduledRecap)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap) *model.ScheduledRecap); ok {
|
||||
r0 = rf(scheduledRecap)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ScheduledRecap) error); ok {
|
||||
r1 = rf(scheduledRecap)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveIfUnderLimit provides a mock function with given fields: scheduledRecap, limit
|
||||
func (_m *ScheduledRecapStore) SaveIfUnderLimit(scheduledRecap *model.ScheduledRecap, limit int) (*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(scheduledRecap, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveIfUnderLimit")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap, int) (*model.ScheduledRecap, error)); ok {
|
||||
return rf(scheduledRecap, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap, int) *model.ScheduledRecap); ok {
|
||||
r0 = rf(scheduledRecap, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ScheduledRecap, int) error); ok {
|
||||
r1 = rf(scheduledRecap, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetEnabled provides a mock function with given fields: id, enabled
|
||||
func (_m *ScheduledRecapStore) SetEnabled(id string, enabled bool) error {
|
||||
ret := _m.Called(id, enabled)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetEnabled")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) error); ok {
|
||||
r0 = rf(id, enabled)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: scheduledRecap
|
||||
func (_m *ScheduledRecapStore) Update(scheduledRecap *model.ScheduledRecap) (*model.ScheduledRecap, error) {
|
||||
ret := _m.Called(scheduledRecap)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 *model.ScheduledRecap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap) (*model.ScheduledRecap, error)); ok {
|
||||
return rf(scheduledRecap)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.ScheduledRecap) *model.ScheduledRecap); ok {
|
||||
r0 = rf(scheduledRecap)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ScheduledRecap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ScheduledRecap) error); ok {
|
||||
r1 = rf(scheduledRecap)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateNextRunAt provides a mock function with given fields: id, nextRunAt
|
||||
func (_m *ScheduledRecapStore) UpdateNextRunAt(id string, nextRunAt int64) error {
|
||||
ret := _m.Called(id, nextRunAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateNextRunAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(id, nextRunAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewScheduledRecapStore creates a new instance of ScheduledRecapStore. 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 NewScheduledRecapStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ScheduledRecapStore {
|
||||
mock := &ScheduledRecapStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
253
server/channels/store/storetest/mocks/SchemeStore.go
Normal file
253
server/channels/store/storetest/mocks/SchemeStore.go
Normal file
@@ -0,0 +1,253 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// SchemeStore is an autogenerated mock type for the SchemeStore type
|
||||
type SchemeStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountByScope provides a mock function with given fields: scope
|
||||
func (_m *SchemeStore) CountByScope(scope string) (int64, error) {
|
||||
ret := _m.Called(scope)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountByScope")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(scope)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CountWithoutPermission provides a mock function with given fields: scope, permissionID, roleScope, roleType
|
||||
func (_m *SchemeStore) CountWithoutPermission(scope string, permissionID string, roleScope model.RoleScope, roleType model.RoleType) (int64, error) {
|
||||
ret := _m.Called(scope, permissionID, roleScope, roleType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountWithoutPermission")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.RoleScope, model.RoleType) error); ok {
|
||||
r1 = rf(scope, permissionID, roleScope, roleType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: schemeID
|
||||
func (_m *SchemeStore) Delete(schemeID string) (*model.Scheme, error) {
|
||||
ret := _m.Called(schemeID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(schemeID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: schemeID
|
||||
func (_m *SchemeStore) Get(schemeID string) (*model.Scheme, error) {
|
||||
ret := _m.Called(schemeID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(schemeID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllPage provides a mock function with given fields: scope, offset, limit
|
||||
func (_m *SchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model.Scheme, error) {
|
||||
ret := _m.Called(scope, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllPage")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(scope, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByName provides a mock function with given fields: schemeName
|
||||
func (_m *SchemeStore) GetByName(schemeName string) (*model.Scheme, error) {
|
||||
ret := _m.Called(schemeName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByName")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(schemeName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteAll provides a mock function with no fields
|
||||
func (_m *SchemeStore) PermanentDeleteAll() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteAll")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: scheme
|
||||
func (_m *SchemeStore) Save(scheme *model.Scheme) (*model.Scheme, error) {
|
||||
ret := _m.Called(scheme)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.Scheme) error); ok {
|
||||
r1 = rf(scheme)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSchemeStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SchemeStore {
|
||||
mock := &SchemeStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
119
server/channels/store/storetest/mocks/SessionAttributeStore.go
Normal file
119
server/channels/store/storetest/mocks/SessionAttributeStore.go
Normal file
@@ -0,0 +1,119 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
|
||||
// SessionAttributeStore is an autogenerated mock type for the SessionAttributeStore type
|
||||
type SessionAttributeStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Clear provides a mock function with no fields
|
||||
func (_m *SessionAttributeStore) Clear() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Clear")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: sessionID
|
||||
func (_m *SessionAttributeStore) Get(sessionID string) (map[string]interface{}, map[string]int64, error) {
|
||||
ret := _m.Called(sessionID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 map[string]interface{}
|
||||
var r1 map[string]int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(string) (map[string]interface{}, map[string]int64, error)); ok {
|
||||
return rf(sessionID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) map[string]interface{}); ok {
|
||||
r0 = rf(sessionID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]interface{})
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) map[string]int64); ok {
|
||||
r1 = rf(sessionID)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(map[string]int64)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(string) error); ok {
|
||||
r2 = rf(sessionID)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// Invalidate provides a mock function with given fields: sessionID
|
||||
func (_m *SessionAttributeStore) Invalidate(sessionID string) error {
|
||||
ret := _m.Called(sessionID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Invalidate")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(sessionID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Refresh provides a mock function with given fields: sessionID, attrs, updatedAt
|
||||
func (_m *SessionAttributeStore) Refresh(sessionID string, attrs map[string]interface{}, updatedAt int64) error {
|
||||
ret := _m.Called(sessionID, attrs, updatedAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Refresh")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, map[string]interface{}, int64) error); ok {
|
||||
r0 = rf(sessionID, attrs, updatedAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewSessionAttributeStore creates a new instance of SessionAttributeStore. 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 NewSessionAttributeStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SessionAttributeStore {
|
||||
mock := &SessionAttributeStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
488
server/channels/store/storetest/mocks/SessionStore.go
Normal file
488
server/channels/store/storetest/mocks/SessionStore.go
Normal file
@@ -0,0 +1,488 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// SessionStore is an autogenerated mock type for the SessionStore type
|
||||
type SessionStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AnalyticsSessionCount provides a mock function with no fields
|
||||
func (_m *SessionStore) AnalyticsSessionCount() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AnalyticsSessionCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Cleanup provides a mock function with given fields: expiryTime, batchSize
|
||||
func (_m *SessionStore) Cleanup(expiryTime int64, batchSize int64) error {
|
||||
ret := _m.Called(expiryTime, batchSize)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Cleanup")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) error); ok {
|
||||
r0 = rf(expiryTime, batchSize)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, sessionIDOrToken
|
||||
func (_m *SessionStore) Get(rctx request.CTX, sessionIDOrToken string) (*model.Session, error) {
|
||||
ret := _m.Called(rctx, sessionIDOrToken)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Session, error)); ok {
|
||||
return rf(rctx, sessionIDOrToken)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Session); ok {
|
||||
r0 = rf(rctx, sessionIDOrToken)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, sessionIDOrToken)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllSessionsWithActiveDeviceIds provides a mock function with no fields
|
||||
func (_m *SessionStore) GetAllSessionsWithActiveDeviceIds() ([]*model.Session, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllSessionsWithActiveDeviceIds")
|
||||
}
|
||||
|
||||
var r0 []*model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func() ([]*model.Session, error)); ok {
|
||||
return rf()
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func() []*model.Session); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLRUSessions provides a mock function with given fields: rctx, userID, limit, offset
|
||||
func (_m *SessionStore) GetLRUSessions(rctx request.CTX, userID string, limit uint64, offset uint64) ([]*model.Session, error) {
|
||||
ret := _m.Called(rctx, userID, limit, offset)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLRUSessions")
|
||||
}
|
||||
|
||||
var r0 []*model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, uint64, uint64) ([]*model.Session, error)); ok {
|
||||
return rf(rctx, userID, limit, offset)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, uint64, uint64) []*model.Session); ok {
|
||||
r0 = rf(rctx, userID, limit, offset)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, uint64, uint64) error); ok {
|
||||
r1 = rf(rctx, userID, limit, offset)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMobileSessionMetadata provides a mock function with no fields
|
||||
func (_m *SessionStore) GetMobileSessionMetadata() ([]*model.MobileSessionMetadata, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMobileSessionMetadata")
|
||||
}
|
||||
|
||||
var r0 []*model.MobileSessionMetadata
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func() ([]*model.MobileSessionMetadata, error)); ok {
|
||||
return rf()
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func() []*model.MobileSessionMetadata); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.MobileSessionMetadata)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSessions provides a mock function with given fields: rctx, userID
|
||||
func (_m *SessionStore) GetSessions(rctx request.CTX, userID string) ([]*model.Session, error) {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSessions")
|
||||
}
|
||||
|
||||
var r0 []*model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Session, error)); ok {
|
||||
return rf(rctx, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Session); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSessionsExpired provides a mock function with given fields: thresholdMillis, mobileOnly, unnotifiedOnly
|
||||
func (_m *SessionStore) GetSessionsExpired(thresholdMillis int64, mobileOnly bool, unnotifiedOnly bool) ([]*model.Session, error) {
|
||||
ret := _m.Called(thresholdMillis, mobileOnly, unnotifiedOnly)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSessionsExpired")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, bool, bool) error); ok {
|
||||
r1 = rf(thresholdMillis, mobileOnly, unnotifiedOnly)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSessionsWithActiveDeviceIds provides a mock function with given fields: userID
|
||||
func (_m *SessionStore) GetSessionsWithActiveDeviceIds(userID string) ([]*model.Session, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSessionsWithActiveDeviceIds")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteSessionsByUser provides a mock function with given fields: teamID
|
||||
func (_m *SessionStore) PermanentDeleteSessionsByUser(teamID string) error {
|
||||
ret := _m.Called(teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteSessionsByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(teamID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Remove provides a mock function with given fields: sessionIDOrToken
|
||||
func (_m *SessionStore) Remove(sessionIDOrToken string) error {
|
||||
ret := _m.Called(sessionIDOrToken)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Remove")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(sessionIDOrToken)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAllSessions provides a mock function with no fields
|
||||
func (_m *SessionStore) RemoveAllSessions() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAllSessions")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, session
|
||||
func (_m *SessionStore) Save(rctx request.CTX, session *model.Session) (*model.Session, error) {
|
||||
ret := _m.Called(rctx, session)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Session) (*model.Session, error)); ok {
|
||||
return rf(rctx, session)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Session) *model.Session); ok {
|
||||
r0 = rf(rctx, session)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Session) error); ok {
|
||||
r1 = rf(rctx, session)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateDeviceId provides a mock function with given fields: id, deviceId, voIPDeviceId, expiresAt
|
||||
func (_m *SessionStore) UpdateDeviceId(id string, deviceId string, voIPDeviceId string, expiresAt int64) error {
|
||||
ret := _m.Called(id, deviceId, voIPDeviceId, expiresAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateDeviceId")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string, int64) error); ok {
|
||||
r0 = rf(id, deviceId, voIPDeviceId, expiresAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateExpiredNotify provides a mock function with given fields: sessionid, notified
|
||||
func (_m *SessionStore) UpdateExpiredNotify(sessionid string, notified bool) error {
|
||||
ret := _m.Called(sessionid, notified)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateExpiredNotify")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) error); ok {
|
||||
r0 = rf(sessionid, notified)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateExpiresAt provides a mock function with given fields: sessionID, timestamp
|
||||
func (_m *SessionStore) UpdateExpiresAt(sessionID string, timestamp int64) error {
|
||||
ret := _m.Called(sessionID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateExpiresAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(sessionID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateLastActivityAt provides a mock function with given fields: sessionID, timestamp
|
||||
func (_m *SessionStore) UpdateLastActivityAt(sessionID string, timestamp int64) error {
|
||||
ret := _m.Called(sessionID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateLastActivityAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(sessionID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateProps provides a mock function with given fields: session
|
||||
func (_m *SessionStore) UpdateProps(session *model.Session) error {
|
||||
ret := _m.Called(session)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateProps")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Session) error); ok {
|
||||
r0 = rf(session)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateRoles provides a mock function with given fields: userID, roles
|
||||
func (_m *SessionStore) UpdateRoles(userID string, roles string) (string, error) {
|
||||
ret := _m.Called(userID, roles)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRoles")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, roles)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSessionStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SessionStore {
|
||||
mock := &SessionStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
779
server/channels/store/storetest/mocks/SharedChannelStore.go
Normal file
779
server/channels/store/storetest/mocks/SharedChannelStore.go
Normal file
@@ -0,0 +1,779 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// SharedChannelStore is an autogenerated mock type for the SharedChannelStore type
|
||||
type SharedChannelStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) Delete(channelID string) (bool, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteRemote provides a mock function with given fields: remoteID
|
||||
func (_m *SharedChannelStore) DeleteRemote(remoteID string) (bool, error) {
|
||||
ret := _m.Called(remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteRemote")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) Get(channelID string) (*model.SharedChannel, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit, opts
|
||||
func (_m *SharedChannelStore) GetAll(offset int, limit int, opts model.SharedChannelFilterOpts) ([]*model.SharedChannel, error) {
|
||||
ret := _m.Called(offset, limit, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.SharedChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int, model.SharedChannelFilterOpts) error); ok {
|
||||
r1 = rf(offset, limit, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllCount provides a mock function with given fields: opts
|
||||
func (_m *SharedChannelStore) GetAllCount(opts model.SharedChannelFilterOpts) (int64, error) {
|
||||
ret := _m.Called(opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.SharedChannelFilterOpts) error); ok {
|
||||
r1 = rf(opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAttachment provides a mock function with given fields: fileID, remoteID
|
||||
func (_m *SharedChannelStore) GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error) {
|
||||
ret := _m.Called(fileID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAttachment")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelAttachment)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(fileID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemote provides a mock function with given fields: id
|
||||
func (_m *SharedChannelStore) GetRemote(id string) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemote")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelRemote)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemoteByIds provides a mock function with given fields: channelID, remoteID
|
||||
func (_m *SharedChannelStore) GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemoteByIds")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelRemote)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemoteForUser provides a mock function with given fields: remoteID, userID, includeDeleted
|
||||
func (_m *SharedChannelStore) GetRemoteForUser(remoteID string, userID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteID, userID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemoteForUser")
|
||||
}
|
||||
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) (*model.RemoteCluster, error)); ok {
|
||||
return rf(remoteID, userID, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) *model.RemoteCluster); ok {
|
||||
r0 = rf(remoteID, userID, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(remoteID, userID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemotes provides a mock function with given fields: offset, limit, opts
|
||||
func (_m *SharedChannelStore) GetRemotes(offset int, limit int, opts model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(offset, limit, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemotes")
|
||||
}
|
||||
|
||||
var r0 []*model.SharedChannelRemote
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int, int, model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error)); ok {
|
||||
return rf(offset, limit, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int, int, model.SharedChannelRemoteFilterOpts) []*model.SharedChannelRemote); ok {
|
||||
r0 = rf(offset, limit, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.SharedChannelRemote)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int, model.SharedChannelRemoteFilterOpts) error); ok {
|
||||
r1 = rf(offset, limit, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemotesStatus provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemotesStatus")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.SharedChannelRemoteStatus)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSingleUser provides a mock function with given fields: userID, channelID, remoteID
|
||||
func (_m *SharedChannelStore) GetSingleUser(userID string, channelID string, remoteID string) (*model.SharedChannelUser, error) {
|
||||
ret := _m.Called(userID, channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSingleUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelUser)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(userID, channelID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUsersForSync provides a mock function with given fields: filter
|
||||
func (_m *SharedChannelStore) GetUsersForSync(filter model.GetUsersForSyncFilter) ([]*model.User, error) {
|
||||
ret := _m.Called(filter)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUsersForSync")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.GetUsersForSyncFilter) error); ok {
|
||||
r1 = rf(filter)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUsersForUser provides a mock function with given fields: userID
|
||||
func (_m *SharedChannelStore) GetUsersForUser(userID string) ([]*model.SharedChannelUser, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUsersForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.SharedChannelUser)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// HasChannel provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) HasChannel(channelID string) (bool, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for HasChannel")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// HasRemote provides a mock function with given fields: channelID, remoteID
|
||||
func (_m *SharedChannelStore) HasRemote(channelID string, remoteID string) (bool, error) {
|
||||
ret := _m.Called(channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for HasRemote")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: sc
|
||||
func (_m *SharedChannelStore) Save(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
||||
ret := _m.Called(sc)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
|
||||
r1 = rf(sc)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveAttachment provides a mock function with given fields: remote
|
||||
func (_m *SharedChannelStore) SaveAttachment(remote *model.SharedChannelAttachment) (*model.SharedChannelAttachment, error) {
|
||||
ret := _m.Called(remote)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveAttachment")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelAttachment)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok {
|
||||
r1 = rf(remote)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveRemote provides a mock function with given fields: remote
|
||||
func (_m *SharedChannelStore) SaveRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(remote)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveRemote")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelRemote)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok {
|
||||
r1 = rf(remote)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveUser provides a mock function with given fields: remote
|
||||
func (_m *SharedChannelStore) SaveUser(remote *model.SharedChannelUser) (*model.SharedChannelUser, error) {
|
||||
ret := _m.Called(remote)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelUser)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannelUser) error); ok {
|
||||
r1 = rf(remote)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: sc
|
||||
func (_m *SharedChannelStore) Update(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
||||
ret := _m.Called(sc)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
|
||||
r1 = rf(sc)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateAttachmentLastSyncAt provides a mock function with given fields: id, syncTime
|
||||
func (_m *SharedChannelStore) UpdateAttachmentLastSyncAt(id string, syncTime int64) error {
|
||||
ret := _m.Called(id, syncTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateAttachmentLastSyncAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(id, syncTime)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateRemote provides a mock function with given fields: remote
|
||||
func (_m *SharedChannelStore) UpdateRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(remote)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRemote")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelRemote)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannelRemote) error); ok {
|
||||
r1 = rf(remote)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateRemoteCursor provides a mock function with given fields: id, cursor
|
||||
func (_m *SharedChannelStore) UpdateRemoteCursor(id string, cursor model.GetPostsSinceForSyncCursor) error {
|
||||
ret := _m.Called(id, cursor)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRemoteCursor")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.GetPostsSinceForSyncCursor) error); ok {
|
||||
r0 = rf(id, cursor)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateRemoteMembershipCursor provides a mock function with given fields: id, syncTime
|
||||
func (_m *SharedChannelStore) UpdateRemoteMembershipCursor(id string, syncTime int64) error {
|
||||
ret := _m.Called(id, syncTime)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateRemoteMembershipCursor")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(id, syncTime)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateUserLastSyncAt provides a mock function with given fields: userID, channelID, remoteID
|
||||
func (_m *SharedChannelStore) UpdateUserLastSyncAt(userID string, channelID string, remoteID string) error {
|
||||
ret := _m.Called(userID, channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateUserLastSyncAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = rf(userID, channelID, remoteID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpsertAttachment provides a mock function with given fields: remote
|
||||
func (_m *SharedChannelStore) UpsertAttachment(remote *model.SharedChannelAttachment) (string, error) {
|
||||
ret := _m.Called(remote)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpsertAttachment")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.SharedChannelAttachment) error); ok {
|
||||
r1 = rf(remote)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSharedChannelStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SharedChannelStore {
|
||||
mock := &SharedChannelStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
219
server/channels/store/storetest/mocks/StatusStore.go
Normal file
219
server/channels/store/storetest/mocks/StatusStore.go
Normal file
@@ -0,0 +1,219 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// StatusStore is an autogenerated mock type for the StatusStore type
|
||||
type StatusStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userID
|
||||
func (_m *StatusStore) Get(userID string) (*model.Status, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Status)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByIds provides a mock function with given fields: userIds
|
||||
func (_m *StatusStore) GetByIds(userIds []string) ([]*model.Status, error) {
|
||||
ret := _m.Called(userIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByIds")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Status)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(userIds)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalActiveUsersCount provides a mock function with no fields
|
||||
func (_m *StatusStore) GetTotalActiveUsersCount() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalActiveUsersCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ResetAll provides a mock function with no fields
|
||||
func (_m *StatusStore) ResetAll() error {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ResetAll")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveOrUpdate provides a mock function with given fields: status
|
||||
func (_m *StatusStore) SaveOrUpdate(status *model.Status) error {
|
||||
ret := _m.Called(status)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOrUpdate")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Status) error); ok {
|
||||
r0 = rf(status)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveOrUpdateMany provides a mock function with given fields: statuses
|
||||
func (_m *StatusStore) SaveOrUpdateMany(statuses map[string]*model.Status) error {
|
||||
ret := _m.Called(statuses)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOrUpdateMany")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(map[string]*model.Status) error); ok {
|
||||
r0 = rf(statuses)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateExpiredDNDStatuses provides a mock function with no fields
|
||||
func (_m *StatusStore) UpdateExpiredDNDStatuses() ([]*model.Status, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateExpiredDNDStatuses")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Status)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateLastActivityAt provides a mock function with given fields: userID, lastActivityAt
|
||||
func (_m *StatusStore) UpdateLastActivityAt(userID string, lastActivityAt int64) error {
|
||||
ret := _m.Called(userID, lastActivityAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateLastActivityAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(userID, lastActivityAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewStatusStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *StatusStore {
|
||||
mock := &StatusStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
1649
server/channels/store/storetest/mocks/Store.go
Normal file
1649
server/channels/store/storetest/mocks/Store.go
Normal file
File diff suppressed because it is too large
Load Diff
264
server/channels/store/storetest/mocks/SystemStore.go
Normal file
264
server/channels/store/storetest/mocks/SystemStore.go
Normal file
@@ -0,0 +1,264 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// SystemStore is an autogenerated mock type for the SystemStore type
|
||||
type SystemStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with no fields
|
||||
func (_m *SystemStore) Get() (model.StringMap, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.StringMap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByName provides a mock function with given fields: name
|
||||
func (_m *SystemStore) GetByName(name string) (*model.System, error) {
|
||||
ret := _m.Called(name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByName")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.System)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByNameWithContext provides a mock function with given fields: rctx, name
|
||||
func (_m *SystemStore) GetByNameWithContext(rctx request.CTX, name string) (*model.System, error) {
|
||||
ret := _m.Called(rctx, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByNameWithContext")
|
||||
}
|
||||
|
||||
var r0 *model.System
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.System, error)); ok {
|
||||
return rf(rctx, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.System); ok {
|
||||
r0 = rf(rctx, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.System)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetWithContext provides a mock function with given fields: rctx
|
||||
func (_m *SystemStore) GetWithContext(rctx request.CTX) (model.StringMap, error) {
|
||||
ret := _m.Called(rctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetWithContext")
|
||||
}
|
||||
|
||||
var r0 model.StringMap
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) (model.StringMap, error)); ok {
|
||||
return rf(rctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) model.StringMap); ok {
|
||||
r0 = rf(rctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.StringMap)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) error); ok {
|
||||
r1 = rf(rctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InsertIfExists provides a mock function with given fields: system
|
||||
func (_m *SystemStore) InsertIfExists(system *model.System) (*model.System, error) {
|
||||
ret := _m.Called(system)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for InsertIfExists")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.System)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.System) error); ok {
|
||||
r1 = rf(system)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByName provides a mock function with given fields: name
|
||||
func (_m *SystemStore) PermanentDeleteByName(name string) (*model.System, error) {
|
||||
ret := _m.Called(name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteByName")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.System)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: system
|
||||
func (_m *SystemStore) Save(system *model.System) error {
|
||||
ret := _m.Called(system)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.System) error); ok {
|
||||
r0 = rf(system)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveOrUpdate provides a mock function with given fields: system
|
||||
func (_m *SystemStore) SaveOrUpdate(system *model.System) error {
|
||||
ret := _m.Called(system)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOrUpdate")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.System) error); ok {
|
||||
r0 = rf(system)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: system
|
||||
func (_m *SystemStore) Update(system *model.System) error {
|
||||
ret := _m.Called(system)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.System) error); ok {
|
||||
r0 = rf(system)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSystemStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *SystemStore {
|
||||
mock := &SystemStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
1439
server/channels/store/storetest/mocks/TeamStore.go
Normal file
1439
server/channels/store/storetest/mocks/TeamStore.go
Normal file
File diff suppressed because it is too large
Load Diff
143
server/channels/store/storetest/mocks/TemporaryPostStore.go
Normal file
143
server/channels/store/storetest/mocks/TemporaryPostStore.go
Normal file
@@ -0,0 +1,143 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// TemporaryPostStore is an autogenerated mock type for the TemporaryPostStore type
|
||||
type TemporaryPostStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: rctx, id
|
||||
func (_m *TemporaryPostStore) Delete(rctx request.CTX, id string) error {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id, allowFromCache
|
||||
func (_m *TemporaryPostStore) Get(rctx request.CTX, id string, allowFromCache bool) (*model.TemporaryPost, error) {
|
||||
ret := _m.Called(rctx, id, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.TemporaryPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) (*model.TemporaryPost, error)); ok {
|
||||
return rf(rctx, id, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) *model.TemporaryPost); ok {
|
||||
r0 = rf(rctx, id, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.TemporaryPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, bool) error); ok {
|
||||
r1 = rf(rctx, id, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetExpiredPosts provides a mock function with given fields: rctx, lastPostId, limit
|
||||
func (_m *TemporaryPostStore) GetExpiredPosts(rctx request.CTX, lastPostId string, limit uint64) ([]string, error) {
|
||||
ret := _m.Called(rctx, lastPostId, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetExpiredPosts")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, uint64) ([]string, error)); ok {
|
||||
return rf(rctx, lastPostId, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, uint64) []string); ok {
|
||||
r0 = rf(rctx, lastPostId, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, uint64) error); ok {
|
||||
r1 = rf(rctx, lastPostId, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateTemporaryPost provides a mock function with given fields: id
|
||||
func (_m *TemporaryPostStore) InvalidateTemporaryPost(id string) {
|
||||
_m.Called(id)
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: rctx, post
|
||||
func (_m *TemporaryPostStore) Save(rctx request.CTX, post *model.TemporaryPost) (*model.TemporaryPost, error) {
|
||||
ret := _m.Called(rctx, post)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.TemporaryPost
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.TemporaryPost) (*model.TemporaryPost, error)); ok {
|
||||
return rf(rctx, post)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.TemporaryPost) *model.TemporaryPost); ok {
|
||||
r0 = rf(rctx, post)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.TemporaryPost)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.TemporaryPost) error); ok {
|
||||
r1 = rf(rctx, post)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewTemporaryPostStore creates a new instance of TemporaryPostStore. 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 NewTemporaryPostStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *TemporaryPostStore {
|
||||
mock := &TemporaryPostStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
119
server/channels/store/storetest/mocks/TermsOfServiceStore.go
Normal file
119
server/channels/store/storetest/mocks/TermsOfServiceStore.go
Normal file
@@ -0,0 +1,119 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// TermsOfServiceStore is an autogenerated mock type for the TermsOfServiceStore type
|
||||
type TermsOfServiceStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id, allowFromCache
|
||||
func (_m *TermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, error) {
|
||||
ret := _m.Called(id, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.TermsOfService)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(id, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLatest provides a mock function with given fields: allowFromCache
|
||||
func (_m *TermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, error) {
|
||||
ret := _m.Called(allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLatest")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.TermsOfService)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(bool) error); ok {
|
||||
r1 = rf(allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: termsOfService
|
||||
func (_m *TermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*model.TermsOfService, error) {
|
||||
ret := _m.Called(termsOfService)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.TermsOfService)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.TermsOfService) error); ok {
|
||||
r1 = rf(termsOfService)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewTermsOfServiceStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *TermsOfServiceStore {
|
||||
mock := &TermsOfServiceStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
755
server/channels/store/storetest/mocks/ThreadStore.go
Normal file
755
server/channels/store/storetest/mocks/ThreadStore.go
Normal file
@@ -0,0 +1,755 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
store "github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ThreadStore is an autogenerated mock type for the ThreadStore type
|
||||
type ThreadStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteMembershipForUser provides a mock function with given fields: userID, postID
|
||||
func (_m *ThreadStore) DeleteMembershipForUser(userID string, postID string) error {
|
||||
ret := _m.Called(userID, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteMembershipForUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteMembershipsForChannel provides a mock function with given fields: userID, channelID
|
||||
func (_m *ThreadStore) DeleteMembershipsForChannel(userID string, channelID string) error {
|
||||
ret := _m.Called(userID, channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteMembershipsForChannel")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, channelID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOrphanedRows provides a mock function with given fields: limit
|
||||
func (_m *ThreadStore) DeleteOrphanedRows(limit int) (int64, error) {
|
||||
ret := _m.Called(limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanedRows")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int) error); ok {
|
||||
r1 = rf(limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ThreadStore) Get(id string) (*model.Thread, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Thread)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMembershipForUser provides a mock function with given fields: userID, postID
|
||||
func (_m *ThreadStore) GetMembershipForUser(userID string, postID string) (*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userID, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMembershipForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMembershipsForUser provides a mock function with given fields: userID, teamID
|
||||
func (_m *ThreadStore) GetMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userID, teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMembershipsForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamsUnreadForUser provides a mock function with given fields: userID, teamIDs, includeUrgentMentionCount
|
||||
func (_m *ThreadStore) GetTeamsUnreadForUser(userID string, teamIDs []string, includeUrgentMentionCount bool) (map[string]*model.TeamUnread, error) {
|
||||
ret := _m.Called(userID, teamIDs, includeUrgentMentionCount)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamsUnreadForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]*model.TeamUnread)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string, bool) error); ok {
|
||||
r1 = rf(userID, teamIDs, includeUrgentMentionCount)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadFollowers provides a mock function with given fields: threadID, fetchOnlyActive
|
||||
func (_m *ThreadStore) GetThreadFollowers(threadID string, fetchOnlyActive bool) ([]string, error) {
|
||||
ret := _m.Called(threadID, fetchOnlyActive)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadFollowers")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(threadID, fetchOnlyActive)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadForUser provides a mock function with given fields: rctx, threadMembership, extended, postPriorityIsEnabled
|
||||
func (_m *ThreadStore) GetThreadForUser(rctx request.CTX, threadMembership *model.ThreadMembership, extended bool, postPriorityIsEnabled bool) (*model.ThreadResponse, error) {
|
||||
ret := _m.Called(rctx, threadMembership, extended, postPriorityIsEnabled)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadForUser")
|
||||
}
|
||||
|
||||
var r0 *model.ThreadResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ThreadMembership, bool, bool) (*model.ThreadResponse, error)); ok {
|
||||
return rf(rctx, threadMembership, extended, postPriorityIsEnabled)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.ThreadMembership, bool, bool) *model.ThreadResponse); ok {
|
||||
r0 = rf(rctx, threadMembership, extended, postPriorityIsEnabled)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ThreadResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.ThreadMembership, bool, bool) error); ok {
|
||||
r1 = rf(rctx, threadMembership, extended, postPriorityIsEnabled)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadMembershipsForExport provides a mock function with given fields: postID
|
||||
func (_m *ThreadStore) GetThreadMembershipsForExport(postID string) ([]*model.ThreadMembershipForExport, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadMembershipsForExport")
|
||||
}
|
||||
|
||||
var r0 []*model.ThreadMembershipForExport
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*model.ThreadMembershipForExport, error)); ok {
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*model.ThreadMembershipForExport); ok {
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadMembershipForExport)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadUnreadReplyCount provides a mock function with given fields: threadMembership
|
||||
func (_m *ThreadStore) GetThreadUnreadReplyCount(threadMembership *model.ThreadMembership) (int64, error) {
|
||||
ret := _m.Called(threadMembership)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadUnreadReplyCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok {
|
||||
r1 = rf(threadMembership)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadsForUser provides a mock function with given fields: rctx, userID, teamID, opts
|
||||
func (_m *ThreadStore) GetThreadsForUser(rctx request.CTX, userID string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
ret := _m.Called(rctx, userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadsForUser")
|
||||
}
|
||||
|
||||
var r0 []*model.ThreadResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, model.GetUserThreadsOpts) ([]*model.ThreadResponse, error)); ok {
|
||||
return rf(rctx, userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, model.GetUserThreadsOpts) []*model.ThreadResponse); ok {
|
||||
r0 = rf(rctx, userID, teamID, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(rctx, userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalThreads provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalThreads")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadMentions provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadMentions")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadThreads provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadThreads")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadUrgentMentions provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadUrgentMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadUrgentMentions")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MaintainMembership provides a mock function with given fields: userID, postID, opts
|
||||
func (_m *ThreadStore) MaintainMembership(userID string, postID string, opts store.ThreadMembershipOpts) (*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userID, postID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MaintainMembership")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, store.ThreadMembershipOpts) error); ok {
|
||||
r1 = rf(userID, postID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MaintainMultipleFromImport provides a mock function with given fields: memberships
|
||||
func (_m *ThreadStore) MaintainMultipleFromImport(memberships []*model.ThreadMembership) ([]*model.ThreadMembership, error) {
|
||||
ret := _m.Called(memberships)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MaintainMultipleFromImport")
|
||||
}
|
||||
|
||||
var r0 []*model.ThreadMembership
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.ThreadMembership) ([]*model.ThreadMembership, error)); ok {
|
||||
return rf(memberships)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]*model.ThreadMembership) []*model.ThreadMembership); ok {
|
||||
r0 = rf(memberships)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]*model.ThreadMembership) error); ok {
|
||||
r1 = rf(memberships)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MarkAllAsRead provides a mock function with given fields: userID, threadIds
|
||||
func (_m *ThreadStore) MarkAllAsRead(userID string, threadIds []string) error {
|
||||
ret := _m.Called(userID, threadIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkAllAsRead")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(userID, threadIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MarkAllAsReadByChannels provides a mock function with given fields: userID, channelIDs
|
||||
func (_m *ThreadStore) MarkAllAsReadByChannels(userID string, channelIDs []string) error {
|
||||
ret := _m.Called(userID, channelIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkAllAsReadByChannels")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(userID, channelIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MarkAllAsReadByTeam provides a mock function with given fields: userID, teamID
|
||||
func (_m *ThreadStore) MarkAllAsReadByTeam(userID string, teamID string) error {
|
||||
ret := _m.Called(userID, teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkAllAsReadByTeam")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, teamID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MarkAsRead provides a mock function with given fields: userID, threadID, timestamp
|
||||
func (_m *ThreadStore) MarkAsRead(userID string, threadID string, timestamp int64) error {
|
||||
ret := _m.Called(userID, threadID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MarkAsRead")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) error); ok {
|
||||
r0 = rf(userID, threadID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteBatchForRetentionPolicies provides a mock function with given fields: retentionPolicyBatchConfigs, cursor
|
||||
func (_m *ThreadStore) PermanentDeleteBatchForRetentionPolicies(retentionPolicyBatchConfigs model.RetentionPolicyBatchConfigs, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error) {
|
||||
ret := _m.Called(retentionPolicyBatchConfigs, cursor)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatchForRetentionPolicies")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 model.RetentionPolicyCursor
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok {
|
||||
return rf(retentionPolicyBatchConfigs, cursor)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) int64); ok {
|
||||
r0 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok {
|
||||
r1 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r1 = ret.Get(1).(model.RetentionPolicyCursor)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) error); ok {
|
||||
r2 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// PermanentDeleteBatchThreadMembershipsForRetentionPolicies provides a mock function with given fields: retentionPolicyBatchConfigs, cursor
|
||||
func (_m *ThreadStore) PermanentDeleteBatchThreadMembershipsForRetentionPolicies(retentionPolicyBatchConfigs model.RetentionPolicyBatchConfigs, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error) {
|
||||
ret := _m.Called(retentionPolicyBatchConfigs, cursor)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteBatchThreadMembershipsForRetentionPolicies")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 model.RetentionPolicyCursor
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)); ok {
|
||||
return rf(retentionPolicyBatchConfigs, cursor)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) int64); ok {
|
||||
r0 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) model.RetentionPolicyCursor); ok {
|
||||
r1 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r1 = ret.Get(1).(model.RetentionPolicyCursor)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(model.RetentionPolicyBatchConfigs, model.RetentionPolicyCursor) error); ok {
|
||||
r2 = rf(retentionPolicyBatchConfigs, cursor)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// SaveMultipleMemberships provides a mock function with given fields: memberships
|
||||
func (_m *ThreadStore) SaveMultipleMemberships(memberships []*model.ThreadMembership) ([]*model.ThreadMembership, error) {
|
||||
ret := _m.Called(memberships)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveMultipleMemberships")
|
||||
}
|
||||
|
||||
var r0 []*model.ThreadMembership
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]*model.ThreadMembership) ([]*model.ThreadMembership, error)); ok {
|
||||
return rf(memberships)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]*model.ThreadMembership) []*model.ThreadMembership); ok {
|
||||
r0 = rf(memberships)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]*model.ThreadMembership) error); ok {
|
||||
r1 = rf(memberships)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateMembership provides a mock function with given fields: membership
|
||||
func (_m *ThreadStore) UpdateMembership(membership *model.ThreadMembership) (*model.ThreadMembership, error) {
|
||||
ret := _m.Called(membership)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateMembership")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ThreadMembership)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok {
|
||||
r1 = rf(membership)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateTeamIdForChannelThreads provides a mock function with given fields: channelId, teamId
|
||||
func (_m *ThreadStore) UpdateTeamIdForChannelThreads(channelId string, teamId string) error {
|
||||
ret := _m.Called(channelId, teamId)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTeamIdForChannelThreads")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(channelId, teamId)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewThreadStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ThreadStore {
|
||||
mock := &ThreadStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
208
server/channels/store/storetest/mocks/TokenStore.go
Normal file
208
server/channels/store/storetest/mocks/TokenStore.go
Normal file
@@ -0,0 +1,208 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// TokenStore is an autogenerated mock type for the TokenStore type
|
||||
type TokenStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Cleanup provides a mock function with given fields: expiryTime
|
||||
func (_m *TokenStore) Cleanup(expiryTime int64) {
|
||||
_m.Called(expiryTime)
|
||||
}
|
||||
|
||||
// ConsumeOnce provides a mock function with given fields: tokenType, tokenStr
|
||||
func (_m *TokenStore) ConsumeOnce(tokenType string, tokenStr string) (*model.Token, error) {
|
||||
ret := _m.Called(tokenType, tokenStr)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ConsumeOnce")
|
||||
}
|
||||
|
||||
var r0 *model.Token
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.Token, error)); ok {
|
||||
return rf(tokenType, tokenStr)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.Token); ok {
|
||||
r0 = rf(tokenType, tokenStr)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Token)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(tokenType, tokenStr)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: token
|
||||
func (_m *TokenStore) Delete(token string) error {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(token)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetAllTokensByType provides a mock function with given fields: tokenType
|
||||
func (_m *TokenStore) GetAllTokensByType(tokenType string) ([]*model.Token, error) {
|
||||
ret := _m.Called(tokenType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllTokensByType")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Token)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(tokenType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByToken provides a mock function with given fields: token
|
||||
func (_m *TokenStore) GetByToken(token string) (*model.Token, error) {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByToken")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Token)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(token)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTokenByTypeAndEmail provides a mock function with given fields: tokenType, email
|
||||
func (_m *TokenStore) GetTokenByTypeAndEmail(tokenType string, email string) (*model.Token, error) {
|
||||
ret := _m.Called(tokenType, email)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTokenByTypeAndEmail")
|
||||
}
|
||||
|
||||
var r0 *model.Token
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.Token, error)); ok {
|
||||
return rf(tokenType, email)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.Token); ok {
|
||||
r0 = rf(tokenType, email)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Token)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(tokenType, email)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// RemoveAllTokensByType provides a mock function with given fields: tokenType
|
||||
func (_m *TokenStore) RemoveAllTokensByType(tokenType string) error {
|
||||
ret := _m.Called(tokenType)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAllTokensByType")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(tokenType)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: recovery
|
||||
func (_m *TokenStore) Save(recovery *model.Token) error {
|
||||
ret := _m.Called(recovery)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Token) error); ok {
|
||||
r0 = rf(recovery)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewTokenStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *TokenStore {
|
||||
mock := &TokenStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
156
server/channels/store/storetest/mocks/UploadSessionStore.go
Normal file
156
server/channels/store/storetest/mocks/UploadSessionStore.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// UploadSessionStore is an autogenerated mock type for the UploadSessionStore type
|
||||
type UploadSessionStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *UploadSessionStore) Delete(id string) error {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: rctx, id
|
||||
func (_m *UploadSessionStore) Get(rctx request.CTX, id string) (*model.UploadSession, error) {
|
||||
ret := _m.Called(rctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.UploadSession
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.UploadSession, error)); ok {
|
||||
return rf(rctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.UploadSession); ok {
|
||||
r0 = rf(rctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UploadSession)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(rctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForUser provides a mock function with given fields: userID
|
||||
func (_m *UploadSessionStore) GetForUser(userID string) ([]*model.UploadSession, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UploadSession)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: session
|
||||
func (_m *UploadSessionStore) Save(session *model.UploadSession) (*model.UploadSession, error) {
|
||||
ret := _m.Called(session)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UploadSession)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.UploadSession) error); ok {
|
||||
r1 = rf(session)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: session
|
||||
func (_m *UploadSessionStore) Update(session *model.UploadSession) error {
|
||||
ret := _m.Called(session)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.UploadSession) error); ok {
|
||||
r0 = rf(session)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUploadSessionStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UploadSessionStore {
|
||||
mock := &UploadSessionStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
463
server/channels/store/storetest/mocks/UserAccessTokenStore.go
Normal file
463
server/channels/store/storetest/mocks/UserAccessTokenStore.go
Normal file
@@ -0,0 +1,463 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// UserAccessTokenStore is an autogenerated mock type for the UserAccessTokenStore type
|
||||
type UserAccessTokenStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountNonCompliantExpiry provides a mock function with given fields: maxExpiresAt
|
||||
func (_m *UserAccessTokenStore) CountNonCompliantExpiry(maxExpiresAt int64) (int64, error) {
|
||||
ret := _m.Called(maxExpiresAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountNonCompliantExpiry")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64) (int64, error)); ok {
|
||||
return rf(maxExpiresAt)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64) int64); ok {
|
||||
r0 = rf(maxExpiresAt)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
||||
r1 = rf(maxExpiresAt)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: tokenID
|
||||
func (_m *UserAccessTokenStore) Delete(tokenID string) error {
|
||||
ret := _m.Called(tokenID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(tokenID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteAllForUser provides a mock function with given fields: userID
|
||||
func (_m *UserAccessTokenStore) DeleteAllForUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteAllForUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByIds provides a mock function with given fields: tokenIDs
|
||||
func (_m *UserAccessTokenStore) DeleteByIds(tokenIDs []string) (int64, error) {
|
||||
ret := _m.Called(tokenIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByIds")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func([]string) (int64, error)); ok {
|
||||
return rf(tokenIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func([]string) int64); ok {
|
||||
r0 = rf(tokenIDs)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
||||
r1 = rf(tokenIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteNonCompliantExpiry provides a mock function with given fields: maxExpiresAt, limit
|
||||
func (_m *UserAccessTokenStore) DeleteNonCompliantExpiry(maxExpiresAt int64, limit int) ([]string, error) {
|
||||
ret := _m.Called(maxExpiresAt, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteNonCompliantExpiry")
|
||||
}
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int) ([]string, error)); ok {
|
||||
return rf(maxExpiresAt, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, int) []string); ok {
|
||||
r0 = rf(maxExpiresAt, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int) error); ok {
|
||||
r1 = rf(maxExpiresAt, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: tokenID
|
||||
func (_m *UserAccessTokenStore) Get(tokenID string) (*model.UserAccessToken, error) {
|
||||
ret := _m.Called(tokenID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(tokenID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit
|
||||
func (_m *UserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAccessToken, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAll")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByToken provides a mock function with given fields: tokenString
|
||||
func (_m *UserAccessTokenStore) GetByToken(tokenString string) (*model.UserAccessToken, error) {
|
||||
ret := _m.Called(tokenString)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByToken")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(tokenString)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByUser provides a mock function with given fields: userID, page, perPage
|
||||
func (_m *UserAccessTokenStore) GetByUser(userID string, page int, perPage int) ([]*model.UserAccessToken, error) {
|
||||
ret := _m.Called(userID, page, perPage)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, page, perPage)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetExpiredBefore provides a mock function with given fields: cutoff, limit
|
||||
func (_m *UserAccessTokenStore) GetExpiredBefore(cutoff int64, limit int) ([]*model.UserAccessToken, error) {
|
||||
ret := _m.Called(cutoff, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetExpiredBefore")
|
||||
}
|
||||
|
||||
var r0 []*model.UserAccessToken
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int) ([]*model.UserAccessToken, error)); ok {
|
||||
return rf(cutoff, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, int) []*model.UserAccessToken); ok {
|
||||
r0 = rf(cutoff, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, int) error); ok {
|
||||
r1 = rf(cutoff, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetExpiringTokens provides a mock function with given fields: now, thresholds, limit
|
||||
func (_m *UserAccessTokenStore) GetExpiringTokens(now int64, thresholds []int, limit int) ([]*model.UserAccessToken, error) {
|
||||
ret := _m.Called(now, thresholds, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetExpiringTokens")
|
||||
}
|
||||
|
||||
var r0 []*model.UserAccessToken
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, []int, int) ([]*model.UserAccessToken, error)); ok {
|
||||
return rf(now, thresholds, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, []int, int) []*model.UserAccessToken); ok {
|
||||
r0 = rf(now, thresholds, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, []int, int) error); ok {
|
||||
r1 = rf(now, thresholds, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: token
|
||||
func (_m *UserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserAccessToken, error) {
|
||||
ret := _m.Called(token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.UserAccessToken) error); ok {
|
||||
r1 = rf(token)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: term
|
||||
func (_m *UserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, error) {
|
||||
ret := _m.Called(term)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.UserAccessToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(term)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateLastNotifiedAt provides a mock function with given fields: tokenID, notifiedAt
|
||||
func (_m *UserAccessTokenStore) UpdateLastNotifiedAt(tokenID string, notifiedAt int64) error {
|
||||
ret := _m.Called(tokenID, notifiedAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateLastNotifiedAt")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(tokenID, notifiedAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateTokenDisable provides a mock function with given fields: tokenID
|
||||
func (_m *UserAccessTokenStore) UpdateTokenDisable(tokenID string) error {
|
||||
ret := _m.Called(tokenID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTokenDisable")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(tokenID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateTokenEnable provides a mock function with given fields: tokenID
|
||||
func (_m *UserAccessTokenStore) UpdateTokenEnable(tokenID string) error {
|
||||
ret := _m.Called(tokenID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTokenEnable")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(tokenID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateTokenRotate provides a mock function with given fields: tokenID, newToken, expiresAt
|
||||
func (_m *UserAccessTokenStore) UpdateTokenRotate(tokenID string, newToken string, expiresAt int64) error {
|
||||
ret := _m.Called(tokenID, newToken, expiresAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTokenRotate")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) error); ok {
|
||||
r0 = rf(tokenID, newToken, expiresAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserAccessTokenStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserAccessTokenStore {
|
||||
mock := &UserAccessTokenStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
2377
server/channels/store/storetest/mocks/UserStore.go
Normal file
2377
server/channels/store/storetest/mocks/UserStore.go
Normal file
File diff suppressed because it is too large
Load Diff
107
server/channels/store/storetest/mocks/UserTermsOfServiceStore.go
Normal file
107
server/channels/store/storetest/mocks/UserTermsOfServiceStore.go
Normal file
@@ -0,0 +1,107 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// UserTermsOfServiceStore is an autogenerated mock type for the UserTermsOfServiceStore type
|
||||
type UserTermsOfServiceStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: userID, termsOfServiceID
|
||||
func (_m *UserTermsOfServiceStore) Delete(userID string, termsOfServiceID string) error {
|
||||
ret := _m.Called(userID, termsOfServiceID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, termsOfServiceID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetByUser provides a mock function with given fields: userID
|
||||
func (_m *UserTermsOfServiceStore) GetByUser(userID string) (*model.UserTermsOfService, error) {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserTermsOfService)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: userTermsOfService
|
||||
func (_m *UserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfService) (*model.UserTermsOfService, error) {
|
||||
ret := _m.Called(userTermsOfService)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserTermsOfService)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.UserTermsOfService) error); ok {
|
||||
r1 = rf(userTermsOfService)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserTermsOfServiceStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserTermsOfServiceStore {
|
||||
mock := &UserTermsOfServiceStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
225
server/channels/store/storetest/mocks/ViewStore.go
Normal file
225
server/channels/store/storetest/mocks/ViewStore.go
Normal file
@@ -0,0 +1,225 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ViewStore is an autogenerated mock type for the ViewStore type
|
||||
type ViewStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// CountForChannel provides a mock function with given fields: channelID, opts
|
||||
func (_m *ViewStore) CountForChannel(channelID string, opts model.ViewQueryOpts) (int64, error) {
|
||||
ret := _m.Called(channelID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CountForChannel")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.ViewQueryOpts) (int64, error)); ok {
|
||||
return rf(channelID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, model.ViewQueryOpts) int64); ok {
|
||||
r0 = rf(channelID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.ViewQueryOpts) error); ok {
|
||||
r1 = rf(channelID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: viewID, deleteAt
|
||||
func (_m *ViewStore) Delete(viewID string, deleteAt int64) error {
|
||||
ret := _m.Called(viewID, deleteAt)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(viewID, deleteAt)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ViewStore) Get(id string) (*model.View, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *model.View
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.View, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.View); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.View)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForChannel provides a mock function with given fields: channelID, opts
|
||||
func (_m *ViewStore) GetForChannel(channelID string, opts model.ViewQueryOpts) ([]*model.View, error) {
|
||||
ret := _m.Called(channelID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForChannel")
|
||||
}
|
||||
|
||||
var r0 []*model.View
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.ViewQueryOpts) ([]*model.View, error)); ok {
|
||||
return rf(channelID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, model.ViewQueryOpts) []*model.View); ok {
|
||||
r0 = rf(channelID, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.View)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.ViewQueryOpts) error); ok {
|
||||
r1 = rf(channelID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: view
|
||||
func (_m *ViewStore) Save(view *model.View) (*model.View, error) {
|
||||
ret := _m.Called(view)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Save")
|
||||
}
|
||||
|
||||
var r0 *model.View
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.View) (*model.View, error)); ok {
|
||||
return rf(view)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.View) *model.View); ok {
|
||||
r0 = rf(view)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.View)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.View) error); ok {
|
||||
r1 = rf(view)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: view
|
||||
func (_m *ViewStore) Update(view *model.View) (*model.View, error) {
|
||||
ret := _m.Called(view)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
}
|
||||
|
||||
var r0 *model.View
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*model.View) (*model.View, error)); ok {
|
||||
return rf(view)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*model.View) *model.View); ok {
|
||||
r0 = rf(view)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.View)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.View) error); ok {
|
||||
r1 = rf(view)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateSortOrder provides a mock function with given fields: viewID, channelID, newIndex
|
||||
func (_m *ViewStore) UpdateSortOrder(viewID string, channelID string, newIndex int64) ([]*model.View, error) {
|
||||
ret := _m.Called(viewID, channelID, newIndex)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateSortOrder")
|
||||
}
|
||||
|
||||
var r0 []*model.View
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) ([]*model.View, error)); ok {
|
||||
return rf(viewID, channelID, newIndex)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) []*model.View); ok {
|
||||
r0 = rf(viewID, channelID, newIndex)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.View)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
|
||||
r1 = rf(viewID, channelID, newIndex)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// NewViewStore creates a new instance of ViewStore. 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 NewViewStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ViewStore {
|
||||
mock := &ViewStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
731
server/channels/store/storetest/mocks/WebhookStore.go
Normal file
731
server/channels/store/storetest/mocks/WebhookStore.go
Normal file
@@ -0,0 +1,731 @@
|
||||
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// WebhookStore is an autogenerated mock type for the WebhookStore type
|
||||
type WebhookStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AnalyticsIncomingCount provides a mock function with given fields: teamID, userID
|
||||
func (_m *WebhookStore) AnalyticsIncomingCount(teamID string, userID string) (int64, error) {
|
||||
ret := _m.Called(teamID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AnalyticsIncomingCount")
|
||||
}
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (int64, error)); ok {
|
||||
return rf(teamID, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) int64); ok {
|
||||
r0 = rf(teamID, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(teamID, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// AnalyticsOutgoingCount provides a mock function with given fields: teamID
|
||||
func (_m *WebhookStore) AnalyticsOutgoingCount(teamID string) (int64, error) {
|
||||
ret := _m.Called(teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AnalyticsOutgoingCount")
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ClearCaches provides a mock function with no fields
|
||||
func (_m *WebhookStore) ClearCaches() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// DeleteIncoming provides a mock function with given fields: webhookID, timestamp
|
||||
func (_m *WebhookStore) DeleteIncoming(webhookID string, timestamp int64) error {
|
||||
ret := _m.Called(webhookID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteIncoming")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(webhookID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOutgoing provides a mock function with given fields: webhookID, timestamp
|
||||
func (_m *WebhookStore) DeleteOutgoing(webhookID string, timestamp int64) error {
|
||||
ret := _m.Called(webhookID, timestamp)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOutgoing")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(webhookID, timestamp)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetIncoming provides a mock function with given fields: id, allowFromCache
|
||||
func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(id, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncoming")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(id, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByChannel provides a mock function with given fields: channelID
|
||||
func (_m *WebhookStore) GetIncomingByChannel(channelID string) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncomingByChannel")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByTeam provides a mock function with given fields: teamID, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingByTeam(teamID string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(teamID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncomingByTeam")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(teamID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByTeamByUser provides a mock function with given fields: teamID, userID, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingByTeamByUser(teamID string, userID string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(teamID, userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncomingByTeamByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(teamID, userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingList provides a mock function with given fields: offset, limit
|
||||
func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncomingList")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingListByUser provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingListByUser(userID string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetIncomingListByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoing provides a mock function with given fields: id
|
||||
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoing")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByChannel provides a mock function with given fields: channelID, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByChannel(channelID string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(channelID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingByChannel")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(channelID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByChannelByUser provides a mock function with given fields: channelID, userID, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByChannelByUser(channelID string, userID string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(channelID, userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingByChannelByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(channelID, userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByTeam provides a mock function with given fields: teamID, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByTeam(teamID string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(teamID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingByTeam")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(teamID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByTeamByUser provides a mock function with given fields: teamID, userID, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByTeamByUser(teamID string, userID string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(teamID, userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingByTeamByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(teamID, userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingList provides a mock function with given fields: offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingList")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingListByUser provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingListByUser(userID string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetOutgoingListByUser")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateWebhookCache provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) InvalidateWebhookCache(webhook string) {
|
||||
_m.Called(webhook)
|
||||
}
|
||||
|
||||
// PermanentDeleteIncomingByChannel provides a mock function with given fields: channelID
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByChannel(channelID string) error {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteIncomingByChannel")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(channelID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteIncomingByUser provides a mock function with given fields: userID
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteIncomingByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteOutgoingByChannel provides a mock function with given fields: channelID
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByChannel(channelID string) error {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteOutgoingByChannel")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(channelID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteOutgoingByUser provides a mock function with given fields: userID
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByUser(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PermanentDeleteOutgoingByUser")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveIncoming provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveIncoming")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveOutgoing provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveOutgoing")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateIncoming provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateIncoming")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.IncomingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateIncomingLastUsed provides a mock function with given fields: webhookID, lastUsed
|
||||
func (_m *WebhookStore) UpdateIncomingLastUsed(webhookID string, lastUsed int64) error {
|
||||
ret := _m.Called(webhookID, lastUsed)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateIncomingLastUsed")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(webhookID, lastUsed)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateOutgoing provides a mock function with given fields: hook
|
||||
func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(hook)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateOutgoing")
|
||||
}
|
||||
|
||||
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 {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.OutgoingWebhook)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||
r1 = rf(hook)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// 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.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewWebhookStore(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *WebhookStore {
|
||||
mock := &WebhookStore{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
Reference in New Issue
Block a user