use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testAddAttribute.
@Test(priority = 17)
public void testAddAttribute() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
Resource resource = configurationManager.addResource(resourceType.getName(), getSampleResource1Add());
Attribute attribute = getSampleAttribute3();
Attribute retrievedAttribute = configurationManager.addAttribute(resourceType.getName(), resource.getResourceName(), attribute);
assertNotNull(retrievedAttribute.getAttributeId(), "Created resource type id cannot be null");
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testGetExistingAttribute.
@Test(priority = 23)
public void testGetExistingAttribute() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
Resource resource = configurationManager.addResource(resourceType.getName(), getSampleResource1Add());
Attribute retrievedAttribute = configurationManager.getAttribute(resourceType.getName(), resource.getResourceName(), SAMPLE_ATTRIBUTE_NAME1);
assertEquals("Existing id should be equal to the retrieved id", SAMPLE_ATTRIBUTE_NAME1, retrievedAttribute.getKey());
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testReplaceExistingResourceType.
@Test(priority = 4)
public void testReplaceExistingResourceType() throws Exception {
ResourceTypeAdd resourceTypeAdd = getSampleResourceTypeAdd();
ResourceType resourceTypeCreated = configurationManager.addResourceType(resourceTypeAdd);
ResourceType resourceTypeReplaced = configurationManager.replaceResourceType(resourceTypeAdd);
assertEquals("Existing id should be equal to the replaced id", resourceTypeCreated.getId(), resourceTypeReplaced.getId());
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testGetNonExistingResource.
@Test(priority = 13, expectedExceptions = ConfigurationManagementClientException.class)
public void testGetNonExistingResource() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
configurationManager.getResource(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 ConfigStoreBasedTemplateHandler method createResourceType.
private void createResourceType(String templateType) throws ConfigurationManagementException {
ConfigurationManager configManager = TemplateManagerDataHolder.getInstance().getConfigurationManager();
ResourceTypeAdd resourceType = new ResourceTypeAdd();
resourceType.setName(templateType);
resourceType.setDescription("This is the resource type for " + templateType);
configManager.addResourceType(resourceType);
}
Aggregations