You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "elnafateh (via GitHub)" <gi...@apache.org> on 2026/05/27 13:30:44 UTC
[PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
elnafateh opened a new pull request, #5900:
URL: https://github.com/apache/fineract/pull/5900
## Description
Part of [FINERACT-2165](https://issues.apache.org/jira/browse/FINERACT-2165) system-wide migration of integration tests from RestAssured to `fineract-client-feign`.
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [x] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
- [x] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
- [x] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [x] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
- [x] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
- [x] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #5900:
URL: https://github.com/apache/fineract/pull/5900#issuecomment-4582926751
rerun failed check, it's flaky
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #5900:
URL: https://github.com/apache/fineract/pull/5900#issuecomment-4614100502
> Kindly review my concerns.
@adamsaghy it's been resolved
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5900:
URL: https://github.com/apache/fineract/pull/5900
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5900:
URL: https://github.com/apache/fineract/pull/5900#discussion_r3348782830
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/common/accounting/AccountRuleHelper.java:
##########
@@ -18,54 +18,28 @@
*/
package org.apache.fineract.integrationtests.common.accounting;
-import com.google.common.reflect.TypeToken;
-import com.google.gson.Gson;
-import io.restassured.specification.RequestSpecification;
-import io.restassured.specification.ResponseSpecification;
-import java.lang.reflect.Type;
+import static org.apache.fineract.client.feign.util.FeignCalls.ok;
+
import java.util.ArrayList;
+import org.apache.fineract.client.models.AccountRuleRequest;
import org.apache.fineract.client.models.AccountingRuleData;
import org.apache.fineract.client.models.PostAccountingRulesResponse;
-import org.apache.fineract.client.util.JSON;
+import org.apache.fineract.integrationtests.common.FineractFeignClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
-public class AccountRuleHelper {
-
- private static final Gson GSON = new JSON().getGson();
-
- private static final String ACCOUNTINGRULES_URL = "/fineract-provider/api/v1/accountingrules?" + Utils.TENANT_IDENTIFIER;
+public final class AccountRuleHelper {
- private final RequestSpecification requestSpec;
- private final ResponseSpecification responseSpec;
+ private AccountRuleHelper() {}
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public AccountRuleHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
- this.requestSpec = requestSpec;
- this.responseSpec = responseSpec;
+ public static ArrayList<AccountingRuleData> getAccountingRules() {
+ return new ArrayList<>(ok(() -> FineractFeignClientHelper.getFineractFeignClient().accountingRules().retrieveAllAccountingRules()));
Review Comment:
No need to rewrap into a list. Change the return datatype to `List`
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on code in PR #5900:
URL: https://github.com/apache/fineract/pull/5900#discussion_r3349824941
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/common/accounting/PeriodicAccrualAccountingHelper.java:
##########
@@ -18,46 +18,20 @@
*/
package org.apache.fineract.integrationtests.common.accounting;
-import com.google.gson.Gson;
-import io.restassured.specification.RequestSpecification;
-import io.restassured.specification.ResponseSpecification;
-import java.util.HashMap;
-import org.apache.fineract.integrationtests.common.Utils;
+import static org.apache.fineract.client.feign.util.FeignCalls.ok;
-public class PeriodicAccrualAccountingHelper {
+import org.apache.fineract.client.models.PostRunaccrualsRequest;
+import org.apache.fineract.integrationtests.common.FineractFeignClientHelper;
- private static final String PERIODIC_ACCRUAL_URL = "/fineract-provider/api/v1/runaccruals";
- private final RequestSpecification requestSpec;
- private final ResponseSpecification responseSpec;
+public final class PeriodicAccrualAccountingHelper {
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public PeriodicAccrualAccountingHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
- this.requestSpec = requestSpec;
- this.responseSpec = responseSpec;
- }
-
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public Object runPeriodicAccrualAccounting(String date) {
- String json = getRunPeriodicAccrual(date);
- return Utils.performServerPost(this.requestSpec, this.responseSpec, PERIODIC_ACCRUAL_URL + "?" + Utils.TENANT_IDENTIFIER, json, "");
- }
+ private PeriodicAccrualAccountingHelper() {}
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- private String getRunPeriodicAccrual(String date) {
- final HashMap<String, String> map = new HashMap<>();
- map.put("dateFormat", "dd MMMM yyyy");
- map.put("locale", "en_GB");
- map.put("tillDate", date);
- return new Gson().toJson(map);
+ public static Object runPeriodicAccrualAccounting(final String date) {
+ final PostRunaccrualsRequest request = new PostRunaccrualsRequest().dateFormat("dd MMMM yyyy").locale("en_GB").tillDate(date);
+ return ok(() -> {
Review Comment:
it's been resolved
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/common/accounting/AccountRuleHelper.java:
##########
@@ -18,54 +18,28 @@
*/
package org.apache.fineract.integrationtests.common.accounting;
-import com.google.common.reflect.TypeToken;
-import com.google.gson.Gson;
-import io.restassured.specification.RequestSpecification;
-import io.restassured.specification.ResponseSpecification;
-import java.lang.reflect.Type;
+import static org.apache.fineract.client.feign.util.FeignCalls.ok;
+
import java.util.ArrayList;
+import org.apache.fineract.client.models.AccountRuleRequest;
import org.apache.fineract.client.models.AccountingRuleData;
import org.apache.fineract.client.models.PostAccountingRulesResponse;
-import org.apache.fineract.client.util.JSON;
+import org.apache.fineract.integrationtests.common.FineractFeignClientHelper;
import org.apache.fineract.integrationtests.common.Utils;
-public class AccountRuleHelper {
-
- private static final Gson GSON = new JSON().getGson();
-
- private static final String ACCOUNTINGRULES_URL = "/fineract-provider/api/v1/accountingrules?" + Utils.TENANT_IDENTIFIER;
+public final class AccountRuleHelper {
- private final RequestSpecification requestSpec;
- private final ResponseSpecification responseSpec;
+ private AccountRuleHelper() {}
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public AccountRuleHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
- this.requestSpec = requestSpec;
- this.responseSpec = responseSpec;
+ public static ArrayList<AccountingRuleData> getAccountingRules() {
+ return new ArrayList<>(ok(() -> FineractFeignClientHelper.getFineractFeignClient().accountingRules().retrieveAllAccountingRules()));
Review Comment:
it's been resolved
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #5900:
URL: https://github.com/apache/fineract/pull/5900#issuecomment-4616146971
kindly rerun failed check, it's flaky error
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2165: Migrate AccountRuleHelper and PeriodicAccrualAccountingHelper to fineract-client-feign [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5900:
URL: https://github.com/apache/fineract/pull/5900#discussion_r3348793982
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/common/accounting/PeriodicAccrualAccountingHelper.java:
##########
@@ -18,46 +18,20 @@
*/
package org.apache.fineract.integrationtests.common.accounting;
-import com.google.gson.Gson;
-import io.restassured.specification.RequestSpecification;
-import io.restassured.specification.ResponseSpecification;
-import java.util.HashMap;
-import org.apache.fineract.integrationtests.common.Utils;
+import static org.apache.fineract.client.feign.util.FeignCalls.ok;
-public class PeriodicAccrualAccountingHelper {
+import org.apache.fineract.client.models.PostRunaccrualsRequest;
+import org.apache.fineract.integrationtests.common.FineractFeignClientHelper;
- private static final String PERIODIC_ACCRUAL_URL = "/fineract-provider/api/v1/runaccruals";
- private final RequestSpecification requestSpec;
- private final ResponseSpecification responseSpec;
+public final class PeriodicAccrualAccountingHelper {
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public PeriodicAccrualAccountingHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
- this.requestSpec = requestSpec;
- this.responseSpec = responseSpec;
- }
-
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- public Object runPeriodicAccrualAccounting(String date) {
- String json = getRunPeriodicAccrual(date);
- return Utils.performServerPost(this.requestSpec, this.responseSpec, PERIODIC_ACCRUAL_URL + "?" + Utils.TENANT_IDENTIFIER, json, "");
- }
+ private PeriodicAccrualAccountingHelper() {}
- // TODO: Rewrite to use fineract-client instead!
- // Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
- // org.apache.fineract.client.models.PostLoansLoanIdRequest)
- @Deprecated(forRemoval = true)
- private String getRunPeriodicAccrual(String date) {
- final HashMap<String, String> map = new HashMap<>();
- map.put("dateFormat", "dd MMMM yyyy");
- map.put("locale", "en_GB");
- map.put("tillDate", date);
- return new Gson().toJson(map);
+ public static Object runPeriodicAccrualAccounting(final String date) {
+ final PostRunaccrualsRequest request = new PostRunaccrualsRequest().dateFormat("dd MMMM yyyy").locale("en_GB").tillDate(date);
+ return ok(() -> {
Review Comment:
No need to return anything. since it is void, lets change the method return type to void too
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org