github.com/mad-app/mattermost-server@v5.11.1+incompatible/store/storetest/mocks/PostStore.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 mock "github.com/stretchr/testify/mock"
     8  import model "github.com/mattermost/mattermost-server/model"
     9  import store "github.com/mattermost/mattermost-server/store"
    10  
    11  // PostStore is an autogenerated mock type for the PostStore type
    12  type PostStore struct {
    13  	mock.Mock
    14  }
    15  
    16  // AnalyticsPostCount provides a mock function with given fields: teamId, mustHaveFile, mustHaveHashtag
    17  func (_m *PostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) store.StoreChannel {
    18  	ret := _m.Called(teamId, mustHaveFile, mustHaveHashtag)
    19  
    20  	var r0 store.StoreChannel
    21  	if rf, ok := ret.Get(0).(func(string, bool, bool) store.StoreChannel); ok {
    22  		r0 = rf(teamId, mustHaveFile, mustHaveHashtag)
    23  	} else {
    24  		if ret.Get(0) != nil {
    25  			r0 = ret.Get(0).(store.StoreChannel)
    26  		}
    27  	}
    28  
    29  	return r0
    30  }
    31  
    32  // AnalyticsPostCountsByDay provides a mock function with given fields: teamId
    33  func (_m *PostStore) AnalyticsPostCountsByDay(teamId string) store.StoreChannel {
    34  	ret := _m.Called(teamId)
    35  
    36  	var r0 store.StoreChannel
    37  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
    38  		r0 = rf(teamId)
    39  	} else {
    40  		if ret.Get(0) != nil {
    41  			r0 = ret.Get(0).(store.StoreChannel)
    42  		}
    43  	}
    44  
    45  	return r0
    46  }
    47  
    48  // AnalyticsUserCountsWithPostsByDay provides a mock function with given fields: teamId
    49  func (_m *PostStore) AnalyticsUserCountsWithPostsByDay(teamId string) store.StoreChannel {
    50  	ret := _m.Called(teamId)
    51  
    52  	var r0 store.StoreChannel
    53  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
    54  		r0 = rf(teamId)
    55  	} else {
    56  		if ret.Get(0) != nil {
    57  			r0 = ret.Get(0).(store.StoreChannel)
    58  		}
    59  	}
    60  
    61  	return r0
    62  }
    63  
    64  // ClearCaches provides a mock function with given fields:
    65  func (_m *PostStore) ClearCaches() {
    66  	_m.Called()
    67  }
    68  
    69  // Delete provides a mock function with given fields: postId, time, deleteByID
    70  func (_m *PostStore) Delete(postId string, time int64, deleteByID string) store.StoreChannel {
    71  	ret := _m.Called(postId, time, deleteByID)
    72  
    73  	var r0 store.StoreChannel
    74  	if rf, ok := ret.Get(0).(func(string, int64, string) store.StoreChannel); ok {
    75  		r0 = rf(postId, time, deleteByID)
    76  	} else {
    77  		if ret.Get(0) != nil {
    78  			r0 = ret.Get(0).(store.StoreChannel)
    79  		}
    80  	}
    81  
    82  	return r0
    83  }
    84  
    85  // Get provides a mock function with given fields: id
    86  func (_m *PostStore) Get(id string) store.StoreChannel {
    87  	ret := _m.Called(id)
    88  
    89  	var r0 store.StoreChannel
    90  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
    91  		r0 = rf(id)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(store.StoreChannel)
    95  		}
    96  	}
    97  
    98  	return r0
    99  }
   100  
   101  // GetDirectPostParentsForExportAfter provides a mock function with given fields: limit, afterId
   102  func (_m *PostStore) GetDirectPostParentsForExportAfter(limit int, afterId string) store.StoreChannel {
   103  	ret := _m.Called(limit, afterId)
   104  
   105  	var r0 store.StoreChannel
   106  	if rf, ok := ret.Get(0).(func(int, string) store.StoreChannel); ok {
   107  		r0 = rf(limit, afterId)
   108  	} else {
   109  		if ret.Get(0) != nil {
   110  			r0 = ret.Get(0).(store.StoreChannel)
   111  		}
   112  	}
   113  
   114  	return r0
   115  }
   116  
   117  // GetEtag provides a mock function with given fields: channelId, allowFromCache
   118  func (_m *PostStore) GetEtag(channelId string, allowFromCache bool) store.StoreChannel {
   119  	ret := _m.Called(channelId, allowFromCache)
   120  
   121  	var r0 store.StoreChannel
   122  	if rf, ok := ret.Get(0).(func(string, bool) store.StoreChannel); ok {
   123  		r0 = rf(channelId, allowFromCache)
   124  	} else {
   125  		if ret.Get(0) != nil {
   126  			r0 = ret.Get(0).(store.StoreChannel)
   127  		}
   128  	}
   129  
   130  	return r0
   131  }
   132  
   133  // GetFlaggedPosts provides a mock function with given fields: userId, offset, limit
   134  func (_m *PostStore) GetFlaggedPosts(userId string, offset int, limit int) store.StoreChannel {
   135  	ret := _m.Called(userId, offset, limit)
   136  
   137  	var r0 store.StoreChannel
   138  	if rf, ok := ret.Get(0).(func(string, int, int) store.StoreChannel); ok {
   139  		r0 = rf(userId, offset, limit)
   140  	} else {
   141  		if ret.Get(0) != nil {
   142  			r0 = ret.Get(0).(store.StoreChannel)
   143  		}
   144  	}
   145  
   146  	return r0
   147  }
   148  
   149  // GetFlaggedPostsForChannel provides a mock function with given fields: userId, channelId, offset, limit
   150  func (_m *PostStore) GetFlaggedPostsForChannel(userId string, channelId string, offset int, limit int) store.StoreChannel {
   151  	ret := _m.Called(userId, channelId, offset, limit)
   152  
   153  	var r0 store.StoreChannel
   154  	if rf, ok := ret.Get(0).(func(string, string, int, int) store.StoreChannel); ok {
   155  		r0 = rf(userId, channelId, offset, limit)
   156  	} else {
   157  		if ret.Get(0) != nil {
   158  			r0 = ret.Get(0).(store.StoreChannel)
   159  		}
   160  	}
   161  
   162  	return r0
   163  }
   164  
   165  // GetFlaggedPostsForTeam provides a mock function with given fields: userId, teamId, offset, limit
   166  func (_m *PostStore) GetFlaggedPostsForTeam(userId string, teamId string, offset int, limit int) store.StoreChannel {
   167  	ret := _m.Called(userId, teamId, offset, limit)
   168  
   169  	var r0 store.StoreChannel
   170  	if rf, ok := ret.Get(0).(func(string, string, int, int) store.StoreChannel); ok {
   171  		r0 = rf(userId, teamId, offset, limit)
   172  	} else {
   173  		if ret.Get(0) != nil {
   174  			r0 = ret.Get(0).(store.StoreChannel)
   175  		}
   176  	}
   177  
   178  	return r0
   179  }
   180  
   181  // GetMaxPostSize provides a mock function with given fields:
   182  func (_m *PostStore) GetMaxPostSize() store.StoreChannel {
   183  	ret := _m.Called()
   184  
   185  	var r0 store.StoreChannel
   186  	if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
   187  		r0 = rf()
   188  	} else {
   189  		if ret.Get(0) != nil {
   190  			r0 = ret.Get(0).(store.StoreChannel)
   191  		}
   192  	}
   193  
   194  	return r0
   195  }
   196  
   197  // GetOldest provides a mock function with given fields:
   198  func (_m *PostStore) GetOldest() store.StoreChannel {
   199  	ret := _m.Called()
   200  
   201  	var r0 store.StoreChannel
   202  	if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
   203  		r0 = rf()
   204  	} else {
   205  		if ret.Get(0) != nil {
   206  			r0 = ret.Get(0).(store.StoreChannel)
   207  		}
   208  	}
   209  
   210  	return r0
   211  }
   212  
   213  // GetParentsForExportAfter provides a mock function with given fields: limit, afterId
   214  func (_m *PostStore) GetParentsForExportAfter(limit int, afterId string) store.StoreChannel {
   215  	ret := _m.Called(limit, afterId)
   216  
   217  	var r0 store.StoreChannel
   218  	if rf, ok := ret.Get(0).(func(int, string) store.StoreChannel); ok {
   219  		r0 = rf(limit, afterId)
   220  	} else {
   221  		if ret.Get(0) != nil {
   222  			r0 = ret.Get(0).(store.StoreChannel)
   223  		}
   224  	}
   225  
   226  	return r0
   227  }
   228  
   229  // GetPosts provides a mock function with given fields: channelId, offset, limit, allowFromCache
   230  func (_m *PostStore) GetPosts(channelId string, offset int, limit int, allowFromCache bool) store.StoreChannel {
   231  	ret := _m.Called(channelId, offset, limit, allowFromCache)
   232  
   233  	var r0 store.StoreChannel
   234  	if rf, ok := ret.Get(0).(func(string, int, int, bool) store.StoreChannel); ok {
   235  		r0 = rf(channelId, offset, limit, allowFromCache)
   236  	} else {
   237  		if ret.Get(0) != nil {
   238  			r0 = ret.Get(0).(store.StoreChannel)
   239  		}
   240  	}
   241  
   242  	return r0
   243  }
   244  
   245  // GetPostsAfter provides a mock function with given fields: channelId, postId, numPosts, offset
   246  func (_m *PostStore) GetPostsAfter(channelId string, postId string, numPosts int, offset int) store.StoreChannel {
   247  	ret := _m.Called(channelId, postId, numPosts, offset)
   248  
   249  	var r0 store.StoreChannel
   250  	if rf, ok := ret.Get(0).(func(string, string, int, int) store.StoreChannel); ok {
   251  		r0 = rf(channelId, postId, numPosts, offset)
   252  	} else {
   253  		if ret.Get(0) != nil {
   254  			r0 = ret.Get(0).(store.StoreChannel)
   255  		}
   256  	}
   257  
   258  	return r0
   259  }
   260  
   261  // GetPostsBatchForIndexing provides a mock function with given fields: startTime, endTime, limit
   262  func (_m *PostStore) GetPostsBatchForIndexing(startTime int64, endTime int64, limit int) store.StoreChannel {
   263  	ret := _m.Called(startTime, endTime, limit)
   264  
   265  	var r0 store.StoreChannel
   266  	if rf, ok := ret.Get(0).(func(int64, int64, int) store.StoreChannel); ok {
   267  		r0 = rf(startTime, endTime, limit)
   268  	} else {
   269  		if ret.Get(0) != nil {
   270  			r0 = ret.Get(0).(store.StoreChannel)
   271  		}
   272  	}
   273  
   274  	return r0
   275  }
   276  
   277  // GetPostsBefore provides a mock function with given fields: channelId, postId, numPosts, offset
   278  func (_m *PostStore) GetPostsBefore(channelId string, postId string, numPosts int, offset int) store.StoreChannel {
   279  	ret := _m.Called(channelId, postId, numPosts, offset)
   280  
   281  	var r0 store.StoreChannel
   282  	if rf, ok := ret.Get(0).(func(string, string, int, int) store.StoreChannel); ok {
   283  		r0 = rf(channelId, postId, numPosts, offset)
   284  	} else {
   285  		if ret.Get(0) != nil {
   286  			r0 = ret.Get(0).(store.StoreChannel)
   287  		}
   288  	}
   289  
   290  	return r0
   291  }
   292  
   293  // GetPostsByIds provides a mock function with given fields: postIds
   294  func (_m *PostStore) GetPostsByIds(postIds []string) store.StoreChannel {
   295  	ret := _m.Called(postIds)
   296  
   297  	var r0 store.StoreChannel
   298  	if rf, ok := ret.Get(0).(func([]string) store.StoreChannel); ok {
   299  		r0 = rf(postIds)
   300  	} else {
   301  		if ret.Get(0) != nil {
   302  			r0 = ret.Get(0).(store.StoreChannel)
   303  		}
   304  	}
   305  
   306  	return r0
   307  }
   308  
   309  // GetPostsCreatedAt provides a mock function with given fields: channelId, time
   310  func (_m *PostStore) GetPostsCreatedAt(channelId string, time int64) store.StoreChannel {
   311  	ret := _m.Called(channelId, time)
   312  
   313  	var r0 store.StoreChannel
   314  	if rf, ok := ret.Get(0).(func(string, int64) store.StoreChannel); ok {
   315  		r0 = rf(channelId, time)
   316  	} else {
   317  		if ret.Get(0) != nil {
   318  			r0 = ret.Get(0).(store.StoreChannel)
   319  		}
   320  	}
   321  
   322  	return r0
   323  }
   324  
   325  // GetPostsSince provides a mock function with given fields: channelId, time, allowFromCache
   326  func (_m *PostStore) GetPostsSince(channelId string, time int64, allowFromCache bool) store.StoreChannel {
   327  	ret := _m.Called(channelId, time, allowFromCache)
   328  
   329  	var r0 store.StoreChannel
   330  	if rf, ok := ret.Get(0).(func(string, int64, bool) store.StoreChannel); ok {
   331  		r0 = rf(channelId, time, allowFromCache)
   332  	} else {
   333  		if ret.Get(0) != nil {
   334  			r0 = ret.Get(0).(store.StoreChannel)
   335  		}
   336  	}
   337  
   338  	return r0
   339  }
   340  
   341  // GetRepliesForExport provides a mock function with given fields: parentId
   342  func (_m *PostStore) GetRepliesForExport(parentId string) store.StoreChannel {
   343  	ret := _m.Called(parentId)
   344  
   345  	var r0 store.StoreChannel
   346  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
   347  		r0 = rf(parentId)
   348  	} else {
   349  		if ret.Get(0) != nil {
   350  			r0 = ret.Get(0).(store.StoreChannel)
   351  		}
   352  	}
   353  
   354  	return r0
   355  }
   356  
   357  // GetSingle provides a mock function with given fields: id
   358  func (_m *PostStore) GetSingle(id string) store.StoreChannel {
   359  	ret := _m.Called(id)
   360  
   361  	var r0 store.StoreChannel
   362  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
   363  		r0 = rf(id)
   364  	} else {
   365  		if ret.Get(0) != nil {
   366  			r0 = ret.Get(0).(store.StoreChannel)
   367  		}
   368  	}
   369  
   370  	return r0
   371  }
   372  
   373  // InvalidateLastPostTimeCache provides a mock function with given fields: channelId
   374  func (_m *PostStore) InvalidateLastPostTimeCache(channelId string) {
   375  	_m.Called(channelId)
   376  }
   377  
   378  // Overwrite provides a mock function with given fields: post
   379  func (_m *PostStore) Overwrite(post *model.Post) store.StoreChannel {
   380  	ret := _m.Called(post)
   381  
   382  	var r0 store.StoreChannel
   383  	if rf, ok := ret.Get(0).(func(*model.Post) store.StoreChannel); ok {
   384  		r0 = rf(post)
   385  	} else {
   386  		if ret.Get(0) != nil {
   387  			r0 = ret.Get(0).(store.StoreChannel)
   388  		}
   389  	}
   390  
   391  	return r0
   392  }
   393  
   394  // PermanentDeleteBatch provides a mock function with given fields: endTime, limit
   395  func (_m *PostStore) PermanentDeleteBatch(endTime int64, limit int64) store.StoreChannel {
   396  	ret := _m.Called(endTime, limit)
   397  
   398  	var r0 store.StoreChannel
   399  	if rf, ok := ret.Get(0).(func(int64, int64) store.StoreChannel); ok {
   400  		r0 = rf(endTime, limit)
   401  	} else {
   402  		if ret.Get(0) != nil {
   403  			r0 = ret.Get(0).(store.StoreChannel)
   404  		}
   405  	}
   406  
   407  	return r0
   408  }
   409  
   410  // PermanentDeleteByChannel provides a mock function with given fields: channelId
   411  func (_m *PostStore) PermanentDeleteByChannel(channelId string) store.StoreChannel {
   412  	ret := _m.Called(channelId)
   413  
   414  	var r0 store.StoreChannel
   415  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
   416  		r0 = rf(channelId)
   417  	} else {
   418  		if ret.Get(0) != nil {
   419  			r0 = ret.Get(0).(store.StoreChannel)
   420  		}
   421  	}
   422  
   423  	return r0
   424  }
   425  
   426  // PermanentDeleteByUser provides a mock function with given fields: userId
   427  func (_m *PostStore) PermanentDeleteByUser(userId string) store.StoreChannel {
   428  	ret := _m.Called(userId)
   429  
   430  	var r0 store.StoreChannel
   431  	if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
   432  		r0 = rf(userId)
   433  	} else {
   434  		if ret.Get(0) != nil {
   435  			r0 = ret.Get(0).(store.StoreChannel)
   436  		}
   437  	}
   438  
   439  	return r0
   440  }
   441  
   442  // Save provides a mock function with given fields: post
   443  func (_m *PostStore) Save(post *model.Post) store.StoreChannel {
   444  	ret := _m.Called(post)
   445  
   446  	var r0 store.StoreChannel
   447  	if rf, ok := ret.Get(0).(func(*model.Post) store.StoreChannel); ok {
   448  		r0 = rf(post)
   449  	} else {
   450  		if ret.Get(0) != nil {
   451  			r0 = ret.Get(0).(store.StoreChannel)
   452  		}
   453  	}
   454  
   455  	return r0
   456  }
   457  
   458  // Search provides a mock function with given fields: teamId, userId, params
   459  func (_m *PostStore) Search(teamId string, userId string, params *model.SearchParams) store.StoreChannel {
   460  	ret := _m.Called(teamId, userId, params)
   461  
   462  	var r0 store.StoreChannel
   463  	if rf, ok := ret.Get(0).(func(string, string, *model.SearchParams) store.StoreChannel); ok {
   464  		r0 = rf(teamId, userId, params)
   465  	} else {
   466  		if ret.Get(0) != nil {
   467  			r0 = ret.Get(0).(store.StoreChannel)
   468  		}
   469  	}
   470  
   471  	return r0
   472  }
   473  
   474  // Update provides a mock function with given fields: newPost, oldPost
   475  func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) store.StoreChannel {
   476  	ret := _m.Called(newPost, oldPost)
   477  
   478  	var r0 store.StoreChannel
   479  	if rf, ok := ret.Get(0).(func(*model.Post, *model.Post) store.StoreChannel); ok {
   480  		r0 = rf(newPost, oldPost)
   481  	} else {
   482  		if ret.Get(0) != nil {
   483  			r0 = ret.Get(0).(store.StoreChannel)
   484  		}
   485  	}
   486  
   487  	return r0
   488  }