budaidev commented on code in PR #6005:
URL: https://github.com/apache/fineract/pull/6005#discussion_r3448376279
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/FeignLoanTestBase.java:
##########
@@ -120,6 +153,23 @@ protected Long createLoanProduct(PostLoanProductsRequest
request) {
return loanHelper.createLoanProduct(request);
}
+ protected GetLoanProductsProductIdResponse retrieveLoanProduct(Long
productId) {
+ return loanHelper.retrieveLoanProduct(productId);
+ }
+
+ protected PutLoanProductsProductIdResponse updateLoanProduct(Long
productId, PutLoanProductsProductIdRequest request) {
+ return loanHelper.updateLoanProduct(productId, request);
+ }
+
+ /**
+ * Updates a loan product using raw JSON. Use this overload when you need
to send explicit null values in the
+ * request body, which the typed Feign client cannot express due to the
global NON_NULL ObjectMapper configuration.
+ */
+ protected void updateLoanProduct(Long productId, String rawJsonBody) {
Review Comment:
I understand this is a workaround, but this change will force to load
restassured on every subclass, which is not ideal. Can we separate this
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/helpers/FeignClientHelper.java:
##########
@@ -57,7 +57,7 @@ public FeignClientHelper(FineractFeignClient fineractClient) {
}
public Long createClient() {
- return
createClient(Utils.dateFormatter.format(Utils.getLocalDateOfTenant()));
+ return createClient("04 March 2011");
Review Comment:
Magic string
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/FeignLoanTestBase.java:
##########
@@ -337,4 +403,338 @@ protected PostLoansLoanIdTransactionsRequest reAge(String
startDate, String freq
Integer numberOfInstallments) {
return LoanRequestBuilders.reAge(startDate, frequencyType,
frequencyNumber, numberOfInstallments);
}
+
+ protected LoanTestData.TransactionExt transaction(double amount, String
type, String date, double outstandingPrincipal,
+ double principalPortion, double interestPortion, double
feePortion, double penaltyPortion, double unrecognizedIncomePortion,
+ double overpaymentPortion) {
+ return new LoanTestData.TransactionExt(amount, type, date,
outstandingPrincipal, principalPortion, interestPortion, feePortion,
+ penaltyPortion, unrecognizedIncomePortion, overpaymentPortion,
false);
+ }
+
+ protected LoanTestData.TransactionExt transaction(double amount, String
type, String date, double outstandingPrincipal,
+ double principalPortion, double interestPortion, double
feePortion, double penaltyPortion, double unrecognizedIncomePortion,
+ double overpaymentPortion, boolean reversed) {
+ return new LoanTestData.TransactionExt(amount, type, date,
outstandingPrincipal, principalPortion, interestPortion, feePortion,
+ penaltyPortion, unrecognizedIncomePortion, overpaymentPortion,
reversed);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
Boolean completed, String dueDate) {
+ return new LoanTestData.Installment(principalAmount, null, null, null,
null, completed, dueDate, null, null);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
double interestAmount, double totalOutstandingAmount,
+ Boolean completed, String dueDate) {
+ return new LoanTestData.Installment(principalAmount, interestAmount,
null, null, totalOutstandingAmount, completed, dueDate, null,
+ null);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
double interestAmount, double feeAmount,
+ double totalOutstandingAmount, Boolean completed, String dueDate) {
+ return new LoanTestData.Installment(principalAmount, interestAmount,
feeAmount, null, totalOutstandingAmount, completed, dueDate,
+ null, null);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
double interestAmount, double feeAmount, double penaltyAmount,
+ double totalOutstandingAmount, Boolean completed, String dueDate) {
+ return new LoanTestData.Installment(principalAmount, interestAmount,
feeAmount, penaltyAmount, totalOutstandingAmount, completed,
+ dueDate, null, null);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
double interestAmount, double feeAmount, double penaltyAmount,
+ LoanTestData.OutstandingAmounts outstandingAmounts, Boolean
completed, String dueDate) {
+ return new LoanTestData.Installment(principalAmount, interestAmount,
feeAmount, penaltyAmount, null, completed, dueDate,
+ outstandingAmounts, null);
+ }
+
+ protected LoanTestData.Installment installment(double principalAmount,
double interestAmount, double feeAmount, double penaltyAmount,
+ double totalOutstanding, Boolean completed, String dueDate, double
loanBalance) {
+ return new LoanTestData.Installment(principalAmount, interestAmount,
feeAmount, penaltyAmount, totalOutstanding, completed, dueDate,
+ null, loanBalance);
+ }
+
+ protected LoanTestData.OutstandingAmounts outstanding(double principal,
double interestOutstanding, double fee, double penalty,
+ double total) {
+ return new LoanTestData.OutstandingAmounts(principal,
interestOutstanding, fee, penalty, total);
+ }
+
+ protected LoanTestData.TransactionExt reversedTransaction(double
principalAmount, String type, String date) {
+ return new LoanTestData.TransactionExt(principalAmount, type, date,
null, null, null, null, null, null, null, true);
+ }
+
+ protected LoanTestData.TransactionExt transaction(double amount, String
type, String date) {
+ return new LoanTestData.TransactionExt(amount, type, date, null, null,
null, null, null, null, null, false);
+ }
+
+ protected void verifyTransactions(Long loanId,
LoanTestData.TransactionExt... transactions) {
+ GetLoansLoanIdResponse loanDetails = getLoanDetails(loanId);
+ LoanTestValidators.verifyTransactions(loanDetails, transactions);
+ }
+
+ protected void verifyRepaymentSchedule(Long loanId,
LoanTestData.Installment... installments) {
+ GetLoansLoanIdResponse loanDetails = getLoanDetails(loanId);
+ LoanTestValidators.verifyRepaymentSchedule(loanDetails, installments);
+ }
+
+ protected PostLoanProductsRequest create4IProgressive() {
Review Comment:
Can we consolidate this kind of product creation into the
LoanProductTemplates? I think this belongs there
--
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]