aboutsummaryrefslogtreecommitdiff
path: root/shared/src/test/scala/CoproductTypeFormatTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/test/scala/CoproductTypeFormatTests.scala')
-rw-r--r--shared/src/test/scala/CoproductTypeFormatTests.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/shared/src/test/scala/CoproductTypeFormatTests.scala b/shared/src/test/scala/CoproductTypeFormatTests.scala
index 7da2041..5e88856 100644
--- a/shared/src/test/scala/CoproductTypeFormatTests.scala
+++ b/shared/src/test/scala/CoproductTypeFormatTests.scala
@@ -18,33 +18,33 @@ class CoproductTypeFormatTests
"No-parameter case class child" should behave like checkRoundtrip[Expr](
Zero(),
- """{"type":"Zero"}"""
+ """{"@type":"Zero"}"""
)
"Simple parameter case class child" should behave like checkRoundtrip[Expr](
Value(42),
- """{"type":"Value","x":42}"""
+ """{"@type":"Value","x":42}"""
)
"Nested parameter case class child" should behave like checkRoundtrip[Expr](
Plus(Value(42), One),
- """{"type":"Plus","lhs":{"type":"Value","x":42},"rhs":{"type":"One"}}"""
+ """{"@type":"Plus","lhs":{"@type":"Value","x":42},"rhs":{"@type":"One"}}"""
)
"Case object child" should behave like checkRoundtrip[Expr](
One,
- """{"type": "One"}"""
+ """{"@type": "One"}"""
)
@adt("kind")
- sealed abstract class Keyword(`type`: String)
- case class If(`type`: String) extends Keyword(`type`)
+ sealed abstract class Keyword(`@type`: String)
+ case class If(`@type`: String) extends Keyword(`@type`)
implicit val keywordFormat: RootJsonFormat[Keyword] = jsonFormat[Keyword]
"ADT with type field alias" should behave like checkRoundtrip[Keyword](
If("class"),
- """{"kind":"If","type":"class"}"""
+ """{"kind":"If","@type":"class"}"""
)
@adt("""_`crazy type!`"""")
@@ -68,7 +68,7 @@ class CoproductTypeFormatTests
"Enum" should behave like checkRoundtrip[List[Enum]](
A :: B :: Nil,
- """[{"type":"A"}, {"type":"B"}]"""
+ """[{"@type":"A"}, {"@type":"B"}]"""
)
"Serializing as sealed trait and deserializing as child" should "work" in {