Spring Boot + JUnit 5 + Mockito
In this article, we will show you how to do Spring Boot 2 integration test with JUnit 5, and also Mockito (Stack: Spring Boot 2.1.2.RELEASE, JUnit 5, Mockito 2, Maven…
cURL – Post JSON data to Spring REST
This article shows you how to use cURL command to POST JSON data to a Spring REST API.
cURL – POST request examples
Some cURL POST request examples for self reference: To POST without data, To POST with data, To POST with a file, add this -F file=@"path/to/data.txt" , To POST with JSON…
Spring REST Hello World Example
In this article, we will show you how to develop a Spring Boot REST style web service to handle CRUD operations from a H2 In-memory database.Technologies used :Spring Boot 2.1.2.RELEASE,…
Gson – Read and write JSON as a stream
Since Gson version 1.6, two new classes JsonReader and JsonWriter are introduced to provide streaming processing on JSON data. Read this Gson streaming documentation to understand what are the benefits…
Gson – How to convert Java object to / from JSON
In this tutorial, we will show you how to use Gson to convert Java object to / from JSON. The toJson() – Convert Java objects to JSON and fromJson() –…
Gson – How to enable pretty print JSON output
In this tutorial, we will show you how to enable JSON pretty print in Gson framework. By default, Gson compact-print the JSON output, To enable JSON pretty-print, create Gson object…
Jackson – How to enable pretty print JSON output
In Jackson, we can use writerWithDefaultPrettyPrinter() to pretty print the JSON output. Tested with Jackson 2.9.8 1. Pretty Print JSON 1.1 By default, Jackson print in compact format: Output 1.2…