FINERACT-1492: Hikari configuration based on application properties

This commit is contained in:
Aleksandar Vidakovic
2022-02-07 16:38:39 +01:00
committed by Aleksandar Vidakovic
parent 1f6ff8ccad
commit c66415dbfd
24 changed files with 509 additions and 276 deletions
@@ -20,9 +20,11 @@ package org.apache.fineract.infrastructure.configuration.spring;
import javax.sql.DataSource;
import org.apache.fineract.infrastructure.core.boot.AbstractApplicationConfiguration;
import org.apache.fineract.infrastructure.core.config.FineractProperties;
import org.apache.fineract.infrastructure.core.service.TenantDatabaseUpgradeService;
import org.apache.fineract.infrastructure.jobs.service.JobRegisterService;
import org.mockito.Mockito;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@@ -33,6 +35,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
* are in the DB), thus nor starts any background jobs. For some integration tests, this may be perfectly sufficient
* (and faster to run such tests).
*/
@EnableConfigurationProperties({ FineractProperties.class })
public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicationConfiguration {
/**
@@ -41,7 +44,7 @@ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicat
*/
@Bean
public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() {
return new TenantDatabaseUpgradeService(null, null) {
return new TenantDatabaseUpgradeService(null, null, null, null) {
@Override
public void upgradeAllTenants() {
@@ -17,10 +17,22 @@
# under the License.
#
fineract.node-id=1
fineract.security.basicauth.enabled=true
fineract.security.oauth.enabled=false
fineract.security.2fa.enabled=false
fineract.tenant.host=localhost
fineract.tenant.port=3306
fineract.tenant.username=root
fineract.tenant.password=mysql
fineract.tenant.parameters=
fineract.tenant.timezone=Asia/Kolkata
fineract.tenant.identifier=default
fineract.tenant.name=fineract_default
fineract.tenant.description=Default Demo Tenant
management.health.jms.enabled=false
# FINERACT 1296
@@ -34,3 +46,26 @@ management.endpoints.web.exposure.include=health,info
# FINERACT-914
server.forward-headers-strategy=framework
spring.datasource.hikari.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.hikari.jdbcUrl=jdbc:mariadb://localhost:3306/fineract_tenants
spring.datasource.hikari.username=root
spring.datasource.hikari.password=mysql
spring.datasource.hikari.minimumIdle=3
spring.datasource.hikari.maximumPoolSize=10
spring.datasource.hikari.idleTimeout=60000
spring.datasource.hikari.connectionTimeout=20000
spring.datasource.hikari.connectionTestQuery=SELECT 1
spring.datasource.hikari.autoCommit=true
spring.datasource.hikari.dataSourceProperties['cachePrepStmts']=true
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSize']=250
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSqlLimit']=2048
spring.datasource.hikari.dataSourceProperties['useServerPrepStmts']=true
spring.datasource.hikari.dataSourceProperties['useLocalSessionState']=true
spring.datasource.hikari.dataSourceProperties['rewriteBatchedStatements']=true
spring.datasource.hikari.dataSourceProperties['cacheResultSetMetadata']=true
spring.datasource.hikari.dataSourceProperties['cacheServerConfiguration']=true
spring.datasource.hikari.dataSourceProperties['elideSetAutoCommits']=true
spring.datasource.hikari.dataSourceProperties['maintainTimeStats']=false
spring.datasource.hikari.dataSourceProperties['logSlowQueries']=true
spring.datasource.hikari.dataSourceProperties['dumpQueriesOnException']=true