In this tutorial i show you how to create Spring Boot Integration Tests in order to test REST API Controllers.
Java spring testing tutorial for beginners.
I first create a simple RESTFul Service.
We then implement Spring's WebIntegrationTest and MockMvc Builder to discover and host our web services (spring controllers) during the junit integration test.
Once the web services are created, we can invoke them locally using MockMvc.
We can then assert on the expected HTTP request with Spring and hamcrest matchers.
Return HTTP response if required.
If you enjoyed the video, please share, comment & subscribe for more great content!
Enjoy!
Philip
Spring MockMvc: http://docs.spring.io/spring/docs/cur...
Spring ResultActions: http://docs.spring.io/spring/docs/cur...
Spring Security MockMvc Test: http://docs.spring.io/spring-security...
Spring Boot Testing Features: http://docs.spring.io/spring-boot/doc...
Spring Boot, MockMvcBuilders, RESTController, WebApplicationContext, SpringApplicationConfiguration, SpringJUnit4ClassRunner, MockMvcRequestBuilders, MockMvcResultHandlers, MockMvcResultMatchers, Embedded Tomcat, Java, JUnit