use of org.wso2.carbon.identity.user.store.configuration.stub.dto.UserStoreDTO in project product-is by wso2.
the class ClaimMappingsOnSecondaryUserStoreTestCase method testAddJDBCUserStore.
@Test(groups = "wso2.is", description = "Check add user store via DTO")
private void testAddJDBCUserStore() throws Exception {
UserStoreDTO userStoreDTO = userStoreConfigAdminServiceClient.createUserStoreDTO(JDBC_CLASS, DOMAIN_ID, userStoreConfigUtils.getJDBCUserStoreProperties(USER_STORE_DB_NAME));
userStoreConfigAdminServiceClient.addUserStore(userStoreDTO);
Thread.sleep(5000);
Assert.assertTrue(userStoreConfigUtils.waitForUserStoreDeployment(userStoreConfigAdminServiceClient, DOMAIN_ID), "Domain addition via DTO has failed.");
}
use of org.wso2.carbon.identity.user.store.configuration.stub.dto.UserStoreDTO in project product-is by wso2.
the class JDBCUserStoreAddingTestCase method testAddJDBCUserStore.
@Test(groups = "wso2.is", description = "Check add user store via DTO", dependsOnMethods = "testAvailableUserStoreClasses")
private void testAddJDBCUserStore() throws Exception {
UserStoreDTO userStoreDTO = userStoreConfigAdminServiceClient.createUserStoreDTO(jdbcClass, domainId, userStoreConfigUtils.getJDBCUserStoreProperties(USER_STORE_DB_NAME));
userStoreConfigAdminServiceClient.addUserStore(userStoreDTO);
Thread.sleep(5000);
Assert.assertTrue(userStoreConfigUtils.waitForUserStoreDeployment(userStoreConfigAdminServiceClient, domainId), "Domain addition via DTO has failed.");
}
use of org.wso2.carbon.identity.user.store.configuration.stub.dto.UserStoreDTO in project product-is by wso2.
the class UserStoreConfigAdminTestCase method testAddDuplicateUserStore.
@Test(expectedExceptions = UserStoreConfigAdminServiceIdentityUserStoreMgtException.class, groups = "wso2.is", description = "Check add user store via DTO", dependsOnMethods = "testAddUserStore")
public void testAddDuplicateUserStore() throws Exception {
Property[] properties = (new JDBCUserStoreManager()).getDefaultUserStoreProperties().getMandatoryProperties();
PropertyDTO[] propertyDTOs = new PropertyDTO[properties.length];
for (int i = 0; i < properties.length; i++) {
PropertyDTO propertyDTO = new PropertyDTO();
propertyDTO.setName(properties[i].getName());
propertyDTO.setValue(properties[i].getValue());
propertyDTOs[i] = propertyDTO;
}
UserStoreDTO userStoreDTO = userStoreConfigurationClient.createUserStoreDTO(jdbcClass, "lanka.com", propertyDTOs);
userStoreConfigurationClient.addUserStore(userStoreDTO);
}
use of org.wso2.carbon.identity.user.store.configuration.stub.dto.UserStoreDTO in project product-is by wso2.
the class UserStoreDeployerTestCase method testChangeUserStoreState.
@Test(groups = "wso2.is", description = "Test enable/disable user stores", dependsOnMethods = "testMultipleUserStores")
public void testChangeUserStoreState() throws Exception {
Boolean isDisabled = false;
userStoreConfigurationClient.changeUserStoreState("wso2.com", true);
Thread.sleep(30000);
UserStoreDTO[] userStoreDTOs = userStoreConfigurationClient.getActiveDomains();
if (userStoreDTOs[0] != null) {
for (UserStoreDTO userStoreDTO : userStoreDTOs) {
if (userStoreDTO.getDomainId().equalsIgnoreCase("wso2.com")) {
isDisabled = userStoreDTO.getDisabled();
}
}
}
Assert.assertTrue("Disabling user store has failed", isDisabled);
}
use of org.wso2.carbon.identity.user.store.configuration.stub.dto.UserStoreDTO in project identity-api-server by wso2.
the class ServerUserStoreService method getUserStoreList.
/**
* To retrieve the configured user store lists.
*
* @param limit items per page.
* @param offset 0 based index to get the results starting from this index + 1.
* @param filter to specify the filtering capabilities.
* @param sort to specify the sorting order.
* @return List<UserStoreListResponse>.
*/
public List<UserStoreListResponse> getUserStoreList(Integer limit, Integer offset, String filter, String sort, String requiredAttributes) {
handleNotImplementedBehaviour(limit, offset, filter, sort);
UserStoreConfigService userStoreConfigService = UserStoreConfigServiceHolder.getInstance().getUserStoreConfigService();
try {
UserStoreDTO[] userStoreDTOS = userStoreConfigService.getUserStores();
return buildUserStoreListResponse(userStoreDTOS, requiredAttributes);
} catch (IdentityUserStoreMgtException e) {
UserStoreConstants.ErrorMessage errorEnum = UserStoreConstants.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_USER_STORE;
throw handleIdentityUserStoreMgtException(e, errorEnum);
}
}
Aggregations