use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class SessionDataContainerTest method setUpContainer.
@Before
public void setUpContainer() {
when(engineSessionDao.remove(anyLong())).thenReturn(1);
when(ssoSessionValidator.getSessionStatuses(any())).thenReturn(Collections.singletonMap(TEST_SSO_TOKEN, true));
when(ssoSessionUtils.isSessionInUse(anyLong())).thenReturn(false);
DbUser user = mock(DbUser.class);
container.setUser(TEST_SESSION_ID, user);
container.setSsoAccessToken(TEST_SESSION_ID, TEST_SSO_TOKEN);
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class SessionDataContainerTest method testGetUserAndSetUserWithSessionParam.
@Test
public void testGetUserAndSetUserWithSessionParam() {
DbUser user = mock(DbUser.class);
container.setUser(TEST_SESSION_ID, user);
assertEquals("Get should return the value with a given session", user, container.getUser(TEST_SESSION_ID, false));
clearSession();
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class ProcessOvfUpdateForStoragePoolCommandTest method initTestForPool.
private void initTestForPool(StoragePool pool, List<Guid> vmGuids, List<Guid> templatesGuids, List<Guid> removedGuids) {
Guid poolId = pool.getId();
doReturn(vmGuids).when(vmAndTemplatesGenerationsDao).getVmsIdsForOvfUpdate(poolId);
doReturn(templatesGuids).when(vmAndTemplatesGenerationsDao).getVmTemplatesIdsForOvfUpdate(poolId);
doReturn(removedGuids).when(vmAndTemplatesGenerationsDao).getIdsForOvfDeletion(poolId);
doReturn(Collections.EMPTY_LIST).when(affinityGroupDao).getAllAffinityGroupsByVmId(any());
doReturn(Collections.EMPTY_LIST).when(labelDao).getAllByEntityIds(any());
doReturn(new DbUser()).when(dbUserDao).getByUsernameAndDomain(any(), any());
doReturn(Collections.EMPTY_LIST).when(permissionDao).getAllForAdElementAndObjectId(any(), any());
pool.setStatus(StoragePoolStatus.Up);
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class BaseApplicationInit method performLogin.
protected void performLogin(T loginModel) {
DbUser loggedUser = loginModel.getLoggedUser();
beforeLogin();
// UiCommon login preparation
frontend.initLoggedInUser(loggedUser);
// UI login actions
user.login();
afterLogin();
// Perform initial GWTP place transition
performPlaceTransition();
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class BaseApplicationInit method handleUserInfo.
/**
* When a user is already logged in on the server, the server provides user data within the host page.
*/
protected void handleUserInfo(AutoLoginData userInfo) {
final DbUser loggedUser = userInfo.getDbUser();
// Use deferred command because CommonModel change needs to happen
// after all model providers have been properly initialized
Scheduler.get().scheduleDeferred(() -> {
lockInteractionManager.showLoadingIndicator();
getLoginModel().autoLogin(loggedUser);
});
user.setUserInfo(userInfo);
}
Aggregations