Class JsonContent
java.lang.Object
org.springframework.test.json.JsonContent
- All Implemented Interfaces:
org.assertj.core.api.AssertProvider<JsonContentAssert>
public final class JsonContent
extends Object
implements org.assertj.core.api.AssertProvider<JsonContentAssert>
- Since:
- 6.2
- Author:
- Phillip Webb, Diego Berrueta
-
Constructor Summary
ConstructorsConstructorDescriptionJsonContent(String json) Create a newJsonContentinstance.JsonContent(String json, @Nullable HttpMessageContentConverter converter) Deprecated, for removal: This API element is subject to removal in a future version.JsonContent(String json, @Nullable JsonConverterDelegate converterDelegate) Create a newJsonContentinstance with the message converter to use to deserialize content. -
Method Summary
Modifier and TypeMethodDescriptionUse AssertJ'sassertThatinstead.getJson()Return the actual JSON content string.Return theJsonConverterDelegateto use to decode JSON content.toString()
-
Constructor Details
-
JsonContent
Create a newJsonContentinstance with the message converter to use to deserialize content.- Parameters:
json- the actual JSON contentconverterDelegate- the content converter to use
-
JsonContent
@Deprecated(since="7.0", forRemoval=true) public JsonContent(String json, @Nullable HttpMessageContentConverter converter) Deprecated, for removal: This API element is subject to removal in a future version.in favour ofJsonContent(String, JsonConverterDelegate)Create a newJsonContentinstance with the message converter to use to deserialize content.- Parameters:
json- the actual JSON contentconverter- the content converter to use
-
JsonContent
Create a newJsonContentinstance.- Parameters:
json- the actual JSON content
-
-
Method Details
-
assertThat
Use AssertJ'sassertThatinstead.- Specified by:
assertThatin interfaceorg.assertj.core.api.AssertProvider<JsonContentAssert>
-
getJson
Return the actual JSON content string. -
getJsonConverterDelegate
Return theJsonConverterDelegateto use to decode JSON content.- Since:
- 7.0
-
toString
-
JsonContent(String, JsonConverterDelegate)