use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.
the class KeystoneRoleServiceTests method revokeDomainUserRole_fail_Test.
/**
* try to revoke a domain role from a user that isn't assigned to him
* results in failing ActionResponse
*
* @throws Exception
*/
public void revokeDomainUserRole_fail_Test() throws Exception {
respondWithCodeAndResource(404, JSON_ROLES_REVOKEROLE_ERROR);
ActionResponse response_fail = osv3().identity().roles().revokeDomainUserRole(USER_DOMAIN_ID, USER_ID, "existingUnassignedRoleId");
assertFalse(response_fail.isSuccess());
}
use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.
the class KeystoneRoleServiceTests method revokeProjectUserRole_fail_Test.
/**
* try to revoke a project role from a user that isn't assigned to him
* results in failing ActionResponse
*
* @throws Exception
*/
public void revokeProjectUserRole_fail_Test() throws Exception {
respondWithCodeAndResource(404, JSON_ROLES_REVOKEROLE_ERROR);
ActionResponse response_fail = osv3().identity().roles().revokeProjectUserRole(PROJECT_ID, USER_ID, "existingUnassignedRoleId");
assertFalse(response_fail.isSuccess());
}
use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.
the class KeystoneRoleServiceTests method addRoleToUserInProject_check_correct_response.
public void addRoleToUserInProject_check_correct_response() throws Exception {
respondWith(204);
ActionResponse actionResponse = osv3().identity().roles().grantProjectUserRole("fake", "fake", "fake");
assertTrue(actionResponse.isSuccess());
}
use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.
the class KeystoneRoleServiceTests method checkProjectUserRole_fail_Test.
// TODO: this test is disabled due to a malformed response returned by
// OpenStack as described in issue #530
/**
* checks if a user has a role in domain context
*
* @throws Exception
*/
@Test(enabled = false)
public void checkProjectUserRole_fail_Test() throws Exception {
respondWith(404);
ActionResponse response_success = osv3().identity().roles().checkProjectUserRole(PROJECT_ID, USER_ID, "existingUnassignedRoleId");
assertFalse(response_success.isSuccess());
}
use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.
the class KeystoneRoleServiceTests method grantProjectUserRole_fail_Test.
/**
* try to grant a project role to a user using role that doesn't exist
* results in failing ActionResponse
*
* @throws Exception
*/
public void grantProjectUserRole_fail_Test() throws Exception {
respondWithCodeAndResource(404, JSON_ROLES_GRANTROLE_ERROR);
ActionResponse response_fail = osv3().identity().roles().grantProjectUserRole(PROJECT_ID, USER_ID, "nonExistingRoleId");
assertFalse(response_fail.isSuccess());
}
Aggregations