Skip to content

Commit

Permalink
Revert "move test"
Browse files Browse the repository at this point in the history
This reverts commit 3285775.
  • Loading branch information
pjfanning committed Jul 23, 2024
1 parent 3285775 commit 1bcccd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
package tools.jackson.module.scala.deser

import tools.jackson.module.scala.DefaultScalaModule
import tools.jackson.module.scala.{DefaultScalaModule, Weekday}

// see EnumerationDeserializerTest for tests that also pass in Scala3
class EnumerationScala2DeserializerTest extends DeserializerTest {
import tools.jackson.module.scala.deser.EnumerationDeserializerTest._

lazy val module: DefaultScalaModule.type = DefaultScalaModule

it should "locate the annotation on BeanProperty fields" in {
val weekdayMapJson = """{"weekdayMap":{"Mon":"Boo","Fri":"Hooray!"}}"""
val result = deserialize(weekdayMapJson, classOf[HolderImpl])
result.weekdayMap should contain key Weekday.Mon
}

//TODO fix test (works in v2.18.0)
it should "deserialize a set of weekdays" ignore {
val container = new EnumSetContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object EnumerationDeserializerTest {

// see EnumerationScala2DeserializerTest for tests that only work in Scala2
class EnumerationDeserializerTest extends DeserializerTest {
import EnumerationDeserializerTest._

lazy val module: DefaultScalaModule.type = DefaultScalaModule

"An ObjectMapper with EnumDeserializerModule" should "deserialize a value into a scala Enumeration as a bean property" in {
Expand Down Expand Up @@ -69,12 +69,6 @@ class EnumerationDeserializerTest extends DeserializerTest {
result.weekday shouldBe Some(Weekday.Fri)
}

it should "locate the annotation on BeanProperty fields" in {
val weekdayMapJson = """{"weekdayMap":{"Mon":"Boo","Fri":"Hooray!"}}"""
val result = deserialize(weekdayMapJson, classOf[HolderImpl])
result.weekdayMap should contain key Weekday.Mon
}

val fridayEnumJson = """{"day": {"enumClass":"tools.jackson.module.scala.Weekday","value":"Fri"}}"""

val fridayInnerEnumJson = """{"day": {"enumClass":"tools.jackson.module.scala.OuterWeekday$InnerWeekday","value":"Fri"}}"""
Expand Down

0 comments on commit 1bcccd6

Please sign in to comment.