Skip to content

Commit

Permalink
Update CaseObjectDeserializerTest.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Dec 1, 2023
1 parent 5ab556f commit c11d0d1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class CaseObjectDeserializerTest extends DeserializerTest {
val original = TestObject
val json = mapper.writeValueAsString(original)
val deserialized = mapper.readValue(json, TestObject.getClass)
assert(deserialized == original)
assert(deserialized === original)
}

it should "deserialize Foo and not create a new instance" in {
val mapper = JsonMapper.builder().addModule(DefaultScalaModule).addModule(ScalaObjectDeserializerModule).build()
val original = Foo
val json = mapper.writeValueAsString(original)
val deserialized = mapper.readValue(json, Foo.getClass)
assert(deserialized == original)
assert(deserialized === original)
}

it should "deserialize Foo and not create a new instance (visibility settings)" in {
Expand All @@ -42,7 +42,7 @@ class CaseObjectDeserializerTest extends DeserializerTest {
val original = Foo
val json = mapper.writeValueAsString(original)
val deserialized = mapper.readValue(json, Foo.getClass)
assert(deserialized == original)
assert(deserialized === original)
}

"An ObjectMapper with ClassTagExtensions and DefaultScalaModule" should "deserialize a case object and not create a new instance" in {
Expand All @@ -52,7 +52,7 @@ class CaseObjectDeserializerTest extends DeserializerTest {
val original = TestObject
val json = mapper.writeValueAsString(original)
val deserialized = mapper.readValue[TestObject.type](json)
assert(deserialized == original)
assert(deserialized === original)
}

"An ObjectMapper without ScalaObjectDeserializerModule" should "deserialize a case object but create a new instance" in {
Expand Down

0 comments on commit c11d0d1

Please sign in to comment.