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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations