Creating Web Service Controller Unit Tests with Mockito and Spring Boot

preview_player
Показать описание

This video is part of the Spring Boot Fundamentals series. In this video, we build upon the Greeting web services project, enhancing the unit test class hierarchy for web service controller components to use the Mockito library for mocks and assertions.

Note: Within this video, a class named BaseController is referenced when updating the AbstractControllerTest class. If you are watching the Spring Boot Fundamentals series in sequence, the BaseController class has not been introduced. Please see the GitHub repository for this episode; create the BaseController class illustrated in the repository; and update the GreetingController class to extend BaseController.
Рекомендации по теме
Комментарии
Автор

why does @componentScan on a given used in TestConfig doesn't register the components into SpringApplicationContext.

ReluctantSpirit
Автор

So if we create GreeatingsControllerMockTest we still need to create GreeatingsControllerTest ? seems that contollerTest is included in controllerMockTest

ovidiuhozan
Автор

I'm confused, why is AbstractControllerTest.setUp accepting BaseController instead of GreetingController? Which Episode was the BaseController created?

ronalansing