DEV Community

coder4life
coder4life

Posted on

Testing in Spring Boot with WebMvcTest and Mockito

Testing the web layer of Spring Boot API is pretty easy with the WebMvcTest annotation and Mockito to help with mocking. In this example we will test a GET endpoint for getting all employees from an employee API. We mock the employee service and check the returned JSON.

Top comments (0)