}
@Test
public void viewPerson_ShouldAddAttributeForUser() {
//creating a mock user
final User user = new User();
final ModelMap model = new ModelMap();
final int modelSize = 3;
final String username="Canonical";
user.setUsername(username);
user.setEntityId(USER_ID);
String userProfile = new String(ModelKeys.USER_PROFILE);
Page personProfile = new Page();
PageLayout pageLayout = new PageLayout();
pageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
personProfile.setPageLayout(pageLayout);
expect(userService.getUserByUsername(username)).andReturn(user).once();
expect(pageService.getPersonProfilePage(user.getEntityId())).andReturn(personProfile);
replay(userService, pageService);
String view = profileController.viewProfile(username, model, null);