MIFOSX-1398 update api-docs and fix jenkins issues

This commit is contained in:
Madhukar
2014-07-10 12:32:13 +05:30
parent 8edcaf934e
commit 14989c0ccf
5 changed files with 148 additions and 38 deletions
+74 -27
View File
@@ -17763,36 +17763,83 @@ Request Body:
<code class="method-request">POST savingsaccount/5?command=close
Content-Type: application/json
Request Body:
{
"dateFormat":"dd MMMM yyyy",
"locale":"en",
"closedOnDate":"26 August 2013",
"note":"close note"
}
{
"dateFormat":"dd MMMM yyyy",
"locale":"en",
"closedOnDate":"26 August 2013",
"note":"close note"
}
</code>
<code class="method-response">
{
"officeId":1,
"clientId":1,
"savingsId":5,
"resourceId":5,
"changes":{
"status":{
"id":600,
"code":"savingsAccountStatusType.closed",
"value":"Closed",
"submittedAndPendingApproval":false,
"approved":false,
"rejected":false,
"withdrawnByApplicant":false,
"active":false,
"closed":true
},
"locale":"en",
"dateFormat":"dd MMMM yyyy",
"closedOnDate":"26 August 2013",
"note":"close note"
}
"officeId":1,
"clientId":1,
"savingsId":5,
"resourceId":5,
"changes":{
"status":{
"id":600,
"code":"savingsAccountStatusType.closed",
"value":"Closed",
"submittedAndPendingApproval":false,
"approved":false,
"rejected":false,
"withdrawnByApplicant":false,
"active":false,
"closed":true
},
"locale":"en",
"dateFormat":"dd MMMM yyyy",
"closedOnDate":"26 August 2013",
"note":"close note"
}
}
</code>
<code class="method-request">POST savingsaccount/5?command=close
Content-Type: application/json
Request Body:
{
"dateFormat":"dd MMMM yyyy",
"locale":"en",
"closedOnDate":"26 August 2013",
"note":"close note",
"withdrawBalance":true,
"paymentTypeId": "14",
"accountNumber": "acc123",
"checkNumber": "che123",
"routingCode": "rou123",
"receiptNumber": "rec123",
"bankNumber": "ban123"
}
</code>
<code class="method-response">
{
"officeId":1,
"clientId":1,
"savingsId":5,
"resourceId":5,
"changes":{
"accountNumber": "acc123",
"checkNumber": "che123",
"routingCode": "rou123",
"receiptNumber": "rec123",
"bankNumber": "ban123",
"status":{
"id":600,
"code":"savingsAccountStatusType.closed",
"value":"Closed",
"submittedAndPendingApproval":false,
"approved":false,
"rejected":false,
"withdrawnByApplicant":false,
"active":false,
"closed":true
},
"locale":"en",
"dateFormat":"dd MMMM yyyy",
"closedOnDate":"26 August 2013",
"note":"close note"
}
}
</code>
</div>
@@ -3,6 +3,7 @@ package org.mifosplatform.integrationtests;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.List;
import org.junit.After;
import org.junit.Assert;
@@ -17,6 +18,7 @@ import org.mifosplatform.integrationtests.common.accounting.AccountHelper;
import org.mifosplatform.integrationtests.common.accounting.FinancialActivityAccountHelper;
import org.mifosplatform.integrationtests.common.accounting.JournalEntry;
import org.mifosplatform.integrationtests.common.accounting.JournalEntryHelper;
import org.mifosplatform.integrationtests.common.accounting.Account.AccountType;
import org.mifosplatform.integrationtests.common.loans.LoanApplicationTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanProductTestBuilder;
import org.mifosplatform.integrationtests.common.loans.LoanStatusChecker;
@@ -76,16 +78,29 @@ public class AccountTransferTest {
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
/** Setup liability transfer account **/
/** Create a Liability and an Asset Transfer Account **/
liabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(liabilityTransferAccount);
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
if (financialActivities.isEmpty()) {
/** Setup liability transfer account **/
/** Create a Liability and an Asset Transfer Account **/
liabilityTransferAccount = accountHelper.createLiabilityAccount();
Assert.assertNotNull(liabilityTransferAccount);
/*** Create A Financial Activity to Account Mapping **/
financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
FinancialActivityAccountsTest.liabilityTransferFinancialActivityId, liabilityTransferAccount.getAccountID(), responseSpec,
CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId);
/*** Create A Financial Activity to Account Mapping **/
financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount(
FinancialActivityAccountsTest.liabilityTransferFinancialActivityId, liabilityTransferAccount.getAccountID(),
responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(financialActivityAccountId);
} else {
for (HashMap financialActivity : financialActivities) {
HashMap financialActivityData = (HashMap) financialActivity.get("financialActivityData");
if (financialActivityData.get("id").equals(FinancialActivityAccountsTest.liabilityTransferFinancialActivityId)) {
HashMap glAccountData = (HashMap) financialActivity.get("glAccountData");
liabilityTransferAccount = new Account((Integer) glAccountData.get("id"), AccountType.LIABILITY);
financialActivityAccountId = (Integer) financialActivity.get("id");
break;
}
}
}
}
/**
@@ -7,6 +7,7 @@ import java.util.List;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
@@ -127,4 +128,19 @@ public class FinancialActivityAccountsTest {
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
/**
* Delete the Financial activities
*/
@After
public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
}
}
@@ -15,6 +15,7 @@ import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.Months;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -88,6 +89,7 @@ public class FixedDepositTest {
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
}
/***
@@ -240,7 +242,6 @@ public class FixedDepositTest {
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
/***
* Create GL Accounts for product account mapping
@@ -2040,4 +2041,19 @@ public class FixedDepositTest {
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
/**
* Delete the Liability transfer account
*/
@After
public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
}
}
@@ -14,6 +14,7 @@ import net.sf.ehcache.transaction.xa.EhcacheXAException;
import org.joda.time.DateTime;
import org.joda.time.Months;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -90,6 +91,7 @@ public class RecurringDepositTest {
this.requestSpec.header("X-Mifos-Platform-TenantId", "default");
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
}
/***
@@ -253,7 +255,6 @@ public class RecurringDepositTest {
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
this.financialActivityAccountHelper = new FinancialActivityAccountHelper(this.requestSpec);
/***
* Create GL Accounts for product account mapping
@@ -2568,4 +2569,19 @@ public class RecurringDepositTest {
Assert.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assert.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
}
/**
* Delete the Liability transfer account
*/
@After
public void tearDown() {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assert.assertNotNull(deletedFinancialActivityAccountId);
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
}
}