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: [email protected]

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

Reply via email to