@@ -32,17 +32,17 @@ class MergeTest extends DeserializerTest {
32
32
behavior of " The DefaultScalaModule when reading for updating"
33
33
34
34
it should " merge both lists" in {
35
- val typeReference = new TypeReference [ClassWithLists ] {}
36
- val initial = deserialize(classJson(firstListJson), typeReference )
37
- val result = updateValue(newMergeableScalaMapper, initial, typeReference , classJson(secondListJson))
35
+ val clazz = classOf [ClassWithLists ]
36
+ val initial = deserialize(classJson(firstListJson), clazz )
37
+ val result = updateValue(newMergeableScalaMapper, initial, clazz , classJson(secondListJson))
38
38
39
39
result shouldBe ClassWithLists (mergedList, mergedList)
40
40
}
41
41
42
42
it should " merge only the annotated list" in {
43
- val typeReference = new TypeReference [ClassWithLists ] {}
44
- val initial = deserialize(classJson(firstListJson), typeReference )
45
- val result = updateValue(newScalaMapper, initial, typeReference , classJson(secondListJson))
43
+ val clazz = classOf [ClassWithLists ]
44
+ val initial = deserialize(classJson(firstListJson), clazz )
45
+ val result = updateValue(newScalaMapper, initial, clazz , classJson(secondListJson))
46
46
47
47
result shouldBe ClassWithLists (secondList, mergedList)
48
48
}
@@ -117,8 +117,18 @@ class MergeTest extends DeserializerTest {
117
117
objectReaderFor(mapper, valueToUpdate, typeReference).readValue(src)
118
118
}
119
119
120
+ private def updateValue [T ](mapper : ObjectMapper , valueToUpdate : T ,
121
+ clazz : Class [T ], src : String ): T = {
122
+ objectReaderFor(mapper, valueToUpdate, clazz).readValue(src)
123
+ }
124
+
120
125
private def objectReaderFor [T ](mapper : ObjectMapper , valueToUpdate : T ,
121
126
typeReference : TypeReference [T ]): ObjectReader = {
122
127
mapper.readerForUpdating(valueToUpdate).forType(typeReference)
123
128
}
129
+
130
+ private def objectReaderFor [T ](mapper : ObjectMapper , valueToUpdate : T ,
131
+ clazz : Class [T ]): ObjectReader = {
132
+ mapper.readerForUpdating(valueToUpdate).forType(clazz)
133
+ }
124
134
}
0 commit comments