Moholy is a library of Hamcrest matchers for Spring MVC. It assists developers to code beautiful tests. And of course it is free and open source.
Here are some code snippets for Moholy matchers.
- assertThat(modelAndView, hasView());
- assertThat(modelAndView, hasViewName("theViewName"));
- assertThat(modelAndView, hasModelAttribute("theAttributeName"));
- assertThat(modelAndView, hasModelAttributeWithNameAndValue("theAttributeName", "theAttributeValue"));