Closed vincent-paing closed 1 year ago
When checking for nested object even though the return type is an object, the assertion fails as follows:
java.lang.AssertionError: textStyle Expected: a JSON object got: {"textSize":12,"isBold":true}
A minimal reproducible code is as belows:
val expectedJson = """ { "type": "text", "text": "Some Text", "textStyle": { "textSize": 12, "isBold": true } } """.trimIndent() val actual = "{\"type\":\"text\",\"text\":\"Some Text\",\"textStyle\":\"{\\\"textSize\\\":12,\\\"isBold\\\":true}\"}" JSONAssert.assertEquals(expectedJson, actual, false)
My bad, it seems like my code is parsing it as string instead of object. closing this and apologies.
When checking for nested object even though the return type is an object, the assertion fails as follows:
A minimal reproducible code is as belows: