-
Notifications
You must be signed in to change notification settings - Fork 8
/
store_mock.go
55 lines (45 loc) · 1.31 KB
/
store_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package outbox
import (
"database/sql"
"time"
"github.com/stretchr/testify/mock"
)
// MockStore mocks the Store
type MockStore struct {
mock.Mock
}
// AddRecordTx method mock
func (m *MockStore) AddRecordTx(record Record, tx *sql.Tx) error {
args := m.Called(record, tx)
return args.Error(0)
}
// GetRecordsByLockID method mock
func (m *MockStore) GetRecordsByLockID(lockID string) ([]Record, error) {
args := m.Called(lockID)
return args.Get(0).([]Record), args.Error(1)
}
// UpdateRecordLockByState method mock
func (m *MockStore) UpdateRecordLockByState(lockID string, lockedOn time.Time, state RecordState) error {
args := m.Called(lockID, lockedOn, state)
return args.Error(0)
}
// UpdateRecordByID method mock
func (m *MockStore) UpdateRecordByID(message Record) error {
args := m.Called(message)
return args.Error(0)
}
// ClearLocksWithDurationBeforeDate method mock
func (m *MockStore) ClearLocksWithDurationBeforeDate(time time.Time) error {
args := m.Called(time)
return args.Error(0)
}
// ClearLocksByLockID method mock
func (m *MockStore) ClearLocksByLockID(lockID string) error {
args := m.Called(lockID)
return args.Error(0)
}
// RemoveRecordsBeforeDatetime method mock
func (m *MockStore) RemoveRecordsBeforeDatetime(expiryTime time.Time) error {
args := m.Called(expiryTime)
return args.Error(0)
}