I have wrote this method:
@RequestMapping(value=\"/someURL\", method=GET)
public String myMethod(RedirectAttributes redirectAttributes)
{
redirectAttribut
You can use MockMvcResultMatchers#flash() which returns a FlashAttributeResultMatchers object which has an attribute() method.
mockMvc.perform(MockMvcRequestBuilders.get("/someURL"))
.andExpect(MockMvcResultMatchers.model().attribute("rd", "rdValue"))
.andExpect(MockMvcResultMatchers.flash().attribute("fa", someValueThatEqualsFaValue));
Note that "rd"
will be a Model
attribute, not a flash attribute.