Skip to content

Commit

Permalink
Update AnyValDeserializerTest.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jul 22, 2024
1 parent 01f285a commit b7ce4a7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.fasterxml.jackson.module.scala.deser

import com.fasterxml.jackson.module.scala.{DefaultScalaModule, JacksonModule}

import scala.util.Properties.versionString

object AnyValDeserializerTest {
case class DoubleAnyVal(underlying: Double) extends AnyVal
case class DoubleAnyValHolder(value: DoubleAnyVal)
Expand Down Expand Up @@ -30,7 +32,9 @@ class AnyValDeserializerTest extends DeserializerTest {
val expected = BigIntAnyVal(42)
mapper.readValue("""{"underlying":42}""", classOf[BigIntAnyVal]) shouldEqual expected
mapper.readValue("""{"value":42}""", classOf[BigIntAnyValHolder]) shouldEqual BigIntAnyValHolder(expected)
//mapper.readValue("""{"value":{"underlying":42}}""", classOf[BigIntOptionAnyValHolder]) shouldEqual
//BigIntOptionAnyValHolder(Some(expected))
if (!versionString.startsWith("2.11")) {
mapper.readValue("""{"value":{"underlying":42}}""", classOf[BigIntOptionAnyValHolder]) shouldEqual
BigIntOptionAnyValHolder(Some(expected))
}
}
}

0 comments on commit b7ce4a7

Please sign in to comment.