github.com/haalcala/mattermost-server-change-repo/v5@v5.33.2/store/storetest/mocks/SessionStore.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  // Regenerate this file using `make store-mocks`.
     4  
     5  package mocks
     6  
     7  import (
     8  	model "github.com/mattermost/mattermost-server/v5/model"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // SessionStore is an autogenerated mock type for the SessionStore type
    13  type SessionStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // AnalyticsSessionCount provides a mock function with given fields:
    18  func (_m *SessionStore) AnalyticsSessionCount() (int64, error) {
    19  	ret := _m.Called()
    20  
    21  	var r0 int64
    22  	if rf, ok := ret.Get(0).(func() int64); ok {
    23  		r0 = rf()
    24  	} else {
    25  		r0 = ret.Get(0).(int64)
    26  	}
    27  
    28  	var r1 error
    29  	if rf, ok := ret.Get(1).(func() error); ok {
    30  		r1 = rf()
    31  	} else {
    32  		r1 = ret.Error(1)
    33  	}
    34  
    35  	return r0, r1
    36  }
    37  
    38  // Cleanup provides a mock function with given fields: expiryTime, batchSize
    39  func (_m *SessionStore) Cleanup(expiryTime int64, batchSize int64) {
    40  	_m.Called(expiryTime, batchSize)
    41  }
    42  
    43  // Get provides a mock function with given fields: sessionIdOrToken
    44  func (_m *SessionStore) Get(sessionIdOrToken string) (*model.Session, error) {
    45  	ret := _m.Called(sessionIdOrToken)
    46  
    47  	var r0 *model.Session
    48  	if rf, ok := ret.Get(0).(func(string) *model.Session); ok {
    49  		r0 = rf(sessionIdOrToken)
    50  	} else {
    51  		if ret.Get(0) != nil {
    52  			r0 = ret.Get(0).(*model.Session)
    53  		}
    54  	}
    55  
    56  	var r1 error
    57  	if rf, ok := ret.Get(1).(func(string) error); ok {
    58  		r1 = rf(sessionIdOrToken)
    59  	} else {
    60  		r1 = ret.Error(1)
    61  	}
    62  
    63  	return r0, r1
    64  }
    65  
    66  // GetSessions provides a mock function with given fields: userId
    67  func (_m *SessionStore) GetSessions(userId string) ([]*model.Session, error) {
    68  	ret := _m.Called(userId)
    69  
    70  	var r0 []*model.Session
    71  	if rf, ok := ret.Get(0).(func(string) []*model.Session); ok {
    72  		r0 = rf(userId)
    73  	} else {
    74  		if ret.Get(0) != nil {
    75  			r0 = ret.Get(0).([]*model.Session)
    76  		}
    77  	}
    78  
    79  	var r1 error
    80  	if rf, ok := ret.Get(1).(func(string) error); ok {
    81  		r1 = rf(userId)
    82  	} else {
    83  		r1 = ret.Error(1)
    84  	}
    85  
    86  	return r0, r1
    87  }
    88  
    89  // GetSessionsExpired provides a mock function with given fields: thresholdMillis, mobileOnly, unnotifiedOnly
    90  func (_m *SessionStore) GetSessionsExpired(thresholdMillis int64, mobileOnly bool, unnotifiedOnly bool) ([]*model.Session, error) {
    91  	ret := _m.Called(thresholdMillis, mobileOnly, unnotifiedOnly)
    92  
    93  	var r0 []*model.Session
    94  	if rf, ok := ret.Get(0).(func(int64, bool, bool) []*model.Session); ok {
    95  		r0 = rf(thresholdMillis, mobileOnly, unnotifiedOnly)
    96  	} else {
    97  		if ret.Get(0) != nil {
    98  			r0 = ret.Get(0).([]*model.Session)
    99  		}
   100  	}
   101  
   102  	var r1 error
   103  	if rf, ok := ret.Get(1).(func(int64, bool, bool) error); ok {
   104  		r1 = rf(thresholdMillis, mobileOnly, unnotifiedOnly)
   105  	} else {
   106  		r1 = ret.Error(1)
   107  	}
   108  
   109  	return r0, r1
   110  }
   111  
   112  // GetSessionsWithActiveDeviceIds provides a mock function with given fields: userId
   113  func (_m *SessionStore) GetSessionsWithActiveDeviceIds(userId string) ([]*model.Session, error) {
   114  	ret := _m.Called(userId)
   115  
   116  	var r0 []*model.Session
   117  	if rf, ok := ret.Get(0).(func(string) []*model.Session); ok {
   118  		r0 = rf(userId)
   119  	} else {
   120  		if ret.Get(0) != nil {
   121  			r0 = ret.Get(0).([]*model.Session)
   122  		}
   123  	}
   124  
   125  	var r1 error
   126  	if rf, ok := ret.Get(1).(func(string) error); ok {
   127  		r1 = rf(userId)
   128  	} else {
   129  		r1 = ret.Error(1)
   130  	}
   131  
   132  	return r0, r1
   133  }
   134  
   135  // PermanentDeleteSessionsByUser provides a mock function with given fields: teamId
   136  func (_m *SessionStore) PermanentDeleteSessionsByUser(teamId string) error {
   137  	ret := _m.Called(teamId)
   138  
   139  	var r0 error
   140  	if rf, ok := ret.Get(0).(func(string) error); ok {
   141  		r0 = rf(teamId)
   142  	} else {
   143  		r0 = ret.Error(0)
   144  	}
   145  
   146  	return r0
   147  }
   148  
   149  // Remove provides a mock function with given fields: sessionIdOrToken
   150  func (_m *SessionStore) Remove(sessionIdOrToken string) error {
   151  	ret := _m.Called(sessionIdOrToken)
   152  
   153  	var r0 error
   154  	if rf, ok := ret.Get(0).(func(string) error); ok {
   155  		r0 = rf(sessionIdOrToken)
   156  	} else {
   157  		r0 = ret.Error(0)
   158  	}
   159  
   160  	return r0
   161  }
   162  
   163  // RemoveAllSessions provides a mock function with given fields:
   164  func (_m *SessionStore) RemoveAllSessions() error {
   165  	ret := _m.Called()
   166  
   167  	var r0 error
   168  	if rf, ok := ret.Get(0).(func() error); ok {
   169  		r0 = rf()
   170  	} else {
   171  		r0 = ret.Error(0)
   172  	}
   173  
   174  	return r0
   175  }
   176  
   177  // Save provides a mock function with given fields: session
   178  func (_m *SessionStore) Save(session *model.Session) (*model.Session, error) {
   179  	ret := _m.Called(session)
   180  
   181  	var r0 *model.Session
   182  	if rf, ok := ret.Get(0).(func(*model.Session) *model.Session); ok {
   183  		r0 = rf(session)
   184  	} else {
   185  		if ret.Get(0) != nil {
   186  			r0 = ret.Get(0).(*model.Session)
   187  		}
   188  	}
   189  
   190  	var r1 error
   191  	if rf, ok := ret.Get(1).(func(*model.Session) error); ok {
   192  		r1 = rf(session)
   193  	} else {
   194  		r1 = ret.Error(1)
   195  	}
   196  
   197  	return r0, r1
   198  }
   199  
   200  // UpdateDeviceId provides a mock function with given fields: id, deviceId, expiresAt
   201  func (_m *SessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) (string, error) {
   202  	ret := _m.Called(id, deviceId, expiresAt)
   203  
   204  	var r0 string
   205  	if rf, ok := ret.Get(0).(func(string, string, int64) string); ok {
   206  		r0 = rf(id, deviceId, expiresAt)
   207  	} else {
   208  		r0 = ret.Get(0).(string)
   209  	}
   210  
   211  	var r1 error
   212  	if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
   213  		r1 = rf(id, deviceId, expiresAt)
   214  	} else {
   215  		r1 = ret.Error(1)
   216  	}
   217  
   218  	return r0, r1
   219  }
   220  
   221  // UpdateExpiredNotify provides a mock function with given fields: sessionid, notified
   222  func (_m *SessionStore) UpdateExpiredNotify(sessionid string, notified bool) error {
   223  	ret := _m.Called(sessionid, notified)
   224  
   225  	var r0 error
   226  	if rf, ok := ret.Get(0).(func(string, bool) error); ok {
   227  		r0 = rf(sessionid, notified)
   228  	} else {
   229  		r0 = ret.Error(0)
   230  	}
   231  
   232  	return r0
   233  }
   234  
   235  // UpdateExpiresAt provides a mock function with given fields: sessionId, time
   236  func (_m *SessionStore) UpdateExpiresAt(sessionId string, time int64) error {
   237  	ret := _m.Called(sessionId, time)
   238  
   239  	var r0 error
   240  	if rf, ok := ret.Get(0).(func(string, int64) error); ok {
   241  		r0 = rf(sessionId, time)
   242  	} else {
   243  		r0 = ret.Error(0)
   244  	}
   245  
   246  	return r0
   247  }
   248  
   249  // UpdateLastActivityAt provides a mock function with given fields: sessionId, time
   250  func (_m *SessionStore) UpdateLastActivityAt(sessionId string, time int64) error {
   251  	ret := _m.Called(sessionId, time)
   252  
   253  	var r0 error
   254  	if rf, ok := ret.Get(0).(func(string, int64) error); ok {
   255  		r0 = rf(sessionId, time)
   256  	} else {
   257  		r0 = ret.Error(0)
   258  	}
   259  
   260  	return r0
   261  }
   262  
   263  // UpdateProps provides a mock function with given fields: session
   264  func (_m *SessionStore) UpdateProps(session *model.Session) error {
   265  	ret := _m.Called(session)
   266  
   267  	var r0 error
   268  	if rf, ok := ret.Get(0).(func(*model.Session) error); ok {
   269  		r0 = rf(session)
   270  	} else {
   271  		r0 = ret.Error(0)
   272  	}
   273  
   274  	return r0
   275  }
   276  
   277  // UpdateRoles provides a mock function with given fields: userId, roles
   278  func (_m *SessionStore) UpdateRoles(userId string, roles string) (string, error) {
   279  	ret := _m.Called(userId, roles)
   280  
   281  	var r0 string
   282  	if rf, ok := ret.Get(0).(func(string, string) string); ok {
   283  		r0 = rf(userId, roles)
   284  	} else {
   285  		r0 = ret.Get(0).(string)
   286  	}
   287  
   288  	var r1 error
   289  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   290  		r1 = rf(userId, roles)
   291  	} else {
   292  		r1 = ret.Error(1)
   293  	}
   294  
   295  	return r0, r1
   296  }