Improve the deprecation experience
This commit is contained in:
parent
ba0de1edce
commit
a2ed0a17b8
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue