FINERACT-821 Made changes to enforce ConstantName Checkstyle (1)

This commit is contained in:
Manthan Surkar
2020-06-03 22:13:19 +02:00
committed by Michael Vorburger ⛑️
parent 3521b0ed33
commit 9cda5f984a
18 changed files with 184 additions and 184 deletions
@@ -106,13 +106,13 @@ public class AccountTransferTest {
/*** Create A Financial Activity to Account Mapping **/ /*** Create A Financial Activity to Account Mapping **/
financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
FinancialActivityAccountsTest.liabilityTransferFinancialActivityId, liabilityTransferAccount.getAccountID(), FinancialActivityAccountsTest.LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(),
responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assert.assertNotNull(financialActivityAccountId);
} else { } else {
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData"); HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
if (financialActivityData.get("id").equals(FinancialActivityAccountsTest.liabilityTransferFinancialActivityId)) { if (financialActivityData.get("id").equals(FinancialActivityAccountsTest.LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID)) {
HashMap glAccountData = (HashMap) financialActivity.get("glAccountData"); HashMap glAccountData = (HashMap) financialActivity.get("glAccountData");
liabilityTransferAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY); liabilityTransferAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY);
financialActivityAccountId = (Integer) financialActivity.get("id"); financialActivityAccountId = (Integer) financialActivity.get("id");
@@ -562,7 +562,7 @@ public class ClientSavingsIntegrationTest {
assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due", savingsAccountErrorData assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due", savingsAccountErrorData
.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)); .get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat, Locale.US); SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US);
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
List dates = (List) savingsChargeForPay.get("dueDate"); List dates = (List) savingsChargeForPay.get("dueDate");
cal.set(Calendar.YEAR, (Integer) dates.get(0)); cal.set(Calendar.YEAR, (Integer) dates.get(0));
@@ -51,7 +51,7 @@ public class FinancialActivityAccountsTest {
private AccountHelper accountHelper; private AccountHelper accountHelper;
private FinancialActivityAccountHelper financialActivityAccountHelper; private FinancialActivityAccountHelper financialActivityAccountHelper;
private final Integer assetTransferFinancialActivityId = FinancialActivity.ASSET_TRANSFER.getValue(); private final Integer assetTransferFinancialActivityId = FinancialActivity.ASSET_TRANSFER.getValue();
public static final Integer liabilityTransferFinancialActivityId = FinancialActivity.LIABILITY_TRANSFER.getValue(); public static final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue();
@Before @Before
public void setup() { public void setup() {
@@ -78,7 +78,7 @@ public class FinancialActivityAccountsTest {
/*** Create A Financial Activity to Account Mapping **/ /*** Create A Financial Activity to Account Mapping **/
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
liabilityTransferFinancialActivityId, liabilityTransferAccount.getAccountID(), responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assert.assertNotNull(financialActivityAccountId);
@@ -86,7 +86,7 @@ public class FinancialActivityAccountsTest {
* Fetch Created Financial Activity to Account Mapping and validate * Fetch Created Financial Activity to Account Mapping and validate
* created values * created values
**/ **/
assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, liabilityTransferAccount); assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount);
/** /**
* Update Existing Financial Activity to Account Mapping and assert * Update Existing Financial Activity to Account Mapping and assert
@@ -96,12 +96,12 @@ public class FinancialActivityAccountsTest {
Assert.assertNotNull(newLiabilityTransferAccount); Assert.assertNotNull(newLiabilityTransferAccount);
HashMap changes = (HashMap) financialActivityAccountHelper.updateFinancialActivityAccount(financialActivityAccountId, HashMap changes = (HashMap) financialActivityAccountHelper.updateFinancialActivityAccount(financialActivityAccountId,
liabilityTransferFinancialActivityId, newLiabilityTransferAccount.getAccountID(), responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, newLiabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_CHANGES); CommonConstants.RESPONSE_CHANGES);
Assert.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId")); Assert.assertEquals(newLiabilityTransferAccount.getAccountID(), changes.get("glAccountId"));
/** Validate update works correctly **/ /** Validate update works correctly **/
assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
newLiabilityTransferAccount); newLiabilityTransferAccount);
/** Update with Invalid Financial Activity should fail **/ /** Update with Invalid Financial Activity should fail **/
@@ -113,7 +113,7 @@ public class FinancialActivityAccountsTest {
/** Creating Duplicate Financial Activity should fail **/ /** Creating Duplicate Financial Activity should fail **/
List<HashMap> duplicateFinancialActivityAccountError = (List<HashMap>) financialActivityAccountHelper List<HashMap> duplicateFinancialActivityAccountError = (List<HashMap>) financialActivityAccountHelper
.createFinancialActivityAccount(liabilityTransferFinancialActivityId, liabilityTransferAccount.getAccountID(), .createFinancialActivityAccount(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount.getAccountID(),
responseSpecForDomainRuleViolation, CommonConstants.RESPONSE_ERROR); responseSpecForDomainRuleViolation, CommonConstants.RESPONSE_ERROR);
assertEquals(DuplicateFinancialActivityAccountFoundException.getErrorcode(), assertEquals(DuplicateFinancialActivityAccountFoundException.getErrorcode(),
duplicateFinancialActivityAccountError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)); duplicateFinancialActivityAccountError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
@@ -2659,7 +2659,7 @@ public class FixedDepositTest {
} }
private Account getMappedLiabilityFinancialAccount() { private Account getMappedLiabilityFinancialAccount() {
final Integer liabilityTransferFinancialActivityId = FinancialActivity.LIABILITY_TRANSFER.getValue(); final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue();
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount; final Account financialAccount;
/*** /***
@@ -2667,7 +2667,7 @@ public class FixedDepositTest {
* liability financial accounting mappings * liability financial accounting mappings
*/ */
if (financialActivities.isEmpty()) { if (financialActivities.isEmpty()) {
financialAccount = createLiabilityFinancialAccountTransferType(liabilityTransferFinancialActivityId); financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
} else { } else {
/*** /***
* extract mapped liability financial account * extract mapped liability financial account
@@ -2675,7 +2675,7 @@ public class FixedDepositTest {
Account mappedLiabilityAccount = null; Account mappedLiabilityAccount = null;
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData"); HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
if (financialActivityData.get("id").equals(liabilityTransferFinancialActivityId)) { if (financialActivityData.get("id").equals(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID)) {
HashMap glAccountData = (HashMap) financialActivity.get("glAccountData"); HashMap glAccountData = (HashMap) financialActivity.get("glAccountData");
mappedLiabilityAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY); mappedLiabilityAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY);
break; break;
@@ -2685,23 +2685,23 @@ public class FixedDepositTest {
* If liability transfer is not defined create liability transfer * If liability transfer is not defined create liability transfer
*/ */
if (mappedLiabilityAccount == null) { if (mappedLiabilityAccount == null) {
mappedLiabilityAccount = createLiabilityFinancialAccountTransferType(liabilityTransferFinancialActivityId); mappedLiabilityAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
} }
financialAccount = mappedLiabilityAccount; financialAccount = mappedLiabilityAccount;
} }
return financialAccount; return financialAccount;
} }
private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId) { private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID) {
/*** /***
* Create and verify financial account transfer type is created * Create and verify financial account transfer type is created
*/ */
final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount(); final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount();
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(), this.responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assert.assertNotNull(financialActivityAccountId);
assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, liabilityAccountForMapping); assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping);
return liabilityAccountForMapping; return liabilityAccountForMapping;
} }
@@ -182,7 +182,7 @@ public class GroupLoanIntegrationTest {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("loanId", loanId); map.put("loanId", loanId);
map.put("approvedOnDate", approvedOnDate); map.put("approvedOnDate", approvedOnDate);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("locale", "en"); map.put("locale", "en");
return map; return map;
} }
@@ -696,7 +696,7 @@ public class GroupSavingsIntegrationTest {
Assert.assertEquals(1, charges.size()); Assert.assertEquals(1, charges.size());
HashMap savingsChargeForPay = charges.get(0); HashMap savingsChargeForPay = charges.get(0);
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat, Locale.US); SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US);
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
List dates = (List) savingsChargeForPay.get("dueDate"); List dates = (List) savingsChargeForPay.get("dueDate");
cal.set(Calendar.YEAR, (Integer) dates.get(0)); cal.set(Calendar.YEAR, (Integer) dates.get(0));
@@ -783,7 +783,7 @@ public class GroupSavingsIntegrationTest {
map.put("groupId", groupId); map.put("groupId", groupId);
map.put("productId", productId); map.put("productId", productId);
map.put("submittedOnDate", submittedOnDate); map.put("submittedOnDate", submittedOnDate);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("locale", "en"); map.put("locale", "en");
map.put("isParentAccount", "1"); map.put("isParentAccount", "1");
map.put("isGSIM", "true"); map.put("isGSIM", "true");
@@ -793,7 +793,7 @@ public class GroupSavingsIntegrationTest {
private Map<String, Object> savingsArray(final Integer paymentId, final Integer savingsId, final Integer transactionAmount, final String transactionDate) { private Map<String, Object> savingsArray(final Integer paymentId, final Integer savingsId, final Integer transactionAmount, final String transactionDate) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("locale", "en"); map.put("locale", "en");
map.put("transactionAmount",transactionAmount); map.put("transactionAmount",transactionAmount);
map.put("paymentTypeId", paymentId); map.put("paymentTypeId", paymentId);
@@ -3109,7 +3109,7 @@ public class RecurringDepositTest {
} }
private Account getMappedLiabilityFinancialAccount() { private Account getMappedLiabilityFinancialAccount() {
final Integer liabilityTransferFinancialActivityId = FinancialActivity.LIABILITY_TRANSFER.getValue(); final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID = FinancialActivity.LIABILITY_TRANSFER.getValue();
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount; final Account financialAccount;
/*** /***
@@ -3117,7 +3117,7 @@ public class RecurringDepositTest {
* liability financial accounting mappings * liability financial accounting mappings
*/ */
if (financialActivities.isEmpty()) { if (financialActivities.isEmpty()) {
financialAccount = createLiabilityFinancialAccountTransferType(liabilityTransferFinancialActivityId); financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
} else { } else {
/*** /***
* extract mapped liability financial account * extract mapped liability financial account
@@ -3125,7 +3125,7 @@ public class RecurringDepositTest {
Account mappedLiabilityAccount = null; Account mappedLiabilityAccount = null;
for (HashMap financialActivity : financialActivities) { for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData"); HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
if (financialActivityData.get("id").equals(liabilityTransferFinancialActivityId)) { if (financialActivityData.get("id").equals(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID)) {
HashMap glAccountData = (HashMap) financialActivity.get("glAccountData"); HashMap glAccountData = (HashMap) financialActivity.get("glAccountData");
mappedLiabilityAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY); mappedLiabilityAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY);
break; break;
@@ -3135,23 +3135,23 @@ public class RecurringDepositTest {
* If liability transfer is not defined create liability transfer * If liability transfer is not defined create liability transfer
*/ */
if (mappedLiabilityAccount == null) { if (mappedLiabilityAccount == null) {
mappedLiabilityAccount = createLiabilityFinancialAccountTransferType(liabilityTransferFinancialActivityId); mappedLiabilityAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
} }
financialAccount = mappedLiabilityAccount; financialAccount = mappedLiabilityAccount;
} }
return financialAccount; return financialAccount;
} }
private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId) { private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID) {
/*** /***
* Create and verify financial account transfer type is created * Create and verify financial account transfer type is created
*/ */
final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount(); final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount();
Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(), this.responseSpec, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID); CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId); Assert.assertNotNull(financialActivityAccountId);
assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, liabilityAccountForMapping); assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping);
return liabilityAccountForMapping; return liabilityAccountForMapping;
} }
@@ -930,7 +930,7 @@ public class SchedulerJobsTestResults {
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assert.assertNotNull(clientId); Assert.assertNotNull(clientId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE) Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE)
+ Float.valueOf(FixedDepositAccountHelper.depositAmount); + Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
String.valueOf(balance)); String.valueOf(balance));
Assert.assertNotNull(savingsProductID); Assert.assertNotNull(savingsProductID);
@@ -979,12 +979,12 @@ public class SchedulerJobsTestResults {
HashMap fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId); HashMap fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
Float interestPosted = (Float) fixedDepositSummary.get("accountBalance") Float interestPosted = (Float) fixedDepositSummary.get("accountBalance")
- Float.valueOf(FixedDepositAccountHelper.depositAmount); - Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
String JobName = "Transfer Interest To Savings"; String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId); fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals("Verifying opening Balance", Float.valueOf(FixedDepositAccountHelper.depositAmount), assertEquals("Verifying opening Balance", Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT),
fixedDepositSummary.get("accountBalance")); fixedDepositSummary.get("accountBalance"));
summary = savingsAccountHelper.getSavingsSummary(savingsId); summary = savingsAccountHelper.getSavingsSummary(savingsId);
@@ -33,8 +33,8 @@ public class CalendarHelper {
private static final String BASE_URL = "/fineract-provider/api/v1/"; private static final String BASE_URL = "/fineract-provider/api/v1/";
private static final String PARENT_ENTITY_NAME = "groups/"; private static final String PARENT_ENTITY_NAME = "groups/";
private static final String ENITY_NAME = "/calendars"; private static final String ENITY_NAME = "/calendars";
private static final String Center_Entity = "centers/"; private static final String CENTER__ENTITY = "centers/";
private static final String Edit_Calendar = "editcalendarbasedonmeetingdates/"; private static final String EDIT__CALENDAR = "editcalendarbasedonmeetingdates/";
public static Integer createMeetingCalendarForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, public static Integer createMeetingCalendarForGroup(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer groupId, final String startDate, final String frequency, final String interval, final String repeatsOnDay) { final Integer groupId, final String startDate, final String frequency, final String interval, final String repeatsOnDay) {
@@ -95,7 +95,7 @@ public class CalendarHelper {
LOG.info("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------"); LOG.info("---------------------------------CREATING A MEETING CALENDAR FOR THE GROUP------------------------------");
final String CALENDAR_RESOURCE_URL = BASE_URL + Center_Entity + groupId + ENITY_NAME + "?" + Utils.TENANT_IDENTIFIER; final String CALENDAR_RESOURCE_URL = BASE_URL + CENTER__ENTITY + groupId + ENITY_NAME + "?" + Utils.TENANT_IDENTIFIER;
LOG.info("{}",CALENDAR_RESOURCE_URL); LOG.info("{}",CALENDAR_RESOURCE_URL);
@@ -108,7 +108,7 @@ public class CalendarHelper {
LOG.info("---------------------------------UPADATING A MEETING CALENDAR FOR THE CENTER------------------------------"); LOG.info("---------------------------------UPADATING A MEETING CALENDAR FOR THE CENTER------------------------------");
final String CALENDAR_RESOURCE_URL = BASE_URL + Center_Entity + centerId + ENITY_NAME + "/" + calendarID + "?" final String CALENDAR_RESOURCE_URL = BASE_URL + CENTER__ENTITY + centerId + ENITY_NAME + "/" + calendarID + "?"
+ Utils.TENANT_IDENTIFIER; + Utils.TENANT_IDENTIFIER;
LOG.info("{}",CALENDAR_RESOURCE_URL); LOG.info("{}",CALENDAR_RESOURCE_URL);
@@ -348,8 +348,8 @@ public class ClientHelper {
Integer closureReasonId = (Integer) codeValue.get("id"); Integer closureReasonId = (Integer) codeValue.get("id");
map.put("closureReasonId", closureReasonId.toString()); map.put("closureReasonId", closureReasonId.toString());
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closureDate", CREATED_DATE_PLUS_ONE); map.put("closureDate", CREATED_DATE_PLUS_ONE);
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
@@ -360,8 +360,8 @@ public class ClientHelper {
private String getReactivateClientAsJSON() { private String getReactivateClientAsJSON() {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("reactivationDate", CREATED_DATE_PLUS_ONE); map.put("reactivationDate", CREATED_DATE_PLUS_ONE);
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
LOG.info(clientJson); LOG.info(clientJson);
@@ -371,8 +371,8 @@ public class ClientHelper {
private String getUndoRejectClientAsJSON(final String date) { private String getUndoRejectClientAsJSON(final String date) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("reopenedDate", date); map.put("reopenedDate", date);
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
LOG.info(clientJson); LOG.info(clientJson);
@@ -382,8 +382,8 @@ public class ClientHelper {
private String getUndoWithdrawnClientAsJSON(final String date) { private String getUndoWithdrawnClientAsJSON(final String date) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("reopenedDate", date); map.put("reopenedDate", date);
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
LOG.info(clientJson); LOG.info(clientJson);
@@ -403,8 +403,8 @@ public class ClientHelper {
this.requestSpec, this.responseSpec); this.requestSpec, this.responseSpec);
Integer rejectionReasonId = (Integer) codeValue.get("id"); Integer rejectionReasonId = (Integer) codeValue.get("id");
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("rejectionDate", CREATED_DATE_PLUS_ONE); map.put("rejectionDate", CREATED_DATE_PLUS_ONE);
map.put("rejectionReasonId", rejectionReasonId.toString()); map.put("rejectionReasonId", rejectionReasonId.toString());
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
@@ -415,8 +415,8 @@ public class ClientHelper {
private String getActivateClientAsJSON(String date) { private String getActivateClientAsJSON(String date) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("activationDate", date); map.put("activationDate", date);
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
LOG.info(clientJson); LOG.info(clientJson);
@@ -435,8 +435,8 @@ public class ClientHelper {
this.requestSpec, this.responseSpec); this.requestSpec, this.responseSpec);
Integer withdrawalReasonId = (Integer) codeValue.get("id"); Integer withdrawalReasonId = (Integer) codeValue.get("id");
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("withdrawalDate", CREATED_DATE_PLUS_ONE); map.put("withdrawalDate", CREATED_DATE_PLUS_ONE);
map.put("withdrawalReasonId", withdrawalReasonId.toString()); map.put("withdrawalReasonId", withdrawalReasonId.toString());
String clientJson = new Gson().toJson(map); String clientJson = new Gson().toJson(map);
@@ -21,8 +21,8 @@ package org.apache.fineract.integrationtests.common;
public interface CommonConstants { public interface CommonConstants {
public final static String locale = "en"; public final static String LOCALE = "en";
public static final String dateFormat = "dd MMMM yyyy"; public static final String DATE_FORMAT = "dd MMMM yyyy";
public static final String RESPONSE_RESOURCE_ID = "resourceId"; public static final String RESPONSE_RESOURCE_ID = "resourceId";
public static final String RESPONSE_CHANGES = "changes"; public static final String RESPONSE_CHANGES = "changes";
public static final String RESPONSE_STATUS = "status"; public static final String RESPONSE_STATUS = "status";
@@ -72,11 +72,11 @@ public class ChargesHelper {
private static final Integer CHARGE_FEE_FREQUENCY_YEARS = 3; private static final Integer CHARGE_FEE_FREQUENCY_YEARS = 3;
private final static boolean active = true; private final static boolean active = true;
private final static boolean penalty = true; private final static boolean PENALTY = true;
private final static String amount = "100"; private final static String amount = "100";
private final static String currencyCode = "USD"; private final static String currencyCode = "USD";
public final static String feeOnMonthDay = "04 March"; public final static String feeOnMonthDay = "04 March";
private final static String monthDayFormat = "dd MMM"; private final static String MONTH_DAY_FORMAT = "dd MMM";
public static String getSavingsSpecifiedDueDateJSON() { public static String getSavingsSpecifiedDueDateJSON() {
final HashMap<String, Object> map = populateDefaultsForSavings(); final HashMap<String, Object> map = populateDefaultsForSavings();
@@ -154,8 +154,8 @@ public class ChargesHelper {
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS); map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS);
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("currencyCode", currencyCode); map.put("currencyCode", currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("monthDayFormat", ChargesHelper.monthDayFormat); map.put("monthDayFormat", ChargesHelper.MONTH_DAY_FORMAT);
map.put("name", Utils.randomNameGenerator("Charge_Savings_", 6)); map.put("name", Utils.randomNameGenerator("Charge_Savings_", 6));
return map; return map;
} }
@@ -188,7 +188,7 @@ public class ChargesHelper {
public static String getLoanSpecifiedDueDateJSON() { public static String getLoanSpecifiedDueDateJSON() {
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount,
ChargesHelper.penalty); ChargesHelper.PENALTY);
} }
public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount, public static String getLoanSpecifiedDueDateJSON(final Integer chargeCalculationType, final String amount,
@@ -219,7 +219,7 @@ public class ChargesHelper {
public static String getLoanSpecifiedDueDateWithAccountTransferJSON() { public static String getLoanSpecifiedDueDateWithAccountTransferJSON() {
return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, return getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount,
ChargesHelper.penalty, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); ChargesHelper.PENALTY, ChargesHelper.CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
} }
public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount, public static String getLoanInstallmentJSON(final Integer chargeCalculationType, final String amount,
@@ -250,7 +250,7 @@ public class ChargesHelper {
public static String getLoanInstallmentFeeJSON() { public static String getLoanInstallmentFeeJSON() {
return getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount, return getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, ChargesHelper.amount,
ChargesHelper.penalty); ChargesHelper.PENALTY);
} }
public static String getShareAccountActivationChargeJson() { public static String getShareAccountActivationChargeJson() {
@@ -276,7 +276,7 @@ public class ChargesHelper {
public static String getLoanOverdueFeeJSON() { public static String getLoanOverdueFeeJSON() {
final HashMap<String, Object> map = populateDefaultsForLoan(); final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("penalty", ChargesHelper.penalty); map.put("penalty", ChargesHelper.PENALTY);
map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR); map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE); map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
@@ -289,7 +289,7 @@ public class ChargesHelper {
public static String getLoanOverdueFeeJSONWithCalculattionTypePercentage(String penaltyPercentageAmount) { public static String getLoanOverdueFeeJSONWithCalculattionTypePercentage(String penaltyPercentageAmount) {
final HashMap<String, Object> map = populateDefaultsForLoan(); final HashMap<String, Object> map = populateDefaultsForLoan();
map.put("penalty", ChargesHelper.penalty); map.put("penalty", ChargesHelper.PENALTY);
map.put("amount", penaltyPercentageAmount); map.put("amount", penaltyPercentageAmount);
map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR); map.put("chargePaymentMode", ChargesHelper.CHARGE_PAYMENT_MODE_REGULAR);
map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE); map.put("chargeTimeType", CHARGE_OVERDUE_INSTALLMENT_FEE);
@@ -306,8 +306,8 @@ public class ChargesHelper {
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN); map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN);
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("currencyCode", ChargesHelper.currencyCode); map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("monthDayFormat", ChargesHelper.monthDayFormat); map.put("monthDayFormat", ChargesHelper.MONTH_DAY_FORMAT);
map.put("name", Utils.randomNameGenerator("Charge_Loans_", 6)); map.put("name", Utils.randomNameGenerator("Charge_Loans_", 6));
return map; return map;
} }
@@ -320,8 +320,8 @@ public class ChargesHelper {
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("chargeTimeType", ChargesHelper.CHARGE_SPECIFIED_DUE_DATE); map.put("chargeTimeType", ChargesHelper.CHARGE_SPECIFIED_DUE_DATE);
map.put("currencyCode", ChargesHelper.currencyCode); map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("monthDayFormat", ChargesHelper.monthDayFormat); map.put("monthDayFormat", ChargesHelper.MONTH_DAY_FORMAT);
map.put("name", Utils.randomNameGenerator("Charge_client_", 8)); map.put("name", Utils.randomNameGenerator("Charge_client_", 8));
return map; return map;
} }
@@ -334,7 +334,7 @@ public class ChargesHelper {
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("chargeTimeType", ChargesHelper.SHAREACCOUNT_ACTIVATION); map.put("chargeTimeType", ChargesHelper.SHAREACCOUNT_ACTIVATION);
map.put("currencyCode", ChargesHelper.currencyCode); map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("name", Utils.randomNameGenerator("Charge_Share_Activation_", 8)); map.put("name", Utils.randomNameGenerator("Charge_Share_Activation_", 8));
return map; return map;
} }
@@ -347,7 +347,7 @@ public class ChargesHelper {
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("chargeTimeType", ChargesHelper.SHARE_PURCHASE); map.put("chargeTimeType", ChargesHelper.SHARE_PURCHASE);
map.put("currencyCode", ChargesHelper.currencyCode); map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("name", Utils.randomNameGenerator("Charge_Share_Purchase_", 8)); map.put("name", Utils.randomNameGenerator("Charge_Share_Purchase_", 8));
return map; return map;
} }
@@ -360,7 +360,7 @@ public class ChargesHelper {
map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT); map.put("chargeCalculationType", ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT);
map.put("chargeTimeType", ChargesHelper.SHARE_REDEEM); map.put("chargeTimeType", ChargesHelper.SHARE_REDEEM);
map.put("currencyCode", ChargesHelper.currencyCode); map.put("currencyCode", ChargesHelper.currencyCode);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("name", Utils.randomNameGenerator("Charge_Share_Redeem_", 8)); map.put("name", Utils.randomNameGenerator("Charge_Share_Redeem_", 8));
return map; return map;
} }
@@ -403,7 +403,7 @@ public class ChargesHelper {
public static String getModifyChargeJSON() { public static String getModifyChargeJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("amount", "200.0"); map.put("amount", "200.0");
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
LOG.info("{}", json); LOG.info("{}", json);
@@ -412,7 +412,7 @@ public class ChargesHelper {
public static String getModifyWithdrawalFeeSavingsChargeJSON() { public static String getModifyWithdrawalFeeSavingsChargeJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
LOG.info("{}", json); LOG.info("{}", json);
@@ -421,7 +421,7 @@ public class ChargesHelper {
public static String getModifyChargeAsPecentageAmountJSON() { public static String getModifyChargeAsPecentageAmountJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -431,7 +431,7 @@ public class ChargesHelper {
public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() { public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -441,7 +441,7 @@ public class ChargesHelper {
public static String getModifyChargeAsPercentageInterestJSON() { public static String getModifyChargeAsPercentageInterestJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -451,7 +451,7 @@ public class ChargesHelper {
public static String getModifyChargeFeeFrequencyAsDaysJSON() { public static String getModifyChargeFeeFrequencyAsDaysJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -461,7 +461,7 @@ public class ChargesHelper {
public static String getModifyChargeFeeFrequencyAsWeeksJSON() { public static String getModifyChargeFeeFrequencyAsWeeksJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -471,7 +471,7 @@ public class ChargesHelper {
public static String getModifyChargeFeeFrequencyAsMonthsJSON() { public static String getModifyChargeFeeFrequencyAsMonthsJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -481,7 +481,7 @@ public class ChargesHelper {
public static String getModifyChargeFeeFrequencyAsYearsJSON() { public static String getModifyChargeFeeFrequencyAsYearsJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -71,7 +71,7 @@ public class FixedDepositAccountHelper {
private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2"; private static final String INTEREST_CALCULATION_USING_AVERAGE_DAILY_BALANCE = "2";
private static final String DAYS_360 = "360"; private static final String DAYS_360 = "360";
private static final String DAYS_365 = "365"; private static final String DAYS_365 = "365";
public final static String depositAmount = "100000"; public final static String DEPOSIT_AMOUNT = "100000";
private String newDepositAmount = null; private String newDepositAmount = null;
private String interestCompoundingPeriodType = MONTHLY; private String interestCompoundingPeriodType = MONTHLY;
@@ -324,8 +324,8 @@ public class FixedDepositAccountHelper {
private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) { private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("approvedOnDate", approvedOnDate); map.put("approvedOnDate", approvedOnDate);
map.put("note", "Approval NOTE"); map.put("note", "Approval NOTE");
String fixedDepositAccountApproveJson = new Gson().toJson(map); String fixedDepositAccountApproveJson = new Gson().toJson(map);
@@ -335,8 +335,8 @@ public class FixedDepositAccountHelper {
private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) { private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
map.put("note", "Rejected NOTE"); map.put("note", "Rejected NOTE");
String fixedDepositAccountJson = new Gson().toJson(map); String fixedDepositAccountJson = new Gson().toJson(map);
@@ -346,8 +346,8 @@ public class FixedDepositAccountHelper {
private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) { private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("withdrawnOnDate", withdrawnApplicationOnDate);
map.put("note", "Withdraw NOTE"); map.put("note", "Withdraw NOTE");
String fixedDepositAccountJson = new Gson().toJson(map); String fixedDepositAccountJson = new Gson().toJson(map);
@@ -357,8 +357,8 @@ public class FixedDepositAccountHelper {
private String getActivatedFixedDepositAccountAsJSON(final String activationDate) { private String getActivatedFixedDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("activatedOnDate", activationDate); map.put("activatedOnDate", activationDate);
String fixedDepositAccountActivateJson = new Gson().toJson(map); String fixedDepositAccountActivateJson = new Gson().toJson(map);
LOG.info("{}", fixedDepositAccountActivateJson); LOG.info("{}", fixedDepositAccountActivateJson);
@@ -374,8 +374,8 @@ public class FixedDepositAccountHelper {
private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) { private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
String fixedDepositAccountPrematureClosureJson = new Gson().toJson(map); String fixedDepositAccountPrematureClosureJson = new Gson().toJson(map);
LOG.info(fixedDepositAccountPrematureClosureJson); LOG.info(fixedDepositAccountPrematureClosureJson);
@@ -385,8 +385,8 @@ public class FixedDepositAccountHelper {
private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType, private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType,
final Integer toSavingsId) { final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
map.put("onAccountClosureId", closureType); map.put("onAccountClosureId", closureType);
if (toSavingsId != null) { if (toSavingsId != null) {
@@ -487,7 +487,7 @@ public class FixedDepositAccountHelper {
private String getDepositAmount() { private String getDepositAmount() {
if (this.newDepositAmount == null) { if (this.newDepositAmount == null) {
return depositAmount; return DEPOSIT_AMOUNT;
} }
return this.newDepositAmount; return this.newDepositAmount;
} }
@@ -40,10 +40,10 @@ public class CurrencyHelper {
private static final String CURRENCY_URL = "/fineract-provider/api/v1/currencies?" + Utils.TENANT_IDENTIFIER; private static final String CURRENCY_URL = "/fineract-provider/api/v1/currencies?" + Utils.TENANT_IDENTIFIER;
private static final String CURRENCY_URL_SELECTED = CURRENCY_URL + "&fields=selectedCurrencyOptions"; private static final String CURRENCY_URL_SELECTED = CURRENCY_URL + "&fields=selectedCurrencyOptions";
private static final List<String> permittedCurrencyArray = Arrays.asList("currencyOptions", private static final List<String> PERMITTED_CURRENCY_ARRAY = Arrays.asList("currencyOptions",
"selectedCurrencyOptions"); "selectedCurrencyOptions");
private static final List<String> permittedCurrencyArraySelected = Arrays.asList("selectedCurrencyOptions"); private static final List<String> PERMITTED_CURRENCY_ARRAY_SELECTED = Arrays.asList("selectedCurrencyOptions");
private final RequestSpecification requestSpec; private final RequestSpecification requestSpec;
private final ResponseSpecification responseSpec; private final ResponseSpecification responseSpec;
@@ -54,11 +54,11 @@ public class CurrencyHelper {
} }
public ArrayList<Currency> getPermittedCurrencies() { public ArrayList<Currency> getPermittedCurrencies() {
return getCurrencies(CURRENCY_URL, permittedCurrencyArray); return getCurrencies(CURRENCY_URL, PERMITTED_CURRENCY_ARRAY);
} }
public ArrayList<Currency> getSelectedCurrencies() { public ArrayList<Currency> getSelectedCurrencies() {
return getCurrencies(CURRENCY_URL_SELECTED, permittedCurrencyArraySelected); return getCurrencies(CURRENCY_URL_SELECTED, PERMITTED_CURRENCY_ARRAY_SELECTED);
} }
private ArrayList<Currency> getCurrencies(final String getUrl, final List<String> permittedCurrencyArrays) { private ArrayList<Currency> getCurrencies(final String getUrl, final List<String> permittedCurrencyArrays) {
@@ -379,8 +379,8 @@ public class RecurringDepositAccountHelper {
private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) { private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("approvedOnDate", approvedOnDate); map.put("approvedOnDate", approvedOnDate);
map.put("note", "Approval NOTE"); map.put("note", "Approval NOTE");
String recurringDepositAccountApproveJson = new Gson().toJson(map); String recurringDepositAccountApproveJson = new Gson().toJson(map);
@@ -390,8 +390,8 @@ public class RecurringDepositAccountHelper {
private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) { private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
map.put("transactionAmount", transactionAmount); map.put("transactionAmount", transactionAmount);
String updateTransactionJson = new Gson().toJson(map); String updateTransactionJson = new Gson().toJson(map);
@@ -401,8 +401,8 @@ public class RecurringDepositAccountHelper {
private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) { private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
map.put("note", "Rejected NOTE"); map.put("note", "Rejected NOTE");
String recurringDepositAccountJson = new Gson().toJson(map); String recurringDepositAccountJson = new Gson().toJson(map);
@@ -412,8 +412,8 @@ public class RecurringDepositAccountHelper {
private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) { private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("withdrawnOnDate", withdrawnApplicationOnDate);
map.put("note", "Withdraw NOTE"); map.put("note", "Withdraw NOTE");
String recurringDepositAccountJson = new Gson().toJson(map); String recurringDepositAccountJson = new Gson().toJson(map);
@@ -423,8 +423,8 @@ public class RecurringDepositAccountHelper {
private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) { private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("activatedOnDate", activationDate); map.put("activatedOnDate", activationDate);
String recurringDepositAccountActivateJson = new Gson().toJson(map); String recurringDepositAccountActivateJson = new Gson().toJson(map);
LOG.info(recurringDepositAccountActivateJson); LOG.info(recurringDepositAccountActivateJson);
@@ -440,8 +440,8 @@ public class RecurringDepositAccountHelper {
private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) { private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map); String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
LOG.info(recurringDepositAccountPrematureClosureJson); LOG.info(recurringDepositAccountPrematureClosureJson);
@@ -450,8 +450,8 @@ public class RecurringDepositAccountHelper {
private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) { private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("transactionAmount", depositAmount); map.put("transactionAmount", depositAmount);
map.put("transactionDate", depositedOnDate); map.put("transactionDate", depositedOnDate);
String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map); String recurringDepositAccountPrematureClosureJson = new Gson().toJson(map);
@@ -462,8 +462,8 @@ public class RecurringDepositAccountHelper {
private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate,
final String closureType, final Integer toSavingsId) { final String closureType, final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
map.put("onAccountClosureId", closureType); map.put("onAccountClosureId", closureType);
if (toSavingsId != null) { if (toSavingsId != null) {
@@ -88,7 +88,7 @@ public class SavingsAccountHelper {
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL"; public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final String DATE_TIME_FORMAT = "dd MMMM yyyy HH:mm"; public static final String DATE_TIME_FORMAT = "dd MMMM yyyy HH:mm";
private static final Boolean isBlock = false; private static final Boolean IS_BLOCK = false;
public SavingsAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { public SavingsAccountHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec; this.requestSpec = requestSpec;
@@ -96,7 +96,7 @@ public class SavingsAccountHelper {
} }
public static String getFutureDate() { public static String getFutureDate() {
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.dateFormat, Locale.US); SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1);
return sdf.format(calendar.getTime()); return sdf.format(calendar.getTime());
@@ -190,21 +190,21 @@ public class SavingsAccountHelper {
LOG.info("--------------------------------- APPROVING SAVINGS APPLICATION ------------------------------------"); LOG.info("--------------------------------- APPROVING SAVINGS APPLICATION ------------------------------------");
final String savingsOperationURL = createSavingsOperationURL(APPROVE_SAVINGS_COMMAND, savingsID); final String savingsOperationURL = createSavingsOperationURL(APPROVE_SAVINGS_COMMAND, savingsID);
if (approvalDate == null || approvalDate.equals("")) { if (approvalDate == null || approvalDate.equals("")) {
return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJSON(), isBlock); return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJSON(), IS_BLOCK);
} }
return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJsonOnDate(approvalDate), isBlock); return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJsonOnDate(approvalDate), IS_BLOCK);
} }
public HashMap undoApproval(final Integer savingsID) { public HashMap undoApproval(final Integer savingsID) {
LOG.info("--------------------------------- UNDO APPROVING SAVINGS APPLICATION -------------------------------"); LOG.info("--------------------------------- UNDO APPROVING SAVINGS APPLICATION -------------------------------");
final String undoBodyJson = "{'note':'UNDO APPROVAL'}"; final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
return performSavingApplicationActions(createSavingsOperationURL(UNDO_APPROVAL_SAVINGS_COMMAND, savingsID), undoBodyJson, isBlock); return performSavingApplicationActions(createSavingsOperationURL(UNDO_APPROVAL_SAVINGS_COMMAND, savingsID), undoBodyJson, IS_BLOCK);
} }
public HashMap rejectApplication(final Integer savingsID) { public HashMap rejectApplication(final Integer savingsID) {
LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------");
return performSavingApplicationActions(createSavingsOperationURL(REJECT_SAVINGS_COMMAND, savingsID), return performSavingApplicationActions(createSavingsOperationURL(REJECT_SAVINGS_COMMAND, savingsID),
getRejectedSavingsAsJSON(CREATED_DATE_PLUS_ONE), isBlock); getRejectedSavingsAsJSON(CREATED_DATE_PLUS_ONE), IS_BLOCK);
} }
public List rejectApplicationWithErrorCode(final Integer savingsId, final String date) { public List rejectApplicationWithErrorCode(final Integer savingsId, final String date) {
@@ -216,18 +216,18 @@ public class SavingsAccountHelper {
public HashMap withdrawApplication(final Integer savingsID) { public HashMap withdrawApplication(final Integer savingsID) {
LOG.info("--------------------------------- Withdraw SAVINGS APPLICATION -------------------------------"); LOG.info("--------------------------------- Withdraw SAVINGS APPLICATION -------------------------------");
return performSavingApplicationActions(createSavingsOperationURL(WITHDRAWN_BY_CLIENT_SAVINGS_COMMAND, savingsID), return performSavingApplicationActions(createSavingsOperationURL(WITHDRAWN_BY_CLIENT_SAVINGS_COMMAND, savingsID),
getWithdrawnSavingsAsJSON(), isBlock); getWithdrawnSavingsAsJSON(), IS_BLOCK);
} }
public HashMap activateSavings(final Integer savingsID) { public HashMap activateSavings(final Integer savingsID) {
LOG.info("---------------------------------- ACTIVATING SAVINGS APPLICATION ----------------------------------"); LOG.info("---------------------------------- ACTIVATING SAVINGS APPLICATION ----------------------------------");
return performSavingApplicationActions(createSavingsOperationURL(ACTIVATE_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), isBlock); return performSavingApplicationActions(createSavingsOperationURL(ACTIVATE_SAVINGS_COMMAND, savingsID), getActivatedSavingsAsJSON(), IS_BLOCK);
} }
public HashMap closeSavingsAccount(final Integer savingsID, String withdrawBalance) { public HashMap closeSavingsAccount(final Integer savingsID, String withdrawBalance) {
LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------");
return performSavingApplicationActions(createSavingsOperationURL(CLOSE_SAVINGS_COMMAND, savingsID), return performSavingApplicationActions(createSavingsOperationURL(CLOSE_SAVINGS_COMMAND, savingsID),
getCloseAccountJSON(withdrawBalance, LAST_TRANSACTION_DATE), isBlock); getCloseAccountJSON(withdrawBalance, LAST_TRANSACTION_DATE), IS_BLOCK);
} }
public Object deleteSavingsApplication(final Integer savingsId, final String jsonAttributeToGetBack) { public Object deleteSavingsApplication(final Integer savingsId, final String jsonAttributeToGetBack) {
@@ -374,8 +374,8 @@ public class SavingsAccountHelper {
private String getApproveSavingsAsJsonOnDate(final String approvalDate) { private String getApproveSavingsAsJsonOnDate(final String approvalDate) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("approvedOnDate", approvalDate); map.put("approvedOnDate", approvalDate);
map.put("note", "Approval NOTE"); map.put("note", "Approval NOTE");
String savingsAccountApproveJson = new Gson().toJson(map); String savingsAccountApproveJson = new Gson().toJson(map);
@@ -385,8 +385,8 @@ public class SavingsAccountHelper {
private String getRejectedSavingsAsJSON(final String rejectedOnDate) { private String getRejectedSavingsAsJSON(final String rejectedOnDate) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
map.put("note", "Rejected NOTE"); map.put("note", "Rejected NOTE");
String savingsAccountJson = new Gson().toJson(map); String savingsAccountJson = new Gson().toJson(map);
@@ -396,8 +396,8 @@ public class SavingsAccountHelper {
private String getWithdrawnSavingsAsJSON() { private String getWithdrawnSavingsAsJSON() {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE); map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE);
map.put("note", "Rejected NOTE"); map.put("note", "Rejected NOTE");
String savingsAccountJson = new Gson().toJson(map); String savingsAccountJson = new Gson().toJson(map);
@@ -407,8 +407,8 @@ public class SavingsAccountHelper {
private String getActivatedSavingsAsJSON() { private String getActivatedSavingsAsJSON() {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("activatedOnDate", TRANSACTION_DATE); map.put("activatedOnDate", TRANSACTION_DATE);
String savingsAccountActivateJson = new Gson().toJson(map); String savingsAccountActivateJson = new Gson().toJson(map);
LOG.info(savingsAccountActivateJson); LOG.info(savingsAccountActivateJson);
@@ -417,8 +417,8 @@ public class SavingsAccountHelper {
private String getSavingsTransactionJSON(final String amount, final String transactionDate) { private String getSavingsTransactionJSON(final String amount, final String transactionDate) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
map.put("transactionAmount", amount); map.put("transactionAmount", amount);
String savingsAccountWithdrawalJson = new Gson().toJson(map); String savingsAccountWithdrawalJson = new Gson().toJson(map);
@@ -435,8 +435,8 @@ public class SavingsAccountHelper {
private String getCalculatedInterestForSavingsApplicationAsJSON(final String today) { private String getCalculatedInterestForSavingsApplicationAsJSON(final String today) {
final HashMap<String, String> map = new HashMap<>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("transactionDate", today); map.put("transactionDate", today);
map.put("postInterestManualOrAutomatic", "true"); map.put("postInterestManualOrAutomatic", "true");
String savingsAccountCalculatedInterestJson = new Gson().toJson(map); String savingsAccountCalculatedInterestJson = new Gson().toJson(map);
@@ -445,8 +445,8 @@ public class SavingsAccountHelper {
private String getSavingsPayChargeJSON(final String amount, final String dueDate) { private String getSavingsPayChargeJSON(final String amount, final String dueDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("amount", amount); map.put("amount", amount);
map.put("dueDate", dueDate); map.put("dueDate", dueDate);
String josn = new Gson().toJson(map); String josn = new Gson().toJson(map);
@@ -455,16 +455,16 @@ public class SavingsAccountHelper {
private String getSavingsWaiveChargeJSON() { private String getSavingsWaiveChargeJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
String josn = new Gson().toJson(map); String josn = new Gson().toJson(map);
return josn; return josn;
} }
private String getModifyChargeJSON() { private String getModifyChargeJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("amount", "50"); map.put("amount", "50");
String josn = new Gson().toJson(map); String josn = new Gson().toJson(map);
return josn; return josn;
@@ -472,8 +472,8 @@ public class SavingsAccountHelper {
private String getCloseAccountJSON(String withdrawBalance, String closedOnDate) { private String getCloseAccountJSON(String withdrawBalance, String closedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
map.put("withdrawBalance", withdrawBalance); map.put("withdrawBalance", withdrawBalance);
map.put("note", "Close Test"); map.put("note", "Close Test");
@@ -484,8 +484,8 @@ public class SavingsAccountHelper {
private String getCloseAccountPostInterestJSON(String withdrawBalance, String closedOnDate) { private String getCloseAccountPostInterestJSON(String withdrawBalance, String closedOnDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
map.put("withdrawBalance", withdrawBalance); map.put("withdrawBalance", withdrawBalance);
map.put("note", "Close Test"); map.put("note", "Close Test");
@@ -585,13 +585,13 @@ public class SavingsAccountHelper {
return response; return response;
} }
private HashMap performSavingApplicationActions(final String postURLForSavingsTransaction, final String jsonToBeSent, final Boolean isBlock) { private HashMap performSavingApplicationActions(final String postURLForSavingsTransaction, final String jsonToBeSent, final Boolean IS_BLOCK) {
HashMap status = null; HashMap status = null;
final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForSavingsTransaction, jsonToBeSent, final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForSavingsTransaction, jsonToBeSent,
CommonConstants.RESPONSE_CHANGES); CommonConstants.RESPONSE_CHANGES);
if (response != null) { if (response != null) {
status = (HashMap) response.get("status"); status = (HashMap) response.get("status");
if (isBlock != null && isBlock) { if (IS_BLOCK != null && IS_BLOCK) {
status = (HashMap) response.get("subStatus"); status = (HashMap) response.get("subStatus");
} }
} }
@@ -623,7 +623,7 @@ public class SavingsAccountHelper {
map.put("chargeId", chargeId); map.put("chargeId", chargeId);
map.put("amount", amount); map.put("amount", amount);
map.put("feeOnMonthDay", "15 January"); map.put("feeOnMonthDay", "15 January");
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("monthDayFormat", "dd MMMM"); map.put("monthDayFormat", "dd MMMM");
map.put("dateFormat", "dd MMMM yyy"); map.put("dateFormat", "dd MMMM yyy");
if(addDueDate){ if(addDueDate){
@@ -637,7 +637,7 @@ public class SavingsAccountHelper {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("chargeId", chargeId); map.put("chargeId", chargeId);
map.put("amount", amount); map.put("amount", amount);
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", "dd MMMM yyy"); map.put("dateFormat", "dd MMMM yyy");
map.put("dueDate", addDueDate); map.put("dueDate", addDueDate);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -646,8 +646,8 @@ public class SavingsAccountHelper {
private String getAccountActivationJSON(final String activationDate) { private String getAccountActivationJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("activatedOnDate", activationDate); map.put("activatedOnDate", activationDate);
String savingsAccountActivateJson = new Gson().toJson(map); String savingsAccountActivateJson = new Gson().toJson(map);
return savingsAccountActivateJson; return savingsAccountActivateJson;
@@ -655,7 +655,7 @@ public class SavingsAccountHelper {
public HashMap activateSavingsAccount(Integer savingsID, String activationDate) { public HashMap activateSavingsAccount(Integer savingsID, String activationDate) {
return performSavingApplicationActions(createSavingsOperationURL(ACTIVATE_SAVINGS_COMMAND, savingsID), return performSavingApplicationActions(createSavingsOperationURL(ACTIVATE_SAVINGS_COMMAND, savingsID),
getAccountActivationJSON(activationDate), isBlock); getAccountActivationJSON(activationDate), IS_BLOCK);
} }
public Object inactivateCharge(final Integer chargeId, final Integer savingsId, final String jsonAttributeToGetBack) { public Object inactivateCharge(final Integer chargeId, final Integer savingsId, final String jsonAttributeToGetBack) {
@@ -665,8 +665,8 @@ public class SavingsAccountHelper {
private String getSavingsInactivateChargeJSON() { private String getSavingsInactivateChargeJSON() {
final HashMap<String, Object> map = new HashMap<>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.DATE_FORMAT);
String josn = new Gson().toJson(map); String josn = new Gson().toJson(map);
return josn; return josn;
} }
@@ -754,15 +754,15 @@ public class SavingsAccountHelper {
final String savingsOperationURL = createSavingsGsimOperationURL(APPROVE_SAVINGS_COMMAND, gsimID); final String savingsOperationURL = createSavingsGsimOperationURL(APPROVE_SAVINGS_COMMAND, gsimID);
if (approvalDate == null || approvalDate.equals("")) { if (approvalDate == null || approvalDate.equals("")) {
return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJSON(), isBlock); return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJSON(), IS_BLOCK);
} }
return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJsonOnDate(approvalDate), isBlock); return performSavingApplicationActions(savingsOperationURL, getApproveSavingsAsJsonOnDate(approvalDate), IS_BLOCK);
} }
public HashMap rejectGsimApplication(final Integer gsimID) { public HashMap rejectGsimApplication(final Integer gsimID) {
LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------"); LOG.info("--------------------------------- REJECT SAVINGS APPLICATION -------------------------------");
return performSavingApplicationActions(createSavingsGsimOperationURL(REJECT_SAVINGS_COMMAND, gsimID), return performSavingApplicationActions(createSavingsGsimOperationURL(REJECT_SAVINGS_COMMAND, gsimID),
getRejectedSavingsAsJSON(CREATED_DATE_PLUS_ONE), isBlock); getRejectedSavingsAsJSON(CREATED_DATE_PLUS_ONE), IS_BLOCK);
} }
@@ -775,7 +775,7 @@ public class SavingsAccountHelper {
public HashMap undoApprovalGsimSavings(final Integer gsimId) { public HashMap undoApprovalGsimSavings(final Integer gsimId) {
LOG.info("--------------------------------- UNDO APPROVING GSIM SAVINGS APPLICATION -------------------------------"); LOG.info("--------------------------------- UNDO APPROVING GSIM SAVINGS APPLICATION -------------------------------");
final String undoBodyJson = "{'note':'UNDO APPROVAL'}"; final String undoBodyJson = "{'note':'UNDO APPROVAL'}";
return performSavingApplicationActions(createSavingsGsimOperationURL(UNDO_APPROVAL_SAVINGS_COMMAND, gsimId), undoBodyJson, isBlock); return performSavingApplicationActions(createSavingsGsimOperationURL(UNDO_APPROVAL_SAVINGS_COMMAND, gsimId), undoBodyJson, IS_BLOCK);
} }
public Integer depositGsimApplication(Integer savingsID, List<Map<String, Object>> savingsArray) { public Integer depositGsimApplication(Integer savingsID, List<Map<String, Object>> savingsArray) {
@@ -798,13 +798,13 @@ public class SavingsAccountHelper {
public HashMap activateGsimSavings(final Integer gsimID) { public HashMap activateGsimSavings(final Integer gsimID) {
LOG.info("---------------------------------- ACTIVATING GSIM SAVINGS APPLICATION ----------------------------------"); LOG.info("---------------------------------- ACTIVATING GSIM SAVINGS APPLICATION ----------------------------------");
return performSavingApplicationActions(createSavingsGsimOperationURL(ACTIVATE_SAVINGS_COMMAND, gsimID), getActivatedSavingsAsJSON(), isBlock); return performSavingApplicationActions(createSavingsGsimOperationURL(ACTIVATE_SAVINGS_COMMAND, gsimID), getActivatedSavingsAsJSON(), IS_BLOCK);
} }
public HashMap closeGsimSavingsAccount(final Integer gsimID, String withdrawBalance) { public HashMap closeGsimSavingsAccount(final Integer gsimID, String withdrawBalance) {
LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------"); LOG.info("---------------------------------- CLOSE SAVINGS APPLICATION ----------------------------------");
return performSavingApplicationActions(createSavingsGsimOperationURL(CLOSE_SAVINGS_COMMAND, gsimID), return performSavingApplicationActions(createSavingsGsimOperationURL(CLOSE_SAVINGS_COMMAND, gsimID),
getCloseAccountJSON(withdrawBalance, LAST_TRANSACTION_DATE), isBlock); getCloseAccountJSON(withdrawBalance, LAST_TRANSACTION_DATE), IS_BLOCK);
} }
public Object closeGsimSavingsAccountAndGetBackRequiredField(final Integer gsimId, String withdrawBalance, public Object closeGsimSavingsAccountAndGetBackRequiredField(final Integer gsimId, String withdrawBalance,
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings({ "rawtypes" })
public class InteropHelper { public class InteropHelper {
private final static Logger log = LoggerFactory.getLogger(InteropHelper.class); private final static Logger LOG = LoggerFactory.getLogger(InteropHelper.class);
private static final String BASE_URL = "/fineract-provider/api/v1/interoperation"; private static final String BASE_URL = "/fineract-provider/api/v1/interoperation";
private static final String HEALTH_URL = BASE_URL + "/health"; private static final String HEALTH_URL = BASE_URL + "/health";
@@ -135,10 +135,10 @@ public class InteropHelper {
*/ */
public String getHealth() { public String getHealth() {
String url = buildUrl(HEALTH_URL); String url = buildUrl(HEALTH_URL);
log.debug("Calling Interoperable GET Health: {}", url); LOG.debug("Calling Interoperable GET Health: {}", url);
String response = Utils.performServerGet(requestSpec, responseSpec, url, null); String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
log.debug("Response Interoperable GET Health: {}", response); LOG.debug("Response Interoperable GET Health: {}", response);
return response; return response;
} }
@@ -147,10 +147,10 @@ public class InteropHelper {
*/ */
public String getParty(InteropIdentifierType idType, String idValue) { public String getParty(InteropIdentifierType idType, String idValue) {
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
log.debug("Calling Interoperable GET Party: {}", url); LOG.debug("Calling Interoperable GET Party: {}", url);
String response = Utils.performServerGet(requestSpec, responseSpec, url, null); String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
log.debug("Response Interoperable GET Party: {}", response); LOG.debug("Response Interoperable GET Party: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
} }
@@ -160,10 +160,10 @@ public class InteropHelper {
public String postParty(InteropIdentifierType idType, String idValue) { public String postParty(InteropIdentifierType idType, String idValue) {
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
String request = buildPartiesJson(); String request = buildPartiesJson();
log.debug("Calling Interoperable POST Party: {}, body: {}", url, request); LOG.debug("Calling Interoperable POST Party: {}, body: {}", url, request);
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
log.debug("Response Interoperable POST Party: {}", response); LOG.debug("Response Interoperable POST Party: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
} }
@@ -173,10 +173,10 @@ public class InteropHelper {
public String deleteParty(InteropIdentifierType idType, String idValue) { public String deleteParty(InteropIdentifierType idType, String idValue) {
String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue);
String request = buildPartiesJson(); String request = buildPartiesJson();
log.debug("Calling Interoperable DELETE Party: {}, body: {}", url, request); LOG.debug("Calling Interoperable DELETE Party: {}, body: {}", url, request);
String response = Utils.performServerDelete(requestSpec, responseSpec, url, request, null); String response = Utils.performServerDelete(requestSpec, responseSpec, url, request, null);
log.debug("Response Interoperable DELETE Party: {}", response); LOG.debug("Response Interoperable DELETE Party: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID);
} }
@@ -191,10 +191,10 @@ public class InteropHelper {
*/ */
public String getTransactionRequest(String requestCode) { public String getTransactionRequest(String requestCode) {
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + REQUESTS_URL_PARAM + '/' + requestCode); String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + REQUESTS_URL_PARAM + '/' + requestCode);
log.debug("Calling Interoperable GET Request: {}", url); LOG.debug("Calling Interoperable GET Request: {}", url);
String response = Utils.performServerGet(requestSpec, responseSpec, url, null); String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
log.debug("Response Interoperable GET Request: {}", response); LOG.debug("Response Interoperable GET Request: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_REQUEST_CODE); return getJsonAttribute(response, InteropUtil.PARAM_REQUEST_CODE);
} }
@@ -205,10 +205,10 @@ public class InteropHelper {
public String postTransactionRequest(String requestCode, InteropTransactionRole role) { public String postTransactionRequest(String requestCode, InteropTransactionRole role) {
String url = buildUrl(REQUESTS_URL); String url = buildUrl(REQUESTS_URL);
String request = buildTransactionRequestJson(requestCode, role); String request = buildTransactionRequestJson(requestCode, role);
log.debug("Calling Interoperable POST Request: {}, body: {}", url, request); LOG.debug("Calling Interoperable POST Request: {}, body: {}", url, request);
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
log.debug("Response Interoperable POST Request: {}", response); LOG.debug("Response Interoperable POST Request: {}", response);
return response; return response;
} }
@@ -238,10 +238,10 @@ public class InteropHelper {
*/ */
public String getQuote(String quoteCode) { public String getQuote(String quoteCode) {
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + QUOTES_URL_PARAM + '/' + quoteCode); String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + QUOTES_URL_PARAM + '/' + quoteCode);
log.debug("Calling Interoperable GET Quote: {}", url); LOG.debug("Calling Interoperable GET Quote: {}", url);
String response = Utils.performServerGet(requestSpec, responseSpec, url, null); String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
log.debug("Response Interoperable GET Quote: {}", response); LOG.debug("Response Interoperable GET Quote: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_QUOTE_CODE); return getJsonAttribute(response, InteropUtil.PARAM_QUOTE_CODE);
} }
@@ -251,10 +251,10 @@ public class InteropHelper {
public String postQuote(String quoteCode, InteropTransactionRole role) { public String postQuote(String quoteCode, InteropTransactionRole role) {
String url = buildUrl(QUOTES_URL); String url = buildUrl(QUOTES_URL);
String request = buildQuoteJson(quoteCode, role); String request = buildQuoteJson(quoteCode, role);
log.debug("Calling Interoperable POST Quote: {}, body: {}", url, request); LOG.debug("Calling Interoperable POST Quote: {}, body: {}", url, request);
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
log.debug("Response Interoperable POST Quote: {}", response); LOG.debug("Response Interoperable POST Quote: {}", response);
return response; return response;
} }
@@ -286,10 +286,10 @@ public class InteropHelper {
*/ */
public String getTransfer(String transferCode) { public String getTransfer(String transferCode) {
String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + TRANSFERS_URL_PARAM + '/' + transferCode); String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + TRANSFERS_URL_PARAM + '/' + transferCode);
log.debug("Calling Interoperable GET Transfer: {}", url); LOG.debug("Calling Interoperable GET Transfer: {}", url);
String response = Utils.performServerGet(requestSpec, responseSpec, url, null); String response = Utils.performServerGet(requestSpec, responseSpec, url, null);
log.debug("Response Interoperable GET Transfer: {}", response); LOG.debug("Response Interoperable GET Transfer: {}", response);
return getJsonAttribute(response, InteropUtil.PARAM_TRANSFER_CODE); return getJsonAttribute(response, InteropUtil.PARAM_TRANSFER_CODE);
} }
@@ -313,10 +313,10 @@ public class InteropHelper {
public String postTransfer(String transferCode, InteropTransferActionType action, InteropTransactionRole role) { public String postTransfer(String transferCode, InteropTransferActionType action, InteropTransactionRole role) {
String url = buildUrl(TRANSFERS_URL) + '&' + PARAM_TRANSFER_ACTION + '=' + action; String url = buildUrl(TRANSFERS_URL) + '&' + PARAM_TRANSFER_ACTION + '=' + action;
String request = buildTransferJson(transferCode, role); String request = buildTransferJson(transferCode, role);
log.debug("Calling Interoperable POST Transfer: {}, body: {}", url, request); LOG.debug("Calling Interoperable POST Transfer: {}, body: {}", url, request);
String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null);
log.debug("Response Interoperable POST Transfer: {}", response); LOG.debug("Response Interoperable POST Transfer: {}", response);
return response; return response;
} }
@@ -57,7 +57,7 @@ import org.slf4j.LoggerFactory;
public class InteropTest { public class InteropTest {
private final static Logger log = LoggerFactory.getLogger(InteropTest.class); private final static Logger LOG = LoggerFactory.getLogger(InteropTest.class);
private final static String MIN_INTEREST_CALCULATON_BALANCE = null; private final static String MIN_INTEREST_CALCULATON_BALANCE = null;
private final static String MIN_REQUIRED_BALANCE = null; private final static String MIN_REQUIRED_BALANCE = null;
@@ -119,7 +119,7 @@ public class InteropTest {
} }
private void createSavingsProduct() { private void createSavingsProduct() {
log.debug("------------------------------ Create Interoperable Saving Product ---------------------------------------"); LOG.debug("------------------------------ Create Interoperable Saving Product ---------------------------------------");
Account[] accounts = {accountHelper.createAssetAccount(), accountHelper.createIncomeAccount(), accountHelper.createExpenseAccount(), Account[] accounts = {accountHelper.createAssetAccount(), accountHelper.createIncomeAccount(), accountHelper.createExpenseAccount(),
accountHelper.createLiabilityAccount()}; accountHelper.createLiabilityAccount()};
@@ -140,7 +140,7 @@ public class InteropTest {
savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec); savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
Assert.assertNotNull(savingsProductId); Assert.assertNotNull(savingsProductId);
log.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId); LOG.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId);
} }
private void createCharge() { private void createCharge() {
@@ -150,7 +150,7 @@ public class InteropTest {
} }
private void openSavingsAccount() { private void openSavingsAccount() {
log.debug("------------------------------ Create Interoperable Saving Account ---------------------------------------"); LOG.debug("------------------------------ Create Interoperable Saving Account ---------------------------------------");
savingsId = savingsAccountHelper.applyForSavingsApplicationWithExternalId(clientId, savingsProductId, ACCOUNT_TYPE_INDIVIDUAL, interopHelper.getAccountExternalId(), true); savingsId = savingsAccountHelper.applyForSavingsApplicationWithExternalId(clientId, savingsProductId, ACCOUNT_TYPE_INDIVIDUAL, interopHelper.getAccountExternalId(), true);
Assert.assertNotNull(savingsId); Assert.assertNotNull(savingsId);
@@ -167,7 +167,7 @@ public class InteropTest {
savingsAccountHelper.addChargesForSavings(savingsId, chargeId, false, interopHelper.getFee()); savingsAccountHelper.addChargesForSavings(savingsId, chargeId, false, interopHelper.getFee());
} }
log.debug("Sucessfully created Interoperable Saving Account (id: {})", savingsId); LOG.debug("Sucessfully created Interoperable Saving Account (id: {})", savingsId);
} }
private void testParties() { private void testParties() {
@@ -245,7 +245,7 @@ public class InteropTest {
// prepare // prepare
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
log.debug("Response Interoperable GET Saving: {}", savings); LOG.debug("Response Interoperable GET Saving: {}", savings);
savingsJson = JsonPath.from(savings); savingsJson = JsonPath.from(savings);
BigDecimal onHold2 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal onHold2 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance2 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); BigDecimal balance2 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
@@ -263,7 +263,7 @@ public class InteropTest {
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
log.debug("Response Interoperable GET Saving: {}", savings); LOG.debug("Response Interoperable GET Saving: {}", savings);
savingsJson = JsonPath.from(savings); savingsJson = JsonPath.from(savings);
BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);
@@ -277,7 +277,7 @@ public class InteropTest {
Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE));
savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null);
log.debug("Response Interoperable GET Saving: {}", savings); LOG.debug("Response Interoperable GET Saving: {}", savings);
savingsJson = JsonPath.from(savings); savingsJson = JsonPath.from(savings);
BigDecimal onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class);
BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class);