Class JsonContent<T>
java.lang.Object
org.springframework.boot.test.json.JsonContent<T>
- Type Parameters:
T
- the source type that created the content
- All Implemented Interfaces:
org.assertj.core.api.AssertProvider<JsonContentAssert>
public final class JsonContent<T>
extends Object
implements org.assertj.core.api.AssertProvider<JsonContentAssert>
JSON content usually created from a JSON tester. Generally used only to
provide
JsonContentAssert
to AssertJ assertThat
calls.- Since:
- 1.4.0
- Author:
- Phillip Webb, Diego Berrueta
-
Constructor Summary
ConstructorDescriptionJsonContent
(Class<?> resourceLoadClass, ResolvableType type, String json) Create a newJsonContent
instance. -
Method Summary
-
Constructor Details
-
JsonContent
Create a newJsonContent
instance.- Parameters:
resourceLoadClass
- the source class used to load resourcestype
- the type under test (ornull
if not known)json
- the actual JSON content
-
-
Method Details
-
assertThat
Deprecated.to prevent accidental use. Prefer standard AssertJassertThat(context)...
calls instead.Use AssertJ'sassertThat
instead.- Specified by:
assertThat
in interfaceorg.assertj.core.api.AssertProvider<T>
-
getJson
Return the actual JSON content string.- Returns:
- the JSON content
-
toString
-