BasicJsonTester
AssertJ based JSON tester that works with basic JSON strings. Allows testing of JSON payloads created from any source, for example:
public class ExampleObjectJsonTests {
private BasicJsonTester json = new BasicJsonTester(getClass());
@Test
public void testWriteJson() throws IOException {
assertThat(json.from("example.json")).extractingJsonPathStringValue("@.name")
.isEqualTo("Spring");
}
}
Content copied to clipboard
Author
Phillip Webb
Andy Wilkinson
Since
1.4.0
Constructors
Link copied to clipboard
Create a new BasicJsonTester instance that will load resources as UTF-8.
Create a new BasicJsonTester instance.
Functions
Link copied to clipboard
Create JSON content from the specified JSON bytes.
Create JSON content from the specified JSON file.
Create JSON content from the specified JSON input stream.
Create JSON content from the specified String source.
Create JSON content from the specified JSON resource.
Create JSON content from the specified resource path.