@Test
public void test99createServiceConfigUser() {

	XXUserDao xxUserDao = Mockito.mock(XXUserDao.class);
	XXPortalUserDao userDao = Mockito.mock(XXPortalUserDao.class);
	VXUser vxUser = vxUser();
	XXUser xXUser = xxUser(vxUser);
	VXPortalUser userProfile = userProfile();
	XXPortalUser xXPortalUser = xxPortalUser(userProfile);
	Collection<String> userRoleList =getRoleList();
	VXUserPermission vXUserPermission=vxUserPermission();
	XXUserPermission xUserPermissionObj = xxUserPermission();
	xUserPermissionObj.setModuleId(vXUserPermission.getModuleId());
	xUserPermissionObj.setUserId(vXUserPermission.getUserId());
	Mockito.when(daoManager.getXXUser()).thenReturn(xxUserDao);
	Mockito.when(xxUserDao.findByUserName(vxUser.getName())).thenReturn(xXUser);
	Mockito.when(daoManager.getXXPortalUser()).thenReturn(userDao);
	Mockito.when(userDao.findByLoginId(vxUser.getName())).thenReturn(xXPortalUser);
	Mockito.when(xUserService.populateViewBean(xXUser)).thenReturn(vxUser);
	VXUser serviceConfigUser=xUserMgr.createServiceConfigUser(vxUser.getName());
	Assert.assertNotNull(serviceConfigUser);
	Assert.assertEquals(xXUser.getName(), serviceConfigUser.getName());
	Mockito.when(daoManager.getXXUser()).thenReturn(xxUserDao);
	Mockito.when(xxUserDao.findByUserName(vxUser.getName())).thenReturn(null);
	Mockito.when(daoManager.getXXPortalUser()).thenReturn(userDao);
	Mockito.when(userDao.findByLoginId(vxUser.getName())).thenReturn(null);
	Mockito.when(userMgr.mapVXPortalUserToXXPortalUser((VXPortalUser) Mockito.any())).thenReturn(xXPortalUser);
	Mockito.when(userMgr.createUser(xXPortalUser,RangerCommonEnums.STATUS_ENABLED,userRoleList)).thenReturn(xXPortalUser);
	Mockito.when(xUserService.createResource((VXUser) Mockito.any())).thenReturn(null);
	Mockito.when(daoManager.getXXUser()).thenReturn(xxUserDao);
	UserSessionBase userSession = Mockito.mock(UserSessionBase.class);
	Set<UserSessionBase> userSessions = new HashSet<UserSessionBase>();
	userSessions.add(userSession);
	serviceConfigUser=xUserMgr.createServiceConfigUser(vxUser.getName());
	Assert.assertNull(serviceConfigUser);
}