MM-19877: Remove references to PermanentDeleteBatch from audit store (#13393)
* MM-19877: Remove references to PermanentDeleteBatch from audit store
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
68e0b1fdc2
Коммит
e48d093d01
@@ -15,7 +15,6 @@ import (
|
||||
|
||||
func TestAuditStore(t *testing.T, ss store.Store) {
|
||||
t.Run("", func(t *testing.T) { testAuditStore(t, ss) })
|
||||
t.Run("PermanentDeleteBatch", func(t *testing.T) { testAuditStorePermanentDeleteBatch(t, ss) })
|
||||
}
|
||||
|
||||
func testAuditStore(t *testing.T, ss store.Store) {
|
||||
@@ -49,29 +48,3 @@ func testAuditStore(t *testing.T, ss store.Store) {
|
||||
|
||||
require.Nil(t, ss.Audit().PermanentDeleteByUser(audit.UserId))
|
||||
}
|
||||
|
||||
func testAuditStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
||||
a1 := &model.Audit{UserId: model.NewId(), IpAddress: "ipaddress", Action: "Action"}
|
||||
require.Nil(t, ss.Audit().Save(a1))
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
a2 := &model.Audit{UserId: a1.UserId, IpAddress: "ipaddress", Action: "Action"}
|
||||
require.Nil(t, ss.Audit().Save(a2))
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
cutoff := model.GetMillis()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
a3 := &model.Audit{UserId: a1.UserId, IpAddress: "ipaddress", Action: "Action"}
|
||||
require.Nil(t, ss.Audit().Save(a3))
|
||||
|
||||
audits, err := ss.Audit().Get(a1.UserId, 0, 100)
|
||||
require.Nil(t, err)
|
||||
assert.Len(t, audits, 3)
|
||||
|
||||
_, err = ss.Audit().PermanentDeleteBatch(cutoff, 1000000)
|
||||
require.Nil(t, err)
|
||||
|
||||
audits, err = ss.Audit().Get(a1.UserId, 0, 100)
|
||||
require.Nil(t, err)
|
||||
assert.Len(t, audits, 1)
|
||||
|
||||
require.Nil(t, ss.Audit().PermanentDeleteByUser(a1.UserId))
|
||||
}
|
||||
|
||||
@@ -39,29 +39,6 @@ func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits,
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteBatch provides a mock function with given fields: endTime, limit
|
||||
func (_m *AuditStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) {
|
||||
ret := _m.Called(endTime, limit)
|
||||
|
||||
var r0 int64
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) int64); ok {
|
||||
r0 = rf(endTime, limit)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int64, int64) *model.AppError); ok {
|
||||
r1 = rf(endTime, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PermanentDeleteByUser provides a mock function with given fields: userId
|
||||
func (_m *AuditStore) PermanentDeleteByUser(userId string) *model.AppError {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
Ссылка в новой задаче
Block a user