Example on how to Unit Test RESTful Web Services using Spring Boot Test framework and JUnit 5. It uses MockMvc to provide Spring MVC infrastructure without starting the HTTP Server. SpringExtension and @WebMvcTest provide rest of the environment for unit testing.
Refer Spring Boot 2 + JUnit 5 REST API Unit Testing for detailed article.
- Java 10
- Spring Boot 2.0.3.RELEASE
- Junit 5
- Database: HSQLDB
- IDE: Eclipse Photon / IntelliJ IDEA 2018.1.5