Spring Boot Unit Testing With Mockito - Controllers

preview_player
Показать описание
Spring Boot Unit Testing - Controllers

Рекомендации по теме
Комментарии
Автор

Thank you for all the work you put into your videos 🙏❤

franky
Автор

This isn't a unit test though. This is an implementation test, as you are acutally including API calls. A unit test would simply be testing the method on it's own, without using a restful API.
Ideally, one should have both unit and integration tests; after all, the unit test might pass as your method works as expected but your integration test might fail due to the path having changed - or an issue the other way around might arise.

DesertCookie
Автор

Hello! Thank you for video. Can you explain to me, why you use @MockBean instead of @Mock. Why we must to raise the Spring context in these tests ?

Andrei-scmo
Автор

does not recognize method content after contenttype and says i need requestbuilder before post? what do i do?

Sucheit
Автор

Hi I recently migrated to springboot 3.1.5. When I am modifying my existing test cases the way you have explained, I am getting Failed to load application context. Any suggestions?
Thanks

TheShantanu
Автор

Hi!

What if the controller has dependencias which depend on a service? How do I simulate that with Mockito?

Thanks!

Автор

Is this still a unit test ? even though you use @Autowired and load the spring context ? Or is it an integration test ?

choukri
Автор

Your video is cool but work on the video quality on monitor

uyo-obongakpan