use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class PermissionDaoTest method assertValidGetByAdElement.
/**
* Asserts that the result of get for AD element is correct
* @param result The result to check
*/
private static void assertValidGetByAdElement(List<Permission> result) {
assertNotNull(result);
assertFalse(result.isEmpty());
for (Permission permission : result) {
assertEquals(AD_ELEMENT_ID, permission.getAdElementId());
}
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class PermissionDaoTest method testGetAllForRole.
/**
* Ensures that a collection of permissions are returned.
*/
@Test
public void testGetAllForRole() {
List<Permission> result = dao.getAllForRole(ROLE_ID);
assertNotNull(result);
assertFalse(result.isEmpty());
for (Permission permission : result) {
assertEquals(ROLE_ID, permission.getRoleId());
}
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class PermissionDaoTest method testGetAllForRoleAndAdElementAndObjectWithInvalidRole.
/**
* Ensures that a null object is returned when the role is invalid.
*/
@Test
public void testGetAllForRoleAndAdElementAndObjectWithInvalidRole() {
Permission result = dao.getForRoleAndAdElementAndObject(Guid.newGuid(), AD_ELEMENT_ID, VM_ENTITY_ID);
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class PermissionDaoTest method testGetWithInvalidId.
/**
* Ensures that getting a permission with a bad id fails.
*/
@Test
public void testGetWithInvalidId() {
Permission result = dao.get(Guid.newGuid());
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.Permission in project ovirt-engine by oVirt.
the class PermissionDaoTest method testGetAllForRoleAndAdElementAndObjectWithInvalidObject.
/**
* Ensures that a null object is returned when the object is invalid.
*/
@Test
public void testGetAllForRoleAndAdElementAndObjectWithInvalidObject() {
Permission result = dao.getForRoleAndAdElementAndObject(ROLE_ID, AD_ELEMENT_ID, Guid.newGuid());
assertNull(result);
}
Aggregations