peter-kovacs-dpc commented on code in PR #6432:
URL: https://github.com/apache/fineract/pull/6432#discussion_r3996385754


##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalStepDef.java:
##########
@@ -784,6 +830,53 @@ public void 
createWorkingCapitalLoanProductWithAccountingRule(final String accou
         
testContext().set(TestContextKey.WORKING_CAPITAL_LOAN_PRODUCT_CREATE_REQUEST, 
request);
     }
 
+    @When("Admin creates a new Working Capital Loan Product with the following 
matrix data:")
+    public void createWorkingCapitalLoanProductWithMatrixData(final DataTable 
table) {
+        final Map<String, String> data = table.asMaps().getFirst();
+        final String name = 
Optional.ofNullable(data.get(NAME_FIELD_NAME)).filter(s -> 
!s.isEmpty()).orElseGet(
+                () -> DefaultWorkingCapitalLoanProduct.WCLP.getName() + 
Utils.randomStringGenerator("_", RANDOM_NAME_SUFFIX_LENGTH));
+
+        final String accountingRule = 
Optional.ofNullable(data.get("accountingRule")).orElse("NONE");
+        final PostWorkingCapitalLoanProductsRequest request = 
baseWorkingCapitalLoanProductRequest(accountingRule, name);
+        applyMatrixOverrides(request, data);
+
+        final PostWorkingCapitalLoanProductsResponse response = 
createWorkingCapitalLoanProduct(request);
+        
testContext().set(TestContextKey.WORKING_CAPITAL_LOAN_PRODUCT_CREATE_RESPONSE, 
response);
+        
testContext().set(TestContextKey.WORKING_CAPITAL_LOAN_PRODUCT_CREATE_REQUEST, 
request);
+        checkWorkingCapitalLoanProductCreate();
+    }
+
+    private PostWorkingCapitalLoanProductsRequest 
baseWorkingCapitalLoanProductRequest(final String accountingRule, final String 
name) {
+        if ("ACC_DEF_REV_AM".equals(accountingRule)) {

Review Comment:
   rewritten



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to