FINERACT-2418: add originator global config

This commit is contained in:
Attila Budai
2026-02-05 10:39:41 +01:00
committed by Adam Saghy
parent ef12056e5d
commit 2620c61afa
5 changed files with 85 additions and 0 deletions
@@ -125,4 +125,35 @@ public class GlobalConfigurationTest {
assertEquals(403, exception.getResponse().code());
assertTrue(exception.getMessage().contains("error.msg.password.reset.days.value.must.be.greater.than.zero"));
}
@Test
public void testOriginatorCreationConfigurationExists() {
String configName = GlobalConfigurationConstants.ENABLE_ORIGINATOR_CREATION_DURING_LOAN_APPLICATION;
GlobalConfigurationPropertyData config = globalConfigurationHelper.getGlobalConfigurationByName(configName);
Assertions.assertNotNull(config, "Configuration should exist");
assertEquals(configName, config.getName(), "Configuration name should match");
assertEquals(false, config.getEnabled(), "Configuration should be disabled by default");
assertEquals(false, config.getTrapDoor(), "Configuration should not be a trap door");
}
@Test
public void testOriginatorCreationConfigurationCanBeEnabled() {
String configName = GlobalConfigurationConstants.ENABLE_ORIGINATOR_CREATION_DURING_LOAN_APPLICATION;
GlobalConfigurationPropertyData config = globalConfigurationHelper.getGlobalConfigurationByName(configName);
Assertions.assertNotNull(config);
try {
globalConfigurationHelper.updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().enabled(true));
GlobalConfigurationPropertyData enabledConfig = globalConfigurationHelper.getGlobalConfigurationByName(configName);
assertEquals(true, enabledConfig.getEnabled(), "Configuration should be enabled after update");
globalConfigurationHelper.updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().enabled(false));
GlobalConfigurationPropertyData disabledConfig = globalConfigurationHelper.getGlobalConfigurationByName(configName);
assertEquals(false, disabledConfig.getEnabled(), "Configuration should be disabled after update");
} finally {
globalConfigurationHelper.updateGlobalConfiguration(configName,
new PutGlobalConfigurationsRequest().enabled(config.getEnabled()));
}
}
}
@@ -585,6 +585,14 @@ public class GlobalConfigurationHelper {
"ACTIVE,TRANSFER_IN_PROGRESS,TRANSFER_ON_HOLD,OVERPAID,CLOSED_OBLIGATIONS_MET");
defaults.add(allowedLoanStatusesForDelayedSettlementExternalAssetTransfer);
HashMap<String, Object> enableOriginatorCreationDuringLoanApplication = new HashMap<>();
enableOriginatorCreationDuringLoanApplication.put("name",
GlobalConfigurationConstants.ENABLE_ORIGINATOR_CREATION_DURING_LOAN_APPLICATION);
enableOriginatorCreationDuringLoanApplication.put("value", 0L);
enableOriginatorCreationDuringLoanApplication.put("enabled", false);
enableOriginatorCreationDuringLoanApplication.put("trapDoor", false);
defaults.add(enableOriginatorCreationDuringLoanApplication);
return defaults;
}