use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class DbUserDaoTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
dao = dbFacade.getDbUserDao();
vm = FixturesTool.VM_RHEL5_POOL_50;
existingUser = dao.get(new Guid("9bf7c640-b620-456f-a550-0348f366544a"));
deletableUser = dao.get(new Guid("9bf7c640-b620-456f-a550-0348f366544b"));
newUser = new DbUser();
newUser.setExternalId("0");
newUser.setId(Guid.newGuid());
newUser.setFirstName("Bob");
newUser.setLastName("Milqtoste");
newUser.setLoginName("newuser");
newUser.setEmail("newuser@redhat.com");
newUser.setDomain("domain");
newUser.setGroupNames(new LinkedList<>(Collections.singletonList("groups")));
newUser.setNamespace("*");
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class DbUserDaoTest method testRemove.
/**
* Ensures that removing users works as expected.
*/
@Test
public void testRemove() {
dao.remove(deletableUser.getId());
DbUser result = dao.get(deletableUser.getId());
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class DbUserDaoTest method testGetByExternalId.
/**
* Ensures that retrieving an user by external id works as expected.
*/
@Test
public void testGetByExternalId() {
DbUser result = dao.getByExternalId("testportal.redhat.com", "a");
assertNotNull(result);
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class DbUserDaoTest method testUpdateDoesntChangeExternalId.
/**
* Ensures that update cycle doesn't change the external identifier.
*/
@Test
public void testUpdateDoesntChangeExternalId() {
DbUser userBefore = dao.get(existingUser.getId());
dao.update(userBefore);
DbUser userAfter = dao.get(existingUser.getId());
assertEquals(userBefore.getExternalId(), userAfter.getExternalId());
}
use of org.ovirt.engine.core.common.businessentities.aaa.DbUser in project ovirt-engine by oVirt.
the class EntityDaoImplTest method testGetEntityNameByIdAndTypeForUser.
@Test
public void testGetEntityNameByIdAndTypeForUser() {
DbUser dbUser = dbUserDao.get(USER_ID);
assertNotNull(dbUser);
String name = dbUser.getLoginName();
assertEquals(name, underTest.getEntityNameByIdAndType(USER_ID, VdcObjectType.User));
}
Aggregations