use of org.mifos.config.business.ConfigurationKeyValue in project head by mifos.
the class ClientRulesIntegrationTest method testGetGroupCanApplyLoans.
@Test
public void testGetGroupCanApplyLoans() throws Exception {
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
ConfigurationPersistence configPersistence = new ConfigurationPersistence();
ConfigurationKeyValue savedDBValue = null;
savedDBValue = configPersistence.getConfigurationKeyValue(ClientRules.GroupCanApplyLoansKey);
Boolean savedValue = ClientRules.getGroupCanApplyLoans();
configMgr.setProperty(ClientRules.ClientRulesGroupCanApplyLoans, false);
configPersistence.updateConfigurationKeyValueInteger(ClientRules.GroupCanApplyLoansKey, Constants.NO);
ClientRules.refresh();
// set db value to false, too
Assert.assertFalse(ClientRules.getGroupCanApplyLoans());
// now the return value from accounting rules class has to be what is in
// the database (0)
ClientRules.refresh();
Assert.assertFalse(ClientRules.getGroupCanApplyLoans());
// set the saved value back for following tests
configPersistence.updateConfigurationKeyValueInteger(ClientRules.GroupCanApplyLoansKey, Integer.parseInt(savedDBValue.getValue()));
configMgr.setProperty(ClientRules.ClientRulesGroupCanApplyLoans, savedValue);
ClientRules.refresh();
}
use of org.mifos.config.business.ConfigurationKeyValue in project head by mifos.
the class ClientRulesIntegrationTest method testClientCanExistOutsideGroup.
@Test
public void testClientCanExistOutsideGroup() throws Exception {
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
ConfigurationPersistence configPersistence = new ConfigurationPersistence();
ConfigurationKeyValue savedDBValue = null;
savedDBValue = configPersistence.getConfigurationKeyValue(ClientRules.ClientCanExistOutsideGroupKey);
Boolean savedValue = ClientRules.getClientCanExistOutsideGroup();
configMgr.setProperty(ClientRules.ClientRulesClientCanExistOutsideGroup, false);
configPersistence.updateConfigurationKeyValueInteger(ClientRules.ClientCanExistOutsideGroupKey, Constants.NO);
ClientRules.refresh();
// set db value to false, too
Assert.assertFalse(ClientRules.getClientCanExistOutsideGroup());
// now the return value from accounting rules class has to be what is in
// the database (0)
ClientRules.refresh();
Assert.assertFalse(ClientRules.getClientCanExistOutsideGroup());
// set the saved value back for following tests
configPersistence.updateConfigurationKeyValueInteger(ClientRules.ClientCanExistOutsideGroupKey, Integer.parseInt(savedDBValue.getValue()));
configMgr.setProperty(ClientRules.ClientRulesClientCanExistOutsideGroup, savedValue);
ClientRules.refresh();
}
Aggregations