@Test
public void testIndex() throws Exception {

	AuthenticatedUser currentUser = mock(AuthenticatedUser.class);
	when(userContext.getCurrentUser()).thenReturn(currentUser);
	when(currentUser.getUsername()).thenReturn("username");
	
	Users users= mock(Users.class);
	when(usersRepository.loadUserByUsername("username")).thenReturn(users);
	Set<GrantedAuthority> auths=new HashSet<GrantedAuthority>();
	auths.add(new SimpleGrantedAuthority("ROLE_USER"));
	
	when(users.getAuthorities()).thenReturn(auths);
	
	mockMvc.perform(get("/index.html"))
		.andExpect(view().name("redirect:/patients/home.html"));
}