Compare commits

...

2 Commits

Author SHA1 Message Date
jtaub f904f98b6a
Merge a2ed0a17b8 into 30db2e4fb5 2025-10-07 17:22:46 +03:00
jtaub a2ed0a17b8 Improve the deprecation experience 2025-09-25 10:28:56 -04:00
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
*/
@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) {
val compareMode = (if (strict) JsonCompareMode.STRICT else JsonCompareMode.LENIENT)
actions.andExpect(matchers.json(jsonContent, compareMode))