github.com/haalcala/mattermost-server-change-repo/v5@v5.33.2/store/storetest/mocks/ThreadStore.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  // ThreadStore is an autogenerated mock type for the ThreadStore type
    13  type ThreadStore struct {
    14  	mock.Mock
    15  }
    16  
    17  // CollectThreadsWithNewerReplies provides a mock function with given fields: userId, channelIds, timestamp
    18  func (_m *ThreadStore) CollectThreadsWithNewerReplies(userId string, channelIds []string, timestamp int64) ([]string, error) {
    19  	ret := _m.Called(userId, channelIds, timestamp)
    20  
    21  	var r0 []string
    22  	if rf, ok := ret.Get(0).(func(string, []string, int64) []string); ok {
    23  		r0 = rf(userId, channelIds, timestamp)
    24  	} else {
    25  		if ret.Get(0) != nil {
    26  			r0 = ret.Get(0).([]string)
    27  		}
    28  	}
    29  
    30  	var r1 error
    31  	if rf, ok := ret.Get(1).(func(string, []string, int64) error); ok {
    32  		r1 = rf(userId, channelIds, timestamp)
    33  	} else {
    34  		r1 = ret.Error(1)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  // CreateMembershipIfNeeded provides a mock function with given fields: userId, postId, following, incrementMentions, updateFollowing
    41  func (_m *ThreadStore) CreateMembershipIfNeeded(userId string, postId string, following bool, incrementMentions bool, updateFollowing bool) error {
    42  	ret := _m.Called(userId, postId, following, incrementMentions, updateFollowing)
    43  
    44  	var r0 error
    45  	if rf, ok := ret.Get(0).(func(string, string, bool, bool, bool) error); ok {
    46  		r0 = rf(userId, postId, following, incrementMentions, updateFollowing)
    47  	} else {
    48  		r0 = ret.Error(0)
    49  	}
    50  
    51  	return r0
    52  }
    53  
    54  // Delete provides a mock function with given fields: postId
    55  func (_m *ThreadStore) Delete(postId string) error {
    56  	ret := _m.Called(postId)
    57  
    58  	var r0 error
    59  	if rf, ok := ret.Get(0).(func(string) error); ok {
    60  		r0 = rf(postId)
    61  	} else {
    62  		r0 = ret.Error(0)
    63  	}
    64  
    65  	return r0
    66  }
    67  
    68  // DeleteMembershipForUser provides a mock function with given fields: userId, postId
    69  func (_m *ThreadStore) DeleteMembershipForUser(userId string, postId string) error {
    70  	ret := _m.Called(userId, postId)
    71  
    72  	var r0 error
    73  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
    74  		r0 = rf(userId, postId)
    75  	} else {
    76  		r0 = ret.Error(0)
    77  	}
    78  
    79  	return r0
    80  }
    81  
    82  // Get provides a mock function with given fields: id
    83  func (_m *ThreadStore) Get(id string) (*model.Thread, error) {
    84  	ret := _m.Called(id)
    85  
    86  	var r0 *model.Thread
    87  	if rf, ok := ret.Get(0).(func(string) *model.Thread); ok {
    88  		r0 = rf(id)
    89  	} else {
    90  		if ret.Get(0) != nil {
    91  			r0 = ret.Get(0).(*model.Thread)
    92  		}
    93  	}
    94  
    95  	var r1 error
    96  	if rf, ok := ret.Get(1).(func(string) error); ok {
    97  		r1 = rf(id)
    98  	} else {
    99  		r1 = ret.Error(1)
   100  	}
   101  
   102  	return r0, r1
   103  }
   104  
   105  // GetMembershipForUser provides a mock function with given fields: userId, postId
   106  func (_m *ThreadStore) GetMembershipForUser(userId string, postId string) (*model.ThreadMembership, error) {
   107  	ret := _m.Called(userId, postId)
   108  
   109  	var r0 *model.ThreadMembership
   110  	if rf, ok := ret.Get(0).(func(string, string) *model.ThreadMembership); ok {
   111  		r0 = rf(userId, postId)
   112  	} else {
   113  		if ret.Get(0) != nil {
   114  			r0 = ret.Get(0).(*model.ThreadMembership)
   115  		}
   116  	}
   117  
   118  	var r1 error
   119  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   120  		r1 = rf(userId, postId)
   121  	} else {
   122  		r1 = ret.Error(1)
   123  	}
   124  
   125  	return r0, r1
   126  }
   127  
   128  // GetMembershipsForUser provides a mock function with given fields: userId, teamId
   129  func (_m *ThreadStore) GetMembershipsForUser(userId string, teamId string) ([]*model.ThreadMembership, error) {
   130  	ret := _m.Called(userId, teamId)
   131  
   132  	var r0 []*model.ThreadMembership
   133  	if rf, ok := ret.Get(0).(func(string, string) []*model.ThreadMembership); ok {
   134  		r0 = rf(userId, teamId)
   135  	} else {
   136  		if ret.Get(0) != nil {
   137  			r0 = ret.Get(0).([]*model.ThreadMembership)
   138  		}
   139  	}
   140  
   141  	var r1 error
   142  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   143  		r1 = rf(userId, teamId)
   144  	} else {
   145  		r1 = ret.Error(1)
   146  	}
   147  
   148  	return r0, r1
   149  }
   150  
   151  // GetPosts provides a mock function with given fields: threadId, since
   152  func (_m *ThreadStore) GetPosts(threadId string, since int64) ([]*model.Post, error) {
   153  	ret := _m.Called(threadId, since)
   154  
   155  	var r0 []*model.Post
   156  	if rf, ok := ret.Get(0).(func(string, int64) []*model.Post); ok {
   157  		r0 = rf(threadId, since)
   158  	} else {
   159  		if ret.Get(0) != nil {
   160  			r0 = ret.Get(0).([]*model.Post)
   161  		}
   162  	}
   163  
   164  	var r1 error
   165  	if rf, ok := ret.Get(1).(func(string, int64) error); ok {
   166  		r1 = rf(threadId, since)
   167  	} else {
   168  		r1 = ret.Error(1)
   169  	}
   170  
   171  	return r0, r1
   172  }
   173  
   174  // GetThreadForUser provides a mock function with given fields: userId, teamId, threadId, extended
   175  func (_m *ThreadStore) GetThreadForUser(userId string, teamId string, threadId string, extended bool) (*model.ThreadResponse, error) {
   176  	ret := _m.Called(userId, teamId, threadId, extended)
   177  
   178  	var r0 *model.ThreadResponse
   179  	if rf, ok := ret.Get(0).(func(string, string, string, bool) *model.ThreadResponse); ok {
   180  		r0 = rf(userId, teamId, threadId, extended)
   181  	} else {
   182  		if ret.Get(0) != nil {
   183  			r0 = ret.Get(0).(*model.ThreadResponse)
   184  		}
   185  	}
   186  
   187  	var r1 error
   188  	if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
   189  		r1 = rf(userId, teamId, threadId, extended)
   190  	} else {
   191  		r1 = ret.Error(1)
   192  	}
   193  
   194  	return r0, r1
   195  }
   196  
   197  // GetThreadMentionsForUserPerChannel provides a mock function with given fields: userId, teamId
   198  func (_m *ThreadStore) GetThreadMentionsForUserPerChannel(userId string, teamId string) (map[string]int64, error) {
   199  	ret := _m.Called(userId, teamId)
   200  
   201  	var r0 map[string]int64
   202  	if rf, ok := ret.Get(0).(func(string, string) map[string]int64); ok {
   203  		r0 = rf(userId, teamId)
   204  	} else {
   205  		if ret.Get(0) != nil {
   206  			r0 = ret.Get(0).(map[string]int64)
   207  		}
   208  	}
   209  
   210  	var r1 error
   211  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   212  		r1 = rf(userId, teamId)
   213  	} else {
   214  		r1 = ret.Error(1)
   215  	}
   216  
   217  	return r0, r1
   218  }
   219  
   220  // GetThreadsForUser provides a mock function with given fields: userId, teamId, opts
   221  func (_m *ThreadStore) GetThreadsForUser(userId string, teamId string, opts model.GetUserThreadsOpts) (*model.Threads, error) {
   222  	ret := _m.Called(userId, teamId, opts)
   223  
   224  	var r0 *model.Threads
   225  	if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) *model.Threads); ok {
   226  		r0 = rf(userId, teamId, opts)
   227  	} else {
   228  		if ret.Get(0) != nil {
   229  			r0 = ret.Get(0).(*model.Threads)
   230  		}
   231  	}
   232  
   233  	var r1 error
   234  	if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
   235  		r1 = rf(userId, teamId, opts)
   236  	} else {
   237  		r1 = ret.Error(1)
   238  	}
   239  
   240  	return r0, r1
   241  }
   242  
   243  // MarkAllAsRead provides a mock function with given fields: userId, teamId
   244  func (_m *ThreadStore) MarkAllAsRead(userId string, teamId string) error {
   245  	ret := _m.Called(userId, teamId)
   246  
   247  	var r0 error
   248  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
   249  		r0 = rf(userId, teamId)
   250  	} else {
   251  		r0 = ret.Error(0)
   252  	}
   253  
   254  	return r0
   255  }
   256  
   257  // MarkAsRead provides a mock function with given fields: userId, threadId, timestamp
   258  func (_m *ThreadStore) MarkAsRead(userId string, threadId string, timestamp int64) error {
   259  	ret := _m.Called(userId, threadId, timestamp)
   260  
   261  	var r0 error
   262  	if rf, ok := ret.Get(0).(func(string, string, int64) error); ok {
   263  		r0 = rf(userId, threadId, timestamp)
   264  	} else {
   265  		r0 = ret.Error(0)
   266  	}
   267  
   268  	return r0
   269  }
   270  
   271  // Save provides a mock function with given fields: thread
   272  func (_m *ThreadStore) Save(thread *model.Thread) (*model.Thread, error) {
   273  	ret := _m.Called(thread)
   274  
   275  	var r0 *model.Thread
   276  	if rf, ok := ret.Get(0).(func(*model.Thread) *model.Thread); ok {
   277  		r0 = rf(thread)
   278  	} else {
   279  		if ret.Get(0) != nil {
   280  			r0 = ret.Get(0).(*model.Thread)
   281  		}
   282  	}
   283  
   284  	var r1 error
   285  	if rf, ok := ret.Get(1).(func(*model.Thread) error); ok {
   286  		r1 = rf(thread)
   287  	} else {
   288  		r1 = ret.Error(1)
   289  	}
   290  
   291  	return r0, r1
   292  }
   293  
   294  // SaveMembership provides a mock function with given fields: membership
   295  func (_m *ThreadStore) SaveMembership(membership *model.ThreadMembership) (*model.ThreadMembership, error) {
   296  	ret := _m.Called(membership)
   297  
   298  	var r0 *model.ThreadMembership
   299  	if rf, ok := ret.Get(0).(func(*model.ThreadMembership) *model.ThreadMembership); ok {
   300  		r0 = rf(membership)
   301  	} else {
   302  		if ret.Get(0) != nil {
   303  			r0 = ret.Get(0).(*model.ThreadMembership)
   304  		}
   305  	}
   306  
   307  	var r1 error
   308  	if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok {
   309  		r1 = rf(membership)
   310  	} else {
   311  		r1 = ret.Error(1)
   312  	}
   313  
   314  	return r0, r1
   315  }
   316  
   317  // SaveMultiple provides a mock function with given fields: thread
   318  func (_m *ThreadStore) SaveMultiple(thread []*model.Thread) ([]*model.Thread, int, error) {
   319  	ret := _m.Called(thread)
   320  
   321  	var r0 []*model.Thread
   322  	if rf, ok := ret.Get(0).(func([]*model.Thread) []*model.Thread); ok {
   323  		r0 = rf(thread)
   324  	} else {
   325  		if ret.Get(0) != nil {
   326  			r0 = ret.Get(0).([]*model.Thread)
   327  		}
   328  	}
   329  
   330  	var r1 int
   331  	if rf, ok := ret.Get(1).(func([]*model.Thread) int); ok {
   332  		r1 = rf(thread)
   333  	} else {
   334  		r1 = ret.Get(1).(int)
   335  	}
   336  
   337  	var r2 error
   338  	if rf, ok := ret.Get(2).(func([]*model.Thread) error); ok {
   339  		r2 = rf(thread)
   340  	} else {
   341  		r2 = ret.Error(2)
   342  	}
   343  
   344  	return r0, r1, r2
   345  }
   346  
   347  // Update provides a mock function with given fields: thread
   348  func (_m *ThreadStore) Update(thread *model.Thread) (*model.Thread, error) {
   349  	ret := _m.Called(thread)
   350  
   351  	var r0 *model.Thread
   352  	if rf, ok := ret.Get(0).(func(*model.Thread) *model.Thread); ok {
   353  		r0 = rf(thread)
   354  	} else {
   355  		if ret.Get(0) != nil {
   356  			r0 = ret.Get(0).(*model.Thread)
   357  		}
   358  	}
   359  
   360  	var r1 error
   361  	if rf, ok := ret.Get(1).(func(*model.Thread) error); ok {
   362  		r1 = rf(thread)
   363  	} else {
   364  		r1 = ret.Error(1)
   365  	}
   366  
   367  	return r0, r1
   368  }
   369  
   370  // UpdateMembership provides a mock function with given fields: membership
   371  func (_m *ThreadStore) UpdateMembership(membership *model.ThreadMembership) (*model.ThreadMembership, error) {
   372  	ret := _m.Called(membership)
   373  
   374  	var r0 *model.ThreadMembership
   375  	if rf, ok := ret.Get(0).(func(*model.ThreadMembership) *model.ThreadMembership); ok {
   376  		r0 = rf(membership)
   377  	} else {
   378  		if ret.Get(0) != nil {
   379  			r0 = ret.Get(0).(*model.ThreadMembership)
   380  		}
   381  	}
   382  
   383  	var r1 error
   384  	if rf, ok := ret.Get(1).(func(*model.ThreadMembership) error); ok {
   385  		r1 = rf(membership)
   386  	} else {
   387  		r1 = ret.Error(1)
   388  	}
   389  
   390  	return r0, r1
   391  }
   392  
   393  // UpdateUnreadsByChannel provides a mock function with given fields: userId, changedThreads, timestamp, updateViewedTimestamp
   394  func (_m *ThreadStore) UpdateUnreadsByChannel(userId string, changedThreads []string, timestamp int64, updateViewedTimestamp bool) error {
   395  	ret := _m.Called(userId, changedThreads, timestamp, updateViewedTimestamp)
   396  
   397  	var r0 error
   398  	if rf, ok := ret.Get(0).(func(string, []string, int64, bool) error); ok {
   399  		r0 = rf(userId, changedThreads, timestamp, updateViewedTimestamp)
   400  	} else {
   401  		r0 = ret.Error(0)
   402  	}
   403  
   404  	return r0
   405  }