@@ -7,31 +7,37 @@ import org.junit.Assert.*
77class ObjectsSyncTrackerTest {
88
99 @Test
10- fun `should parse valid sync channel serial with syncId and cursor` () {
10+ fun `(RTO5a, RTO5a1, RTO5a2) Should parse valid sync channel serial with syncId and cursor` () {
1111 val syncTracker = ObjectsSyncTracker (" sync-123:cursor-456" )
1212
1313 assertEquals(" sync-123" , syncTracker.syncId)
1414 assertFalse(syncTracker.hasSyncStarted(" sync-123" ))
15-
1615 assertTrue(syncTracker.hasSyncStarted(null ))
1716 assertTrue(syncTracker.hasSyncStarted(" sync-124" ))
1817
18+ assertEquals(" cursor-456" , syncTracker.syncCursor)
1919 assertFalse(syncTracker.hasSyncEnded())
2020 }
2121
2222 @Test
23- fun `should handle null sync channel serial` () {
23+ fun `(RTO5a5) Should handle null sync channel serial` () {
2424 val syncTracker = ObjectsSyncTracker (null )
2525
2626 assertNull(syncTracker.syncId)
27+ assertTrue(syncTracker.hasSyncStarted(null ))
28+
29+ assertNull(syncTracker.syncCursor)
2730 assertTrue(syncTracker.hasSyncEnded())
2831 }
2932
3033 @Test
31- fun `should handle empty sync channel serial` () {
34+ fun `(RTO5a5) Should handle empty sync channel serial` () {
3235 val syncTracker = ObjectsSyncTracker (" " )
3336
3437 assertNull(syncTracker.syncId)
38+ assertTrue(syncTracker.hasSyncStarted(null ))
39+
40+ assertNull(syncTracker.syncCursor)
3541 assertTrue(syncTracker.hasSyncEnded())
3642 }
3743
@@ -40,21 +46,20 @@ class ObjectsSyncTrackerTest {
4046 val syncTracker = ObjectsSyncTracker (" sync_123-456:cursor_789-012" )
4147
4248 assertEquals(" sync_123-456" , syncTracker.syncId)
43- assertFalse(syncTracker.hasSyncEnded())
44- }
4549
46- @Test
47- fun `should detect sync sequence ended when syncChannelSerial is null` () {
48- val syncTracker = ObjectsSyncTracker (null )
49-
50- assertTrue(syncTracker.hasSyncEnded())
50+ assertEquals(" cursor_789-012" , syncTracker.syncCursor)
51+ assertFalse(syncTracker.hasSyncEnded())
5152 }
5253
5354 @Test
54- fun `should detect sync sequence ended when sync cursor is empty` () {
55+ fun `(RTO5a4) should detect sync sequence ended when sync cursor is empty` () {
5556 val syncTracker = ObjectsSyncTracker (" sync-123:" )
57+
58+ assertEquals(" sync-123" , syncTracker.syncId)
5659 assertTrue(syncTracker.hasSyncStarted(null ))
5760 assertTrue(syncTracker.hasSyncStarted(" " ))
61+
62+ assertEquals(" " , syncTracker.syncCursor)
5863 assertTrue(syncTracker.hasSyncEnded())
5964 }
6065}
0 commit comments