FINERACT-1396: Bulk Import Feature
This commit is contained in:
+14
@@ -47,6 +47,7 @@ import org.apache.fineract.integrationtests.common.OfficeDomain;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
|
||||
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||
@@ -66,6 +67,7 @@ public class LoanImportHandlerTest {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LoanImportHandlerTest.class);
|
||||
private static final String CREATE_CLIENT_URL = "/fineract-provider/api/v1/clients?" + Utils.TENANT_IDENTIFIER;
|
||||
private static final String CREATE_CHARGE_URL = "/fineract-provider/api/v1/charges?" + Utils.TENANT_IDENTIFIER;
|
||||
public static final String DATE_FORMAT = "dd MMMM yyyy";
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
@@ -120,6 +122,14 @@ public class LoanImportHandlerTest {
|
||||
collateralHashMap.put("quantity", "1");
|
||||
collaterals.add(collateralHashMap);
|
||||
|
||||
final String disbursementChargeJsonString = ChargesHelper.getLoanDisbursementJSON();
|
||||
|
||||
final Integer disbursementChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, disbursementChargeJsonString);
|
||||
|
||||
final JsonPath disbursementChargeJSON = JsonPath.from(disbursementChargeJsonString);
|
||||
|
||||
Assertions.assertNotNull(disbursementChargeId, "Could not create charge");
|
||||
|
||||
// in order to populate helper sheets
|
||||
Integer outcome_group_creation = GroupHelper.createGroup(requestSpec, responseSpec, true);
|
||||
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
|
||||
@@ -200,6 +210,10 @@ public class LoanImportHandlerTest {
|
||||
firstLoanRow.createCell(LoanConstants.REPAYMENT_TYPE_COL).setCellValue(paymentTypeName);
|
||||
firstLoanRow.createCell(LoanConstants.LOAN_COLLATERAL_ID).setCellValue(collaterals.get(0).get("clientCollateralId").toString());
|
||||
firstLoanRow.createCell(LoanConstants.LOAN_COLLATERAL_QUANTITY).setCellValue(collaterals.get(0).get("quantity").toString());
|
||||
firstLoanRow.createCell(LoanConstants.CHARGE_NAME_1).setCellValue(disbursementChargeJSON.getString("name"));
|
||||
firstLoanRow.createCell(LoanConstants.CHARGE_AMOUNT_1).setCellValue(disbursementChargeJSON.getFloat("amount"));
|
||||
firstLoanRow.createCell(LoanConstants.CHARGE_AMOUNT_TYPE_1)
|
||||
.setCellValue(disbursementChargeJSON.getString("chargeCalculationType.value"));
|
||||
|
||||
String currentdirectory = new File("").getAbsolutePath();
|
||||
File directory = new File(currentdirectory + File.separator + "src" + File.separator + "integrationTest" + File.separator
|
||||
|
||||
Reference in New Issue
Block a user