Files
8b02f33adc Fix alphabetical ordering of GetAllSessionsWithActiveDeviceIds in generated store layers (#37258)
The GetAllSessionsWithActiveDeviceIds method added in PR #36945 was
placed after GetSessionsWithActiveDeviceIds in the generated files, but
the code generator sorts methods alphabetically. "GetAll..." (A) sorts
before "GetLRU..." (L) and "GetSessions..." (S), so the method must
appear before GetLRUSessions in retrylayer.go, timerlayer.go, and
mocks/SessionStore.go.

This was causing the Server CI check-store-layers and check-mocks steps
to fail on master.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-26 16:00:10 +02:00

489 lines
12 KiB
Go

// 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
}