use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testDeleteExistingAttribute.
@Test(priority = 25, expectedExceptions = ConfigurationManagementClientException.class)
public void testDeleteExistingAttribute() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
Resource resource = configurationManager.addResource(resourceType.getName(), getSampleResource1Add());
Attribute createdAttribute = configurationManager.addAttribute(resourceType.getName(), resource.getResourceName(), getSampleAttribute1());
configurationManager.deleteAttribute(resourceType.getName(), resource.getResourceName(), createdAttribute.getKey());
configurationManager.getAttribute(resourceType.getName(), resource.getResourceName(), createdAttribute.getKey());
fail("Expected: " + ConfigurationManagementClientException.class.getName());
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testSearchTenantSpecificResources.
@Test(priority = 32)
public void testSearchTenantSpecificResources() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
configurationManager.addResource(resourceType.getName(), getSampleResource1Add());
mockCarbonContextForTenant(SAMPLE_TENANT_ID_ABC, SAMPLE_TENANT_DOMAIN_ABC);
configurationManager.addResource(resourceType.getName(), getSampleResource2Add());
mockIdentityTenantUtilForTheTest();
// Mock carbon context back to the super tenant.
mockCarbonContextForTenant(SUPER_TENANT_ID, SUPER_TENANT_DOMAIN_NAME);
ComplexCondition condition = getSampleSearchCondition();
Resources resources = configurationManager.getTenantResources(SAMPLE_TENANT_DOMAIN_ABC, condition);
assertTrue(isTenantSearchConditionMatch(resources));
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testDeleteNonExistingResource.
@Test(priority = 15, expectedExceptions = ConfigurationManagementClientException.class)
public void testDeleteNonExistingResource() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
configurationManager.deleteResource(resourceType.getName(), SAMPLE_RESOURCE_NAME1);
fail("Expected: " + ConfigurationManagementClientException.class.getName());
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testAddResourceType.
@Test(priority = 1)
public void testAddResourceType() throws Exception {
ResourceTypeAdd resourceTypeAdd = getSampleResourceTypeAdd();
ResourceType resourceType = configurationManager.addResourceType(resourceTypeAdd);
assertNotNull(resourceType.getId(), "Created resource type id cannot be null");
}
Aggregations