Skip to content

Commit

Permalink
Added test for 23 problem
Browse files Browse the repository at this point in the history
  • Loading branch information
tototoshi committed Mar 29, 2018
1 parent e048b51 commit 0382c14
Showing 1 changed file with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ import play.api.libs.json.{Json, JsonConfiguration, JsonNaming}

case class Person(firstName: String, lastName: String, friends: List[Person])

case class TwentyThree(
field1: Int,
field2: Int,
field3: Int,
field4: Int,
field5: Int,
field6: Int,
field7: Int,
field8: Int,
field9: Int,
field10: Int,
field11: Int,
field12: Int,
field13: Int,
field14: Int,
field15: Int,
field16: Int,
field17: Int,
field18: Int,
field19: Int,
field20: Int,
field21: Int,
field22: Int,
field23: Int
)

class GenericTest extends FunSuite with Matchers {

import com.github.tototoshi.play.json.generic._
Expand Down Expand Up @@ -70,4 +96,38 @@ class GenericTest extends FunSuite with Matchers {
Json.parse(json).as[Person] should be(people)
}

test("23") {
val o = TwentyThree(
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
)
val json = """{
| "field1" : 1,
| "field2" : 1,
| "field3" : 1,
| "field4" : 1,
| "field5" : 1,
| "field6" : 1,
| "field7" : 1,
| "field8" : 1,
| "field9" : 1,
| "field10" : 1,
| "field11" : 1,
| "field12" : 1,
| "field13" : 1,
| "field14" : 1,
| "field15" : 1,
| "field16" : 1,
| "field17" : 1,
| "field18" : 1,
| "field19" : 1,
| "field20" : 1,
| "field21" : 1,
| "field22" : 1,
| "field23" : 1
|}""".stripMargin

Json.prettyPrint(Json.toJson(o)) should be(json)
Json.parse(json).as[TwentyThree] should be(o)
}

}

0 comments on commit 0382c14

Please sign in to comment.