-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TreeSeqMap deserialization * try to fix tests
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/scala-2.13/tools/jackson/module/scala/deser/Map2DeserializerTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package tools.jackson.module.scala.deser | ||
|
||
import tools.jackson.core.`type`.TypeReference | ||
import tools.jackson.module.scala.{DefaultScalaModule, JacksonModule} | ||
|
||
import scala.collection.immutable | ||
|
||
class Map2DeserializerTest extends DeserializerTest { | ||
|
||
lazy val module: JacksonModule = DefaultScalaModule | ||
|
||
"An ObjectMapper with the SortedMapDeserializerModule" should "deserialize an object into an TreeSeqMap" in { | ||
val result = deserialize(mapJson, new TypeReference[immutable.TreeSeqMap[String,String]]{}) | ||
result should equal (mapScala) | ||
} | ||
|
||
private val mapJson = """{ "one": "1", "two": "2" }""" | ||
private val mapScala = collection.SortedMap("one"->"1","two"->"2") | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/scala-3/tools/jackson/module/scala/deser/Map2DeserializerTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package tools.jackson.module.scala.deser | ||
|
||
import tools.jackson.core.`type`.TypeReference | ||
import tools.jackson.module.scala.{DefaultScalaModule, JacksonModule} | ||
|
||
import scala.collection.immutable | ||
|
||
class Map2DeserializerTest extends DeserializerTest { | ||
|
||
lazy val module: JacksonModule = DefaultScalaModule | ||
|
||
"An ObjectMapper with the SortedMapDeserializerModule" should "deserialize an object into an TreeSeqMap" in { | ||
val result = deserialize(mapJson, new TypeReference[immutable.TreeSeqMap[String,String]]{}) | ||
result should equal (mapScala) | ||
} | ||
|
||
private val mapJson = """{ "one": "1", "two": "2" }""" | ||
private val mapScala = collection.SortedMap("one"->"1","two"->"2") | ||
} |