Testing the Controller in Isolation with @MockBean and MockMvc (Without DB)

Giovanni Pace

Description

Let's test the Controller in isolation with @MockBean and MockMvc — we'll simulate the Service behavior without a real database, focusing exclusively on the REST layer and the HTTP behavior of the Spring Boot Controller.