}
@Test
public void updateProfile_ShouldUpdateAuthenticatedUser() {
//This test will just show the successful updation of user status
final ModelMap model = new ModelMap();
final int modelSize = 2;
final String referringPageId = "1";
final String USERNAME = "canonical";
String userProfile = new String(ModelKeys.USER_PROFILE);
//creating a mock authenticated user
final User authUser = new UserImpl();
authUser.setUsername(USERNAME);
//set existing status
authUser.setStatus("Single");
//set other paramters
authUser.setGivenName("Test");
authUser.setFamilyName("Rave");
authUser.setAboutMe("Test User");
authUser.setEmail("testuser@rave.com");
//creating a mock updated user
final UserForm updatedUser = new UserForm();
//set the updated status
updatedUser.setStatus("Married");
updatedUser.setGivenName("Test");
updatedUser.setFamilyName("Rave");
updatedUser.setAboutMe("Test User");
updatedUser.setEmail("testuser@rave.com");
expect(userService.getAuthenticatedUser()).andReturn(authUser).anyTimes();
userService.updateUserProfile(authUser);
replay(userService);
String view = profileController.updateProfile(model, referringPageId, updatedUser);
//assert that the model is not null
assertThat(model, CoreMatchers.notNullValue());
//assert that the model size is three
assertThat(model.size(), CoreMatchers.equalTo(modelSize));
//assert that the model does contain an attribute associated with the authenticated user
assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));
//assert that the model does not contain authenticated user as null
assertThat(model.get(userProfile), CoreMatchers.notNullValue());
//assert that the status of user is updated
assertEquals(updatedUser.getStatus(), authUser.getStatus());
assertThat(view, is("redirect:/app/person/" + USERNAME));