use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceTypeAdd in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testAddDuplicateResourceType.
@Test(priority = 2, expectedExceptions = ConfigurationManagementClientException.class)
public void testAddDuplicateResourceType() throws Exception {
ResourceTypeAdd resourceTypeAdd = getSampleResourceTypeAdd();
configurationManager.addResourceType(resourceTypeAdd);
configurationManager.addResourceType(resourceTypeAdd);
fail("Expected: " + ConfigurationManagementClientException.class.getName());
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceTypeAdd in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method testAddResource.
@Test(priority = 9)
public void testAddResource() throws Exception {
ResourceType resourceType = configurationManager.addResourceType(getSampleResourceTypeAdd());
ResourceAdd resourceTypeAdd = getSampleResource1Add();
Resource resource = configurationManager.addResource(resourceType.getName(), resourceTypeAdd);
assertNotNull(resource.getResourceId(), "Created resource type id cannot be null");
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceTypeAdd 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.ResourceTypeAdd in project carbon-identity-framework by wso2.
the class TestUtils method getSampleResourceType2Add.
public static ResourceTypeAdd getSampleResourceType2Add() {
ResourceTypeAdd resourceTypeAdd = new ResourceTypeAdd();
resourceTypeAdd.setName(SAMPLE_RESOURCE_TYPE_NAME2);
resourceTypeAdd.setDescription(SAMPLE_RESOURCE_TYPE_DESCRIPTION);
return resourceTypeAdd;
}
use of org.wso2.carbon.identity.configuration.mgt.core.model.ResourceTypeAdd 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