Test a Secured Endpoint with REST Assured and MockMvc

This is the second video of the REST Assured with Spring Boot testing mini-series. We’ll continue our testing efforts and write a REST Assured test for a Spring MVC REST API endpoint that is secured with Spring Security.


0:00 Inspect the protected endpoint
1:25 Test the outcome without authentication
4:07 Test the outcome without authorization
6:35 Writing the test for the happy-path
8:34 Declarative approach for setting the authenticated user

Part I: https://youtu.be/1rkoFTxJhNk
Part II: https://youtu.be/p96yKqWo_Ps
Part III: https://youtu.be/zEkI8xi3Mjs

The source code for this video is available on GitHub: https://github.com/rieckpil/blog-tutorials/tree/master/spring-boot-rest-assured

» Never worry about testing your Spring Boot application again: https://rieckpil.de/testing-spring-boot-applications-masterclass/

#rest #mockmvc #springboot

Test a Secured Endpoint with REST Assured and MockMvc