Skip to content

Commit 0f9070b

Browse files
committed
Constants added
1 parent e83d6c8 commit 0f9070b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/test/scala/com/sfxcode/nosql/mongo/sync/SyncSpec.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import org.specs2.specification.{AfterAll, BeforeAll}
88

99
class SyncSpec extends Specification with BeforeAll with AfterAll {
1010

11+
val CountSmall = 5
12+
val CountMedium = 500
13+
1114
sequential
1215

1316
override def beforeAll(): Unit =
@@ -23,7 +26,7 @@ class SyncSpec extends Specification with BeforeAll with AfterAll {
2326
"be synced from source to target" in {
2427
var result: MongoSyncResult = TestSync.mongoSyncer.sync(TestCollectionSourceTargetName).head
2528
result.acknowleged must beTrue
26-
TestSync.insertIntoSource(500, TestCollectionSourceTargetName)
29+
TestSync.insertIntoSource(CountMedium, TestCollectionSourceTargetName)
2730
result = TestSync.mongoSyncer.sync(TestCollectionSourceTargetName).head
2831
result.acknowleged must beTrue
2932
result.synced mustEqual 500
@@ -35,15 +38,15 @@ class SyncSpec extends Specification with BeforeAll with AfterAll {
3538
result.countBefore mustEqual 500
3639
result.synced mustEqual 0
3740

38-
TestSync.insertIntoSource(5, TestCollectionSourceTargetName)
41+
TestSync.insertIntoSource(CountSmall, TestCollectionSourceTargetName)
3942
result = TestSync.mongoSyncer.sync(TestCollectionSourceTargetName).head
4043
result.acknowleged must beTrue
4144
result.countBefore mustEqual 500
4245
result.countAfter mustEqual 505
4346
result.synced mustEqual 5
4447
TestSync.targetCount(TestCollectionSourceTargetName) mustEqual 505
4548

46-
TestSync.insertIntoTarget(5, TestCollectionSourceTargetName)
49+
TestSync.insertIntoTarget(CountSmall, TestCollectionSourceTargetName)
4750
TestSync.targetCount(TestCollectionSourceTargetName) mustEqual 510
4851
val resultList = TestSync.mongoSyncer.sync(TestCollectionSourceTargetName)
4952
result = resultList.head
@@ -56,7 +59,7 @@ class SyncSpec extends Specification with BeforeAll with AfterAll {
5659
"be synced two way" in {
5760
var result: MongoSyncResult = TestSync.mongoSyncer.sync(TestCollectionTwoWayName).head
5861
result.acknowleged must beTrue
59-
TestSync.insertIntoSource(500, TestCollectionTwoWayName)
62+
TestSync.insertIntoSource(CountMedium, TestCollectionTwoWayName)
6063
result = TestSync.mongoSyncer.sync(TestCollectionTwoWayName).head
6164
result.acknowleged must beTrue
6265
result.synced mustEqual 500
@@ -68,15 +71,15 @@ class SyncSpec extends Specification with BeforeAll with AfterAll {
6871
result.countBefore mustEqual 500
6972
result.synced mustEqual 0
7073

71-
TestSync.insertIntoSource(5, TestCollectionTwoWayName)
74+
TestSync.insertIntoSource(CountSmall, TestCollectionTwoWayName)
7275
result = TestSync.mongoSyncer.sync(TestCollectionTwoWayName).head
7376
result.acknowleged must beTrue
7477
result.countBefore mustEqual 500
7578
result.countAfter mustEqual 505
7679
result.synced mustEqual 5
7780
TestSync.targetCount(TestCollectionTwoWayName) mustEqual 505
7881

79-
TestSync.insertIntoTarget(5, TestCollectionTwoWayName)
82+
TestSync.insertIntoTarget(CountSmall, TestCollectionTwoWayName)
8083
TestSync.targetCount(TestCollectionTwoWayName) mustEqual 510
8184
val resultList = TestSync.mongoSyncer.sync(TestCollectionTwoWayName)
8285
result = resultList.head

0 commit comments

Comments
 (0)