@Test(expected = NullPointerException.class) public void testThrowsNullPointerExceptionOnNullServletRequestOnGetProfileFname() { stickyMapper.getProfileFname(person, null); }
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userName, "Cannot get profile fname for a null username."); try { return this.profileSelectionRegistry.profileSelectionForUser(userName); } catch (Exception e) { logger.error( "Failed to read persisted profile selection for user " + userName + " if any. Ignoring.", e); } return null; }
StickyProfileMapperImpl implements IProfileMapper, ApplicationListener<ProfileSelectionEvent> { @Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userName, "Cannot get profile fname for a null username."); try { return this.profileSelectionRegistry.profileSelectionForUser(userName); } catch (Exception e) { logger.error( "Failed to read persisted profile selection for user " + userName + " if any. Ignoring.", e); } return null; } }
StickyProfileMapperImpl implements IProfileMapper, ApplicationListener<ProfileSelectionEvent> { @Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userName, "Cannot get profile fname for a null username."); try { return this.profileSelectionRegistry.profileSelectionForUser(userName); } catch (Exception e) { logger.error( "Failed to read persisted profile selection for user " + userName + " if any. Ignoring.", e); } return null; }  }
StickyProfileMapperImpl implements IProfileMapper, ApplicationListener<ProfileSelectionEvent> { @Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userName, "Cannot get profile fname for a null username."); try { return this.profileSelectionRegistry.profileSelectionForUser(userName); } catch (Exception e) { logger.error( "Failed to read persisted profile selection for user " + userName + " if any. Ignoring.", e); } return null; }  @PostConstruct void warnOnApathyKeyInMappings(); @Override void onApplicationEvent(ProfileSelectionEvent event); @Override String getProfileFname(IPerson person, HttpServletRequest request); @Autowired void setProfileSelectionRegistry(
            final IProfileSelectionRegistry profileSelectionRegistry); @Required void setMappings(Map<String, String> mappings); @Autowired void setIdentitySwapperManager(final IdentitySwapperManager manager); void setProfileKeyForNoSelection(final String profileKeyForNoSelection); }
StickyProfileMapperImpl implements IProfileMapper, ApplicationListener<ProfileSelectionEvent> { @Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userName, "Cannot get profile fname for a null username."); try { return this.profileSelectionRegistry.profileSelectionForUser(userName); } catch (Exception e) { logger.error( "Failed to read persisted profile selection for user " + userName + " if any. Ignoring.", e); } return null; }  @PostConstruct void warnOnApathyKeyInMappings(); @Override void onApplicationEvent(ProfileSelectionEvent event); @Override String getProfileFname(IPerson person, HttpServletRequest request); @Autowired void setProfileSelectionRegistry(
            final IProfileSelectionRegistry profileSelectionRegistry); @Required void setMappings(Map<String, String> mappings); @Autowired void setIdentitySwapperManager(final IdentitySwapperManager manager); void setProfileKeyForNoSelection(final String profileKeyForNoSelection);  }