1
- package shutterservice
1
+ package shutterservice_test
2
2
3
3
import (
4
4
"context"
@@ -7,12 +7,13 @@ import (
7
7
8
8
"gotest.tools/assert"
9
9
10
+ "github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice"
10
11
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
11
12
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/service"
12
13
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/testsetup"
13
14
)
14
15
15
- func TestSyncMonitor_ThrowsErrorWhenBlockNotIncreasing (t * testing.T ) {
16
+ func TestAPISyncMonitor_ThrowsErrorWhenBlockNotIncreasing (t * testing.T ) {
16
17
ctx , cancel := context .WithCancel (context .Background ())
17
18
defer cancel ()
18
19
@@ -30,7 +31,7 @@ func TestSyncMonitor_ThrowsErrorWhenBlockNotIncreasing(t *testing.T) {
30
31
t .Fatalf ("failed to set initial synced data: %v" , err )
31
32
}
32
33
33
- monitor := & SyncMonitor {
34
+ monitor := & shutterservice. SyncMonitor {
34
35
DBPool : dbpool ,
35
36
CheckInterval : 5 * time .Second ,
36
37
}
@@ -54,7 +55,7 @@ func TestSyncMonitor_ThrowsErrorWhenBlockNotIncreasing(t *testing.T) {
54
55
}
55
56
}
56
57
57
- func TestSyncMonitor_HandlesBlockNumberIncreasing (t * testing.T ) {
58
+ func TestAPISyncMonitor_HandlesBlockNumberIncreasing (t * testing.T ) {
58
59
ctx , cancel := context .WithCancel (context .Background ())
59
60
defer cancel ()
60
61
@@ -71,7 +72,7 @@ func TestSyncMonitor_HandlesBlockNumberIncreasing(t *testing.T) {
71
72
t .Fatalf ("failed to set initial synced data: %v" , err )
72
73
}
73
74
74
- monitor := & SyncMonitor {
75
+ monitor := & shutterservice. SyncMonitor {
75
76
DBPool : dbpool ,
76
77
CheckInterval : 5 * time .Second ,
77
78
}
@@ -107,15 +108,15 @@ func TestSyncMonitor_HandlesBlockNumberIncreasing(t *testing.T) {
107
108
assert .Equal (t , initialBlockNumber + 5 , syncedData .BlockNumber , "block number should have been incremented correctly" )
108
109
}
109
110
110
- func TestSyncMonitor_ContinuesWhenNoRows (t * testing.T ) {
111
+ func TestAPISyncMonitor_ContinuesWhenNoRows (t * testing.T ) {
111
112
ctx , cancel := context .WithCancel (context .Background ())
112
113
defer cancel ()
113
114
114
115
dbpool , closeDB := testsetup .NewTestDBPool (ctx , t , database .Definition )
115
116
defer closeDB ()
116
117
_ = database .New (dbpool )
117
118
118
- monitor := & SyncMonitor {
119
+ monitor := & shutterservice. SyncMonitor {
119
120
DBPool : dbpool ,
120
121
CheckInterval : 5 * time .Second ,
121
122
}
0 commit comments