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