Test The Controller With @WebMvcTest
Let’s learn to test the controller layer by using Spring Framework's @WebMvcTest annotation.
We can use the @WebMvcTest
annotation to test the controller layer, in a similar way to how we used @DataJpaTest
for JPA tests.
Get hands-on with 1300+ tech skills courses.