我有以下失败(0 不等于 3),我不知道为什么。有什么想法吗?
class Temp extends MyCirceExtendingClass {
def temp(json: Json) = {
root.otherNames.each.otherName.string.getAll(json)
}
}
val json = Json.fromString(
s"""
|{
| id: 1,
| name: "Robert",
| isEmployee: false,
| otherNames: [
| {
| id: 1,
| otherName: "Rob"
| },
| {
| id: 2,
| otherName: "Bob"
| },
| {
| id: 3,
| otherName: "Robby"
| }
|
| ]
|}
""".stripMargin)
val response = new Temp().temp(json)
response.size shouldEqual 3