diff --git a/spring-test/src/main/kotlin/org/springframework/test/web/servlet/result/ContentResultMatchersDsl.kt b/spring-test/src/main/kotlin/org/springframework/test/web/servlet/result/ContentResultMatchersDsl.kt index d36d9c11cc..49f2ce5f37 100644 --- a/spring-test/src/main/kotlin/org/springframework/test/web/servlet/result/ContentResultMatchersDsl.kt +++ b/spring-test/src/main/kotlin/org/springframework/test/web/servlet/result/ContentResultMatchersDsl.kt @@ -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))