@Test public void test2GjUserToUserProfile() { Mockito.when(daoManager.getXXPortalUserRole()).thenReturn(xXPortalUserRoleDao); userService.gjUserToUserProfile(xXPortalUser, vXPortalUser); }
public void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { userProfile.setId(user.getId()); userProfile.setLoginId(user.getLoginId()); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); UserSessionBase sess = ContextUtil.getCurrentUserSession(); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } if (sess != null) { userProfile.setUserSource(sess.getAuthProvider()); } List<XXPortalUserRole> gjUserRoleList = daoManager.getXXPortalUserRole().findByParentId( user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } }
UserService extends UserServiceBase<XXPortalUser, VXPortalUser> { public void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { userProfile.setId(user.getId()); userProfile.setLoginId(user.getLoginId()); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); UserSessionBase sess = ContextUtil.getCurrentUserSession(); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } if (sess != null) { userProfile.setUserSource(sess.getAuthProvider()); } List<XXPortalUserRole> gjUserRoleList = daoManager.getXXPortalUserRole().findByParentId( user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } } }
UserService extends UserServiceBase<XXPortalUser, VXPortalUser> { public void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { userProfile.setId(user.getId()); userProfile.setLoginId(user.getLoginId()); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); UserSessionBase sess = ContextUtil.getCurrentUserSession(); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } if (sess != null) { userProfile.setUserSource(sess.getAuthProvider()); } List<XXPortalUserRole> gjUserRoleList = daoManager.getXXPortalUserRole().findByParentId( user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } } UserService(); }
UserService extends UserServiceBase<XXPortalUser, VXPortalUser> { public void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { userProfile.setId(user.getId()); userProfile.setLoginId(user.getLoginId()); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); UserSessionBase sess = ContextUtil.getCurrentUserSession(); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } if (sess != null) { userProfile.setUserSource(sess.getAuthProvider()); } List<XXPortalUserRole> gjUserRoleList = daoManager.getXXPortalUserRole().findByParentId( user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } } UserService(); static UserService getInstance(); void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile); }
UserService extends UserServiceBase<XXPortalUser, VXPortalUser> { public void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { userProfile.setId(user.getId()); userProfile.setLoginId(user.getLoginId()); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); UserSessionBase sess = ContextUtil.getCurrentUserSession(); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } if (sess != null) { userProfile.setUserSource(sess.getAuthProvider()); } List<XXPortalUserRole> gjUserRoleList = daoManager.getXXPortalUserRole().findByParentId( user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } } UserService(); static UserService getInstance(); void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile); static final String NAME; }