public void setQuotaToOrg() throws Exception {
assumeTrue(CCNG_USER_IS_ADMIN);
// get old quota to restore after test
CloudOrganization org = connectedClient.getOrgByName(CCNG_USER_ORG, true);
CloudQuota oldQuota = org.getQuota();
// create and set test_quota to org
CloudQuota cloudQuota = new CloudQuota(null, CCNG_QUOTA_NAME_TEST);
connectedClient.createQuota(cloudQuota);
connectedClient.setQuotaToOrg(CCNG_USER_ORG, CCNG_QUOTA_NAME_TEST);
// get the bound quota of org
org = connectedClient.getOrgByName(CCNG_USER_ORG, true);
CloudQuota newQuota = org.getQuota();
// bound quota should be equals to test_quota
assertEquals(CCNG_QUOTA_NAME_TEST, newQuota.getName());
// restore org to default quota
connectedClient.setQuotaToOrg(CCNG_USER_ORG, oldQuota.getName());
connectedClient.deleteQuota(CCNG_QUOTA_NAME_TEST);
}