Search in sources :

Example 66 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class KeystoneRoleServiceTests method checkProjectUserRole_success_Test.

/**
     * checks if a user has a role in project context
     *
     * @throws Exception
     */
public void checkProjectUserRole_success_Test() throws Exception {
    respondWith(204);
    ActionResponse response_success = osv3().identity().roles().checkProjectUserRole(PROJECT_ID, USER_ID, ROLE_ID);
    assertTrue(response_success.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 67 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class KeystoneRoleServiceTests method checkDomainUserRole_success_Test.

/**
     * checks if a user has a role in domain context
     *
     * @throws Exception
     */
public void checkDomainUserRole_success_Test() throws Exception {
    respondWith(204);
    ActionResponse response_success = osv3().identity().roles().checkDomainUserRole(USER_DOMAIN_ID, USER_ID, ROLE_ID);
    assertTrue(response_success.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 68 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class KeystoneRoleServiceTests method grantRevokeDomainUserRole_Test.

/**
     * grants and revokes a role to/from a user in domain context
     *
     * @throws Exception
     */
public void grantRevokeDomainUserRole_Test() throws Exception {
    respondWith(204);
    ActionResponse result_grant = osv3().identity().roles().grantDomainUserRole(USER_DOMAIN_ID, USER_ID, ROLE_ID);
    assertTrue(result_grant.isSuccess());
    respondWith(204);
    ActionResponse result_revoke = osv3().identity().roles().revokeDomainUserRole(USER_DOMAIN_ID, USER_ID, ROLE_ID);
    assertTrue(result_revoke.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 69 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class GroupServiceTest method testDeletePolicyTargetGroup.

@Test
public void testDeletePolicyTargetGroup() {
    respondWith(200);
    String id = "61073812-3994-40c2-96f0-6bff03804e47";
    ActionResponse result = osv2().gbp().group().delete(id);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 70 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class L2policyServiceTest method testDeletel2Policy.

@Test
public void testDeletel2Policy() {
    respondWith(200);
    String id = "08c1c093-6337-4383-938e-2d9c6cac531a";
    ActionResponse result = osv2().gbp().l2Policy().delete(id);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Aggregations

ActionResponse (org.openstack4j.model.common.ActionResponse)123 AbstractTest (org.openstack4j.api.AbstractTest)54 Test (org.testng.annotations.Test)54 Message (org.apache.camel.Message)25 ArrayList (java.util.ArrayList)2 CreateUpdateContainerOptions (org.openstack4j.model.storage.object.options.CreateUpdateContainerOptions)2 TroveBuilders (org.openstack4j.openstack.trove.builder.TroveBuilders)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)1 ResponseToActionResponse (org.openstack4j.core.transport.functions.ResponseToActionResponse)1 Action (org.openstack4j.model.compute.Action)1 User (org.openstack4j.model.identity.v3.User)1 Volume (org.openstack4j.model.storage.block.Volume)1 VolumeSnapshot (org.openstack4j.model.storage.block.VolumeSnapshot)1 KeystoneUser (org.openstack4j.openstack.identity.v3.domain.KeystoneUser)1 TroveDatabase (org.openstack4j.openstack.trove.domain.TroveDatabase)1