We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
https://github.com/sunabak0/realworld-kotlin-springboot-jdbc/blob/5c394e8d9e8ca7af9c863f623fba4108c31ad6e5/src/test/kotlin/com/example/realworldkotlinspringbootjdbc/api_integration/DefaultTest.kt#L51-L70
val actualStatus = response.status val actualResponseBody = response.contentAsString /** * then: * - ステータスコードが一致する * - レスポンスボディが一致する */ val expectedStatus = 200 val expectedResponseBody = """ { "tags": ["rust", "scala", "kotlin", "ocaml", "elixir"] } """.trimIndent() // ステータスコードが一致するかどうかのテスト Assertions.assertThat(actualStatus).isEqualTo(expectedStatus) // JSONとして合ってるかどうか比較テスト JSONAssert.assertEquals( expectedResponseBody, actualResponseBody, // 厳しさ具合(拡張禁止、順番は守らなくていい) CustomComparator(JSONCompareMode.NON_EXTENSIBLE) )
Kotlin(Spring Boot)の API テスト(MockMVC)で CustomComparator を用いて独自の比較方法を作成 > JSONCompareMode について
Sorry, something went wrong.
JSONAssert.assertEqualsで文字列一致ではなく、JSON一致で比較
例
{ "name": "john", "arr": [1,2,3,4] }
と
{"arr": [1,2,3,4], "name": "john"}
は同じ
使ったサイト
sunakan
kinari321
Msksgm
No branches or pull requests
前回の議事録
前回
前回から今回まで
決めたいこと・相談事項
今回やったことまとめ
今回 Merge した Pull Request
次(予定)
The text was updated successfully, but these errors were encountered: