Search in sources :

Example 36 with ActionResponse

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

the class TackerVnfdTests method testDeleteVnfd.

public void testDeleteVnfd() throws IOException {
    respondWith(200);
    ActionResponse result = osv3().tacker().vnfd().delete("1363e776-6c79-4e53-8074-4e32e49f156a");
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 37 with ActionResponse

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

the class MemberTests method testDeleteMember.

public void testDeleteMember() {
    String id = "99a28283-97b7-4210-af5c-b2594628217b";
    ActionResponse result = osv3().networking().loadbalancers().member().delete(id);
    System.out.println("test delete a member" + result);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 38 with ActionResponse

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

the class KeystoneRoleServiceTests method checkDomainUserRole_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 checkDomainUserRole_fail_Test() throws Exception {
    respondWith(404);
    ActionResponse response_success = osv3().identity().roles().checkDomainUserRole(USER_DOMAIN_ID, USER_ID, "existingUnassignedRoleId");
    assertFalse(response_success.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 39 with ActionResponse

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

the class KeystoneRoleServiceTests method grantDomainUserRole_fail_Test.

/**
     * try to grant a domain role to a user using a role that doesn't exist
     * results in failing ActionResponse
     *
     * @throws Exception
     */
public void grantDomainUserRole_fail_Test() throws Exception {
    respondWithCodeAndResource(404, JSON_ROLES_GRANTROLE_ERROR);
    ActionResponse response_fail = osv3().identity().roles().grantDomainUserRole(USER_DOMAIN_ID, USER_ID, "nonExistingRoleId");
    assertFalse(response_fail.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 40 with ActionResponse

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

the class KeystoneUserServiceTests method deleteUser_fail_Test.

/**
     * tries to delete an non existent user fails
     *
     * @throws Exception
     */
public void deleteUser_fail_Test() throws Exception {
    respondWithCodeAndResource(404, JSON_USER_DELETE_FAIL);
    ActionResponse response_delete_fail = osv3().identity().users().delete("invalidUser");
    assertFalse(response_delete_fail.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

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