use of org.wso2.identity.integration.common.utils.UserStoreConfigUtils in project product-is by wso2.
the class UserStoreConfigUtils method getJDBCUserStoreProperties.
/**
* Sets properties for the JDBC Userstore.
*
* @throws IOException throws if an error occurs when setting JDBC userstore properties.
* @throws SQLException throws if an error occurs when perfomring a db action.
* @throws ClassNotFoundException throws if it fails to find the relevant java class.
* @deprecated This method uses a common user store database name. When multiple test cases reuse the same database,
* there can be transient connection exceptions due to database not properly closed. Thus please use the utility
* method {@link UserStoreConfigUtils#getJDBCUserStoreProperties(String)} with a test case specific user database
* name instead.
*/
public PropertyDTO[] getJDBCUserStoreProperties() throws IOException, SQLException, ClassNotFoundException {
propertyDTOs = new PropertyDTO[11];
for (int i = 0; i < 11; i++) {
propertyDTOs[i] = new PropertyDTO();
}
// creating database
H2DataBaseManager dbmanager = new H2DataBaseManager("jdbc:h2:" + ServerConfigurationManager.getCarbonHome() + "/repository/database/" + userStoreDBName, dbUserName, dbUserPassword);
dbmanager.executeUpdate(new File(ServerConfigurationManager.getCarbonHome() + "/dbscripts/h2.sql"));
dbmanager.disconnect();
propertyDTOs[0].setName("driverName");
propertyDTOs[0].setValue("org.h2.Driver");
propertyDTOs[1].setName("url");
propertyDTOs[1].setValue("jdbc:h2:./repository/database/" + userStoreDBName);
propertyDTOs[2].setName("userName");
propertyDTOs[2].setValue(dbUserName);
propertyDTOs[3].setName("password");
propertyDTOs[3].setValue(dbUserPassword);
propertyDTOs[4].setName("PasswordJavaRegEx");
propertyDTOs[4].setValue("^[\\S]{5,30}$");
propertyDTOs[5].setName("UsernameJavaRegEx");
propertyDTOs[5].setValue("^[\\S]{5,30}$");
propertyDTOs[6].setName("Disabled");
propertyDTOs[6].setValue("false");
propertyDTOs[7].setName("PasswordDigest");
propertyDTOs[7].setValue("SHA-256");
propertyDTOs[8].setName("StoreSaltedPassword");
propertyDTOs[8].setValue("true");
propertyDTOs[9].setName("SCIMEnabled");
propertyDTOs[9].setValue("true");
propertyDTOs[9].setName("CountRetrieverClass");
propertyDTOs[9].setValue("org.wso2.carbon.identity.user.store.count.jdbc.JDBCUserStoreCountRetriever");
propertyDTOs[10].setName("UserIDEnabled");
propertyDTOs[10].setValue("true");
return propertyDTOs;
}
use of org.wso2.identity.integration.common.utils.UserStoreConfigUtils in project product-is by wso2.
the class UserStoreSuccessTest method init.
@BeforeClass(alwaysRun = true)
public void init() throws Exception {
super.testInit(API_VERSION, swaggerDefinition, tenant);
userStoreConfigAdminServiceClient = new UserStoreConfigAdminServiceClient(backendURL, sessionCookie);
userStoreConfigUtils = new UserStoreConfigUtils();
}
Aggregations