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:
AssertProvider<JsonContentAssert>

public final class JsonContent<T> extends Object implements 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 Details

    • JsonContent

      public JsonContent(Class<?> resourceLoadClass, @Nullable ResolvableType type, String json)
      Create a new JsonContent instance.
      Parameters:
      resourceLoadClass - the source class used to load resources
      type - the type under test (or null if not known)
      json - the actual JSON content
  • Method Details