Skip to content

Commit bfce314

Browse files
author
Merlin Rabens
committed
Bring back MapDbSettings.Default from its ashes
1 parent 003dabd commit bfce314

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
package com.intenthq.action_processor.integrations.config
22

3-
import java.nio.file.Path
3+
import java.nio.file.{Path, Paths}
44

55
case class MapDbSettings(dbPath: Path, startDbSize: Long, incSize: Long, segments: Int, nodeSize: Int, levels: Int)
6+
7+
object MapDbSettings {
8+
9+
val Default: MapDbSettings = MapDbSettings(
10+
dbPath = Paths.get("/tmp"),
11+
startDbSize = 5L * 1024,
12+
incSize = 1L * 1024,
13+
segments = 16,
14+
nodeSize = 128,
15+
levels = 4
16+
)
17+
}

src/test/scala/com/intenthq/action_processor/integrations/CSVFeedSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object CSVFeedSpec extends IOSuite with CSVFeedSpecResources {
2929
).map(_ + '\n')
3030

3131
for {
32-
feedStreamLinesBytes <- resources.csvFeed.stream(Defaults.feedContext).compile.toList
32+
feedStreamLinesBytes <- resources.csvFeed.stream(TestDefaults.feedContext).compile.toList
3333
feedStreamLines = feedStreamLinesBytes.map(bytes => new String(bytes, StandardCharsets.UTF_8)).toSet
3434
} yield expect(feedStreamLines == expectedResult)
3535
}

src/test/scala/com/intenthq/action_processor/integrations/FeedAggregatedSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object FeedAggregatedSpec extends SimpleIOSuite {
2727
).map(_ + '\n')
2828

2929
for {
30-
feedStreamLinesBytes <- aggregatedFeed.stream(Defaults.feedContext).compile.toList
30+
feedStreamLinesBytes <- aggregatedFeed.stream(TestDefaults.feedContext).compile.toList
3131
feedStreamLines = feedStreamLinesBytes.map(bytes => new String(bytes, StandardCharsets.UTF_8)).toSet
3232
} yield expect(feedStreamLines == expectedResult)
3333
}

src/test/scala/com/intenthq/action_processor/integrations/SQLFeedSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object SQLFeedSpec extends IOSuite with SQLFeedSpecResources {
3838

3939
test("should return a stream of parsed ExampleFeedRow") { _ =>
4040
for {
41-
feedStreamLinesBytes <- ExampleCsvFeed.stream(Defaults.feedContext).compile.toList
41+
feedStreamLinesBytes <- ExampleCsvFeed.stream(TestDefaults.feedContext).compile.toList
4242
feedStreamLines = feedStreamLinesBytes.map(new String(_))
4343
expectedOutput = exampleRows.map(CsvSerialization.serialize[ExampleCsvFeedRow]).map(new String(_))
4444
} yield expect(feedStreamLines == expectedOutput)

src/test/scala/com/intenthq/action_processor/integrations/Defaults.scala renamed to src/test/scala/com/intenthq/action_processor/integrations/TestDefaults.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.nio.file.Paths
55
import com.intenthq.action_processor.integrations.config.MapDbSettings
66
import com.intenthq.action_processor.integrations.feeds.{FeedContext, FeedFilter}
77

8-
object Defaults {
8+
object TestDefaults {
99

1010
val mapDbSettings: MapDbSettings = MapDbSettings(
1111
dbPath = Paths.get("/tmp"),

0 commit comments

Comments
 (0)