Search in sources :

Example 1 with DatabaseUsers

use of org.openstack4j.openstack.trove.domain.TroveDatabaseUser.DatabaseUsers in project openstack4j by ContainX.

the class DBUserServiceImplTest method testCreateDatabaseUser.

@Test
public void testCreateDatabaseUser() throws Exception {
    String databaseInstanceId = "54c91755526e44b9808385a263db4aa6";
    respondWith(200);
    TroveBuilders troveBuilders = new TroveBuilders();
    TroveDatabaseUser databaseUser = (TroveDatabaseUser) troveBuilders.databaseUserCreate().username("dbuser4").password("password").build();
    List<TroveDatabaseUser> troveDatabaseUsers = new ArrayList<>();
    troveDatabaseUsers.add(databaseUser);
    DatabaseUsers databaseUsers = new DatabaseUsers();
    databaseUsers.setTroveDatabaseUserList(troveDatabaseUsers);
    ActionResponse result = osv2().trove().databaseUsersService().create(databaseInstanceId, databaseUsers);
    assertTrue(result.isSuccess());
}
Also used : TroveDatabaseUser(org.openstack4j.openstack.trove.domain.TroveDatabaseUser) ArrayList(java.util.ArrayList) TroveBuilders(org.openstack4j.openstack.trove.builder.TroveBuilders) DatabaseUsers(org.openstack4j.openstack.trove.domain.TroveDatabaseUser.DatabaseUsers) ActionResponse(org.openstack4j.model.common.ActionResponse) Test(org.testng.annotations.Test) AbstractTest(org.openstack4j.api.AbstractTest)

Aggregations

ArrayList (java.util.ArrayList)1 AbstractTest (org.openstack4j.api.AbstractTest)1 ActionResponse (org.openstack4j.model.common.ActionResponse)1 TroveBuilders (org.openstack4j.openstack.trove.builder.TroveBuilders)1 TroveDatabaseUser (org.openstack4j.openstack.trove.domain.TroveDatabaseUser)1 DatabaseUsers (org.openstack4j.openstack.trove.domain.TroveDatabaseUser.DatabaseUsers)1 Test (org.testng.annotations.Test)1