Search in sources :

Example 71 with ActionResponse

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

the class L3policyServiceTest method testDeletel3Policy.

@Test
public void testDeletel3Policy() {
    respondWith(200);
    String id = "8a45f76f-888b-4f3b-ad00-88c3b0ba9e6d";
    ActionResponse result = osv2().gbp().l3Policy().delete(id);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 72 with ActionResponse

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

the class NatPoolServiceTest method testDeleteNatPool.

@Test
public void testDeleteNatPool() {
    respondWith(200);
    String id = "e2d4fce7-4c55-497b-ac4c-290dd202c71a";
    ActionResponse result = osv2().gbp().natPool().delete(id);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 73 with ActionResponse

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

the class PolicyActionServiceTest method testDeletePolicyAction.

@Test
public void testDeletePolicyAction() {
    respondWith(200);
    String id = "b25bbad7-224b-4810-ae1c-7d10fb4468b5";
    ActionResponse result = osv2().gbp().policyAction().delete(id);
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) Test(org.testng.annotations.Test) AbstractTest(org.openstack4j.api.AbstractTest)

Example 74 with ActionResponse

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

the class KeystoneUserServiceTests method crud_User_Test.

/**
     * CRUD user tests
     *
     * @throws Exception
     */
public void crud_User_Test() throws Exception {
    // --create
    respondWith(JSON_USER_CREATE);
    User newUser = osv3().identity().users().create(USER_DOMAIN_ID, "foobar", "secret", "foobar@example.org", true);
    assertEquals(newUser.getName(), "foobar");
    assertEquals(newUser.getDomainId(), USER_DOMAIN_ID);
    assertEquals(newUser.getEmail(), "foobar@example.org");
    assertEquals(newUser.isEnabled(), true);
    assertNotNull(newUser.getId());
    // --read
    respondWith(JSON_USER_READ);
    User user = osv3().identity().users().getByName("foobar", USER_DOMAIN_ID);
    assertEquals(user.getId(), newUser.getId());
    assertEquals(user.getName(), "foobar");
    assertEquals(user.getEmail(), "foobar@example.org");
    assertEquals(user.isEnabled(), true);
    assertEquals(user.getDomainId(), USER_DOMAIN_ID);
    String crudUserId = user.getId();
    // --update
    respondWith(JSON_USER_UPDATE);
    User updatedUser = osv3().identity().users().update(KeystoneUser.builder().id(crudUserId).email("updatedFoobar@example.org").enabled(true).build());
    assertEquals(updatedUser.getEmail(), "updatedFoobar@example.org");
    assertEquals(updatedUser.getName(), "foobar");
    assertEquals(updatedUser.isEnabled(), true);
    assertEquals(updatedUser.getId(), crudUserId);
    assertEquals(updatedUser.getDomainId(), USER_DOMAIN_ID);
    // --delete
    respondWith(204);
    ActionResponse response_delete = osv3().identity().users().delete(crudUserId);
    assertTrue(response_delete.isSuccess());
}
Also used : KeystoneUser(org.openstack4j.openstack.identity.v3.domain.KeystoneUser) User(org.openstack4j.model.identity.v3.User) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 75 with ActionResponse

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

the class KeystoneUserServiceTests method changeUserPassword_Test.

/**
     * Changes the password for a user
     *
     * @throws Exception
     */
public void changeUserPassword_Test() throws Exception {
    respondWith(204);
    ActionResponse response_changeUserPassword = osv3().identity().users().changePassword("aa9f25defa6d4cafb48466df83106065", "originalPassword", "password");
    assertTrue(response_changeUserPassword.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