Use MockMvc to Test a Spring MVC Thymeleaf View @Controller Endpoint

preview_player
Показать описание
This is the third video of the MockMvc mini-series. It covers testing a @Controller endpoint that returns a Thymleaf view.


Content:

0:00 Introduction to the DashboardController
1:04 Test setup for the @Controller
2:29 MockMvc result expectations for the status, model, and view
4:45 Detailed Console output on failure

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

Exactly what I was looking for, thank you so much! Saved me probably a good hour of documentation reading.

HeyHoLetsGo
Автор

Thank you! This video helped me a lot!

marcelseichibarbosayamamot
Автор

Thank you for the tuto, but how to do in case of Post mapping with an object sent by a form? I tried but i retrieved a null object.
Thank your for reading me

mimLau
Автор

Hi thank you for the tutorial. Could you share source code with us? Please!

yelamaan
Автор

Cool, but if you don't static import your DSL static methods, then you
just add painful verbosity. You can recognize a need for a static import
when the name of the class does not add anything to the meaning of the
method name.

SirWolf