Search in sources :

Example 1 with UserGroupCreateParam

use of com.emc.storageos.model.usergroup.UserGroupCreateParam in project coprhd-controller by CoprHD.

the class ApiTestVcenter method createUserGroup.

private void createUserGroup(String domain, String key, String value) {
    UserAttributeParam userAttributeParam = new UserAttributeParam();
    userAttributeParam.setKey(key);
    userAttributeParam.getValues().add(value);
    UserGroupCreateParam param = new UserGroupCreateParam();
    param.setLabel(value);
    param.setDomain(domain);
    param.getAttributes().add(userAttributeParam);
    ClientResponse clientResponse = rSys.path(getUserGroupApi()).post(ClientResponse.class, param);
    Assert.assertEquals(HttpStatus.SC_OK, clientResponse.getStatus());
    UserGroupRestRep userGroupRestRep = clientResponse.getEntity(UserGroupRestRep.class);
    Assert.assertNotNull(userGroupRestRep);
    // Add the created tenant to cleanup list, so that at the end of this test
    // the resource will be destroyed.
    final String deleteObjectURL = getUserGroupApiWithId(userGroupRestRep.getId());
    CleanupResource tenantToCleanup = new CleanupResource("delete", deleteObjectURL, rSys, null);
    apiTestVcenter.registerEnvironmentResourceForCleanup(tenantToCleanup);
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) UserGroupCreateParam(com.emc.storageos.model.usergroup.UserGroupCreateParam) UserAttributeParam(com.emc.storageos.model.usergroup.UserAttributeParam) UserGroupRestRep(com.emc.storageos.model.usergroup.UserGroupRestRep)

Aggregations

UserAttributeParam (com.emc.storageos.model.usergroup.UserAttributeParam)1 UserGroupCreateParam (com.emc.storageos.model.usergroup.UserGroupCreateParam)1 UserGroupRestRep (com.emc.storageos.model.usergroup.UserGroupRestRep)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1