Skip to content

Commit

Permalink
Update UnsortedMapDeserializerTest.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Dec 27, 2020
1 parent 199bcea commit d8a81e9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import scala.collection._

case class JavaMapWrapper(m: java.util.HashMap[String, String])
case class MapWrapper(m: Map[String, String])
object StringMapTypeReference extends TypeReference[Map[String, String]]

@RunWith(classOf[JUnitRunner])
class UnsortedMapDeserializerTest extends DeserializerTest {
Expand All @@ -25,6 +26,11 @@ class UnsortedMapDeserializerTest extends DeserializerTest {
result should equal (mapScala)
}

it should "deserialize an object into a Map (TypeReference not declared as anonymous class)" in {
val result = deserialize(mapJson, StringMapTypeReference)
result should equal (mapScala)
}

it should "deserialize an object into an immutable Map" in {
val typeRef = new TypeReference[immutable.Map[String, String]] {}
val result = deserialize(mapJson, typeRef)
Expand Down

0 comments on commit d8a81e9

Please sign in to comment.