-
Notifications
You must be signed in to change notification settings - Fork 351
/
graveler_mock.go
39 lines (32 loc) · 1.33 KB
/
graveler_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
package testutil
import (
"testing"
"github.com/golang/mock/gomock"
"github.com/treeverse/lakefs/pkg/graveler"
"github.com/treeverse/lakefs/pkg/graveler/mock"
kvmock "github.com/treeverse/lakefs/pkg/kv/mock"
)
type GravelerTest struct {
Controller *gomock.Controller
CommittedManager *mock.MockCommittedManager
RefManager *mock.MockRefManager
StagingManager *mock.MockStagingManager
ProtectedBranchesManager *mock.MockProtectedBranchesManager
GarbageCollectionManager *mock.MockGarbageCollectionManager
KVStore *kvmock.MockStore
Sut *graveler.Graveler
}
func InitGravelerTest(t *testing.T) *GravelerTest {
ctrl := gomock.NewController(t)
test := &GravelerTest{
Controller: ctrl,
CommittedManager: mock.NewMockCommittedManager(ctrl),
StagingManager: mock.NewMockStagingManager(ctrl),
RefManager: mock.NewMockRefManager(ctrl),
GarbageCollectionManager: mock.NewMockGarbageCollectionManager(ctrl),
ProtectedBranchesManager: mock.NewMockProtectedBranchesManager(ctrl),
KVStore: kvmock.NewMockStore(ctrl),
}
test.Sut = graveler.NewGraveler(test.CommittedManager, test.StagingManager, test.RefManager, test.GarbageCollectionManager, test.ProtectedBranchesManager)
return test
}