Commit 0d41765c authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fix bug for #181

parent 7bc76abb
......@@ -46,7 +46,7 @@ object ConfigUtils extends Logging {
map1(key) match {
case m1: Map[_, _] =>
map2(key) match {
case m2: Map[_, _] => newMap += (key -> mergeMaps(any2map(m1), any2map(m2)))
case m2: Map[_, _] => newMap += (key -> mergeMaps(any2map(m1), any2map(m2), resolveConflict))
case _ => newMap += (key -> map1(key))
}
case _ => newMap += (key -> resolveConflict(map1(key), map2(key), key))
......
......@@ -217,7 +217,7 @@ class ConfigUtilsTest extends TestNGSuite with Matchers {
@Test def testNestedMergeConflict: Unit = {
val map1 = Map("c" -> Map("x" -> "1"))
val map2 = Map("c" -> Map("x" -> "1"))
val map2 = Map("c" -> Map("x" -> "2"))
mergeMaps(map1, map2) shouldBe Map("c" -> Map("x" -> "1"))
mergeMaps(map1, map2, (a, b, k) => a.toString + b.toString) shouldBe Map("c" -> Map("x" -> "12"))
mergeMaps(map2, map1, (a, b, k) => a.toString + b.toString) shouldBe Map("c" -> Map("x" -> "21"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment