org.springframework.boot.test.json

Class 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 created usually from a JSON tester. Generally used only to provide JsonContentAssert to AssertJ assertThat calls.
    Since:
    1.4.0
    Author:
    Phillip Webb
    • Constructor Detail

      • JsonContent

        public JsonContent(Class<?> resourceLoadClass,
                           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 Detail

      • assertThat

        @Deprecated
        public JsonContentAssert assertThat()
        Deprecated. in favor of AssertJ's assertThat
        Use AssertJ's assertThat instead.
        Specified by:
        assertThat in interface org.assertj.core.api.AssertProvider<JsonContentAssert>
      • getJson

        public String getJson()
        Return the actual JSON content string.
        Returns:
        the JSON content