Merge pull request #623 from vishwasbabu/develop

fixing failing unit tests after accounting changes
This commit is contained in:
Vishwas Babu A J
2013-10-05 12:24:46 -07:00
3 changed files with 17 additions and 1 deletions
@@ -63,8 +63,9 @@ public class AccountingScenarioIntegrationTest {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
final Integer loanProductID = createLoanProduct(assetAccount, incomeAccount, expenseAccount);
final Integer loanProductID = createLoanProduct(assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
@@ -39,4 +39,11 @@ public class AccountHelper {
return new Account(accountID, Account.AccountType.EXPENSE);
}
public Account createLiabilityAccount() {
final String assetAccountJSON = new GLAccountBuilder().withAccountTypeAsLiability().build();
final Integer accountID = Utils.performServerPost(this.requestSpec, this.responseSpec, this.CREATE_GL_ACCOUNT_URL,
assetAccountJSON, this.GL_ACCOUNT_ID_RESPONSE);
return new Account(accountID, Account.AccountType.LIABILITY);
}
}
@@ -209,6 +209,10 @@ public class LoanProductTestBuilder {
final String ID = this.accountList[i].getAccountID().toString();
map.put("writeOffAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.LIABILITY)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("overpaymentLiabilityAccountId", ID);
}
}
return map;
}
@@ -236,6 +240,10 @@ public class LoanProductTestBuilder {
final String ID = this.accountList[i].getAccountID().toString();
map.put("writeOffAccountId", ID);
}
if (this.accountList[i].getAccountType().equals(Account.AccountType.LIABILITY)) {
final String ID = this.accountList[i].getAccountID().toString();
map.put("overpaymentLiabilityAccountId", ID);
}
}
return map;