This commit is contained in:
jtaub 2025-10-07 23:10:36 +03:00 committed by GitHub
commit d2f0a03c23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,13 @@ class ContentResultMatchersDsl internal constructor (private val actions: Result
/** /**
* @see ContentResultMatchers.json * @see ContentResultMatchers.json
*/ */
@Deprecated(message = "Use JsonCompare mode instead") @Deprecated(
message = "Use JsonCompare mode instead",
replaceWith = ReplaceWith(
expression = "json(jsonContent, if (strict) JsonCompareMode.STRICT else JsonCompareMode.LENIENT)",
imports = ["org.springframework.test.json.JsonCompareMode"],
),
)
fun json(jsonContent: String, strict: Boolean) { fun json(jsonContent: String, strict: Boolean) {
val compareMode = (if (strict) JsonCompareMode.STRICT else JsonCompareMode.LENIENT) val compareMode = (if (strict) JsonCompareMode.STRICT else JsonCompareMode.LENIENT)
actions.andExpect(matchers.json(jsonContent, compareMode)) actions.andExpect(matchers.json(jsonContent, compareMode))