Liquibase compatibility fix
This commit is contained in:
committed by
Arnold Gálovics
parent
9a7a425696
commit
51028fdbd0
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.apache.fineract;
|
||||
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.RETURNS_MOCKS;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@@ -30,6 +31,8 @@ import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||
import org.apache.fineract.infrastructure.core.service.database.DatabaseIndependentQueryService;
|
||||
import org.apache.fineract.infrastructure.core.service.database.DatabasePasswordEncryptor;
|
||||
import org.apache.fineract.infrastructure.core.service.database.DatabaseType;
|
||||
import org.apache.fineract.infrastructure.core.service.database.DatabaseTypeResolver;
|
||||
import org.apache.fineract.infrastructure.core.service.migration.ExtendedSpringLiquibaseFactory;
|
||||
import org.apache.fineract.infrastructure.core.service.migration.TenantDataSourceFactory;
|
||||
import org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseStateVerifier;
|
||||
@@ -108,11 +111,32 @@ public class TestConfiguration {
|
||||
return mock(JobLauncher.class, RETURNS_MOCKS);
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
public HikariDataSource tenantDataSource() {
|
||||
return mock(HikariDataSource.class, Mockito.RETURNS_MOCKS);
|
||||
HikariDataSource mockDataSource = mock(HikariDataSource.class, Mockito.RETURNS_MOCKS);
|
||||
return mockDataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* DataSource with Mockito RETURNS_MOCKS black magic.
|
||||
*/
|
||||
@Bean
|
||||
public DataSource hikariTenantDataSource() {
|
||||
HikariDataSource mockDataSource = mock(HikariDataSource.class, Mockito.RETURNS_MOCKS);
|
||||
return mockDataSource;
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
public DatabaseTypeResolver databaseTypeResolver() {
|
||||
DatabaseTypeResolver mock = mock(DatabaseTypeResolver.class, RETURNS_MOCKS);
|
||||
given(mock.databaseType()).willReturn(DatabaseType.POSTGRESQL);
|
||||
given(mock.isPostgreSQL()).willReturn(true);
|
||||
return mock;
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
public TenantDetailsService tenantDetailsService() {
|
||||
return mock(TenantDetailsService.class, Mockito.RETURNS_MOCKS);
|
||||
@@ -158,15 +182,6 @@ public class TestConfiguration {
|
||||
return mockJobRegisterService;
|
||||
}
|
||||
|
||||
/**
|
||||
* DataSource with Mockito RETURNS_MOCKS black magic.
|
||||
*/
|
||||
@Bean
|
||||
public DataSource hikariTenantDataSource() {
|
||||
DataSource mockDataSource = mock(DataSource.class, Mockito.RETURNS_MOCKS);
|
||||
return mockDataSource;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JdbcTemplate jdbcTemplate() {
|
||||
return mock(JdbcTemplate.class);
|
||||
|
||||
+1
@@ -72,6 +72,7 @@ public class COBBusinessStepServiceStepDefinitions implements En {
|
||||
private BatchBusinessStep batchBusinessStep = mock(BatchBusinessStep.class);
|
||||
private Set<BusinessStepNameAndOrder> resultSet;
|
||||
|
||||
@SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW")
|
||||
public COBBusinessStepServiceStepDefinitions() throws Exception {
|
||||
businessStepService = new COBBusinessStepServiceImpl(batchBusinessStepRepository, applicationContext, beanFactory,
|
||||
businessEventNotifierService, configurationDomainService, reloaderService);
|
||||
|
||||
+2
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.classpath;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import io.cucumber.java8.En;
|
||||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ResourceList;
|
||||
@@ -38,6 +39,7 @@ public class ClasspathDuplicatesStepDefinitions implements En {
|
||||
|
||||
private ClassGraph classGraph;
|
||||
|
||||
@SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW")
|
||||
public ClasspathDuplicatesStepDefinitions() {
|
||||
// tag::given[]
|
||||
Given("A class graph", () -> {
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ public class MultiExceptionStepDefinitions implements En {
|
||||
|
||||
private List<Throwable> exceptions = new ArrayList<>();
|
||||
|
||||
@SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW")
|
||||
public MultiExceptionStepDefinitions() {
|
||||
Given("/^A multi exception with exceptions (.*) and (.*)$/", (String exception1, String exception2) -> {
|
||||
if (!StringUtils.isBlank(exception1)) {
|
||||
|
||||
Reference in New Issue
Block a user