Page personProfile = new PageImpl();
PageLayout pageLayout = new PageLayoutImpl();
pageLayout.setCode("person_profile");
personProfile.setPageLayout(pageLayout);
expect(userService.getUserByUsername(username)).andThrow(new UsernameNotFoundException("Username does not exist"));
replay(userService, pageService);
String view = profileController.viewProfileByUsername(username, model, null, response);
assertThat(view, is(ViewNames.USER_NOT_FOUND));