title: MockMvc the Model is Null
body: <p>I'm testing a controller using JUnit and MocMvc as bellow :
  the test fails because the model is null, but when I debug, I'm sure that the model attributes contain the right value 
  Controller :</p>
  
  <pre><code>@RequestMapping("/login/role")
  public String roleSelection(Model model, HttpServletRequest request, HttpSession session) {
  String name= request.getParameter("Name");        
  model.addAttribute("organization", name);
  // some code to generate url 
  return  "redirect:"+url;  
  } 
  </code></pre>
  
  <p>JUnit :</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest(webEnvironment = WebEnvironment.MOCK)
  @ContextConfiguration  
  @WebAppConfiguration
  public class YXControllerTest {
  
   @Autowired
   private WebApplicationContext context;
  
   @Autowired
   private MockHttpServletRequest request;
  
   @Autowired
   private MockHttpSession session;
  
  private MockMvc mvc;
  @Before
  public void setUp() throws Exception {
       MockitoAnnotations.initMocks(this);
       mvc = MockMvcBuilders.webAppContextSetup(context)
                .apply(springSecurity())
                .build()  }
   @Test
  @WithMockUser(value="admin@bbc.com",password = "pasword")
  
  public void givenAuthRequestOnPrivateService() throws Exception {
  
       List&lt;String&gt; authorityList = new ArrayList&lt;String&gt;();
       authorityList.add("USER");
       Map&lt;String, List&lt;String&gt;&gt; roleMap = new HashMap();
       roleMap.put("ROL", authorityList);
  
       this. mvc.perform(get("/login/role").param("Name", "ROL") ).andDo(print())
      .andExpect(status().is3xxRedirection())
      .andExpect(view().name("redirect:/itera/clients"))
      .andExpect( model().attribute("organization", hasSize(1)));
     ...
     }
  </code></pre>
  
  <p>the Print() Show;</p>
  
  <pre><code>  ModelAndView:
      View name = redirect:/itera/clients
           View = null
          Model = null
  </code></pre>
  
  <p>any help is welcomed </p>