@BeforeEach
    void setup() {
        this.mockMvc = MockMvcBuilders.standaloneSetup(visitController).build();

        given(this.clinicService.findPetById(TEST_PET_ID)).willReturn(new Pet());
    }
Test class for {@link VisitController}

@author Colin But
src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java