Migrate Bots store to sync by default (#11182)
* Migrate Bots store to sync by default * Fixing tests * Fixing govet * Fixing tests
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1c63057095
Коммит
693017a317
@@ -6,7 +6,6 @@ package mocks
|
||||
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
import model "github.com/mattermost/mattermost-server/model"
|
||||
import store "github.com/mattermost/mattermost-server/store"
|
||||
|
||||
// BotStore is an autogenerated mock type for the BotStore type
|
||||
type BotStore struct {
|
||||
@@ -14,47 +13,65 @@ type BotStore struct {
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: userId, includeDeleted
|
||||
func (_m *BotStore) Get(userId string, includeDeleted bool) store.StoreChannel {
|
||||
func (_m *BotStore) Get(userId string, includeDeleted bool) (*model.Bot, *model.AppError) {
|
||||
ret := _m.Called(userId, includeDeleted)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(string, bool) store.StoreChannel); ok {
|
||||
var r0 *model.Bot
|
||||
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).(store.StoreChannel)
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok {
|
||||
r1 = rf(userId, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: options
|
||||
func (_m *BotStore) GetAll(options *model.BotGetOptions) store.StoreChannel {
|
||||
func (_m *BotStore) GetAll(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) {
|
||||
ret := _m.Called(options)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(*model.BotGetOptions) store.StoreChannel); ok {
|
||||
var r0 []*model.Bot
|
||||
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).(store.StoreChannel)
|
||||
r0 = ret.Get(0).([]*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.BotGetOptions) *model.AppError); ok {
|
||||
r1 = rf(options)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDelete provides a mock function with given fields: userId
|
||||
func (_m *BotStore) PermanentDelete(userId string) store.StoreChannel {
|
||||
func (_m *BotStore) PermanentDelete(userId string) *model.AppError {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,33 +79,51 @@ func (_m *BotStore) PermanentDelete(userId string) store.StoreChannel {
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: bot
|
||||
func (_m *BotStore) Save(bot *model.Bot) store.StoreChannel {
|
||||
func (_m *BotStore) Save(bot *model.Bot) (*model.Bot, *model.AppError) {
|
||||
ret := _m.Called(bot)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(*model.Bot) store.StoreChannel); ok {
|
||||
var r0 *model.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).(store.StoreChannel)
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Bot) *model.AppError); ok {
|
||||
r1 = rf(bot)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: bot
|
||||
func (_m *BotStore) Update(bot *model.Bot) store.StoreChannel {
|
||||
func (_m *BotStore) Update(bot *model.Bot) (*model.Bot, *model.AppError) {
|
||||
ret := _m.Called(bot)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(*model.Bot) store.StoreChannel); ok {
|
||||
var r0 *model.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).(store.StoreChannel)
|
||||
r0 = ret.Get(0).(*model.Bot)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Bot) *model.AppError); ok {
|
||||
r1 = rf(bot)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user