You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "DeathGun44 (via GitHub)" <gi...@apache.org> on 2026/09/08 12:31:23 UTC

[PR] FINERACT-2732: migrate savings deposit tests to feign (tier2) [fineract]

DeathGun44 opened a new pull request, #6419:
URL: https://github.com/apache/fineract/pull/6419

   ## Description
   
   Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [ ] 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.
   - [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
   - [ ] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [ ] 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
   - [ ] [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).
   - [ ] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
   
   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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "DeathGun44 (via GitHub)" <gi...@apache.org>.
DeathGun44 commented on PR #6419:
URL: https://github.com/apache/fineract/pull/6419#issuecomment-5696113180

   @budaidev  @adamsaghy  Please take a look when you have a moment!


-- 
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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "DeathGun44 (via GitHub)" <gi...@apache.org>.
DeathGun44 commented on PR #6419:
URL: https://github.com/apache/fineract/pull/6419#issuecomment-5585277456

   API backward-compatibility check: 16 expected violations, all from one schema correction verify-api-backward-compatibility fails on this PR. 
   
   Measured locally with swagger-brake on a sliced spec, plus an identical-spec control run that reported no violations. 
   All 16 are on GET /v1/savingsaccounts/{accountId} and all stem from a single one-line fix in SavingsAccountChargeData. The field is a java.time.MonthDay. Jackson serialises it as the ISO-8601 string --01-15, but the schema generator introspected the type as a bean and published an object with dayOfMonth/month/monthValue. 
   The old schema described a shape the server has never sent, so no client could have been relying on it - any client that tried failed exactly as ours did.


-- 
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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "DeathGun44 (via GitHub)" <gi...@apache.org>.
DeathGun44 commented on PR #6419:
URL: https://github.com/apache/fineract/pull/6419#issuecomment-5717645332

   Other than api check test ,others should pass on rerun as they are most likely 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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "DeathGun44 (via GitHub)" <gi...@apache.org>.
DeathGun44 commented on code in PR #6419:
URL: https://github.com/apache/fineract/pull/6419#discussion_r4036933288


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/DepositInterestCalculator.java:
##########
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.integrationtests.client.feign.modules;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Collection;
+import org.apache.fineract.client.models.GetInterestRateChartsChartSlabs;
+
+/**
+ * Projects the interest a deposit account should earn, so a test can state an expectation independently of the server.
+ * The arithmetic is that of the RestAssured {@code FixedDepositAccountHelper}: it accumulates in {@code float}, so a
+ * projection is only good to about seven significant digits and must be compared to the server's value with a
+ * tolerance, never for equality.
+ */
+public final class DepositInterestCalculator {
+
+    private DepositInterestCalculator() {}
+
+    /** The annual rate the chart applies to a deposit of this many periods, or zero when no slab covers it. */
+    public static BigDecimal interestRateFor(Collection<GetInterestRateChartsChartSlabs> chartSlabs, int depositPeriod) {
+        for (GetInterestRateChartsChartSlabs slab : chartSlabs) {
+            Integer fromPeriod = slab.getFromPeriod();
+            Integer toPeriod = slab.getToPeriod();
+            if (fromPeriod != null && toPeriod != null && depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {

Review Comment:
   Done! also checked for similar patterns in the PR, ready for re-review!



-- 
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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "DeathGun44 (via GitHub)" <gi...@apache.org>.
DeathGun44 commented on PR #6419:
URL: https://github.com/apache/fineract/pull/6419#issuecomment-5837077238

   @adamsaghy please take a look when you have some time!


-- 
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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #6419:
URL: https://github.com/apache/fineract/pull/6419


-- 
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-2732: migrate savings deposit tests to feign (tier2) [fineract]

Posted by "budaidev (via GitHub)" <gi...@apache.org>.
budaidev commented on code in PR #6419:
URL: https://github.com/apache/fineract/pull/6419#discussion_r4029922772


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/DepositInterestCalculator.java:
##########
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.integrationtests.client.feign.modules;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Collection;
+import org.apache.fineract.client.models.GetInterestRateChartsChartSlabs;
+
+/**
+ * Projects the interest a deposit account should earn, so a test can state an expectation independently of the server.
+ * The arithmetic is that of the RestAssured {@code FixedDepositAccountHelper}: it accumulates in {@code float}, so a
+ * projection is only good to about seven significant digits and must be compared to the server's value with a
+ * tolerance, never for equality.
+ */
+public final class DepositInterestCalculator {
+
+    private DepositInterestCalculator() {}
+
+    /** The annual rate the chart applies to a deposit of this many periods, or zero when no slab covers it. */
+    public static BigDecimal interestRateFor(Collection<GetInterestRateChartsChartSlabs> chartSlabs, int depositPeriod) {
+        for (GetInterestRateChartsChartSlabs slab : chartSlabs) {
+            Integer fromPeriod = slab.getFromPeriod();
+            Integer toPeriod = slab.getToPeriod();
+            if (fromPeriod != null && toPeriod != null && depositPeriod >= fromPeriod && depositPeriod <= toPeriod) {

Review Comment:
   Issue: interestRateFor requires both fromPeriod and toPeriod to be non-null. However, DepositTestData explicitly creates final slabs with toPeriod == null to represent an unbounded upper range. A period in that final range therefore receives BigDecimal.ZERO instead of the configured interest rate.
   Impact: Deposit tests using terms in the final slab can fail incorrectly or use a wrong expected interest rate. It also makes the test oracle inconsistent with the chart data it is designed to consume.
   Recommendation: Treat a null upper bound as unbounded and add boundary tests:
   
   if (fromPeriod != null
           && depositPeriod >= fromPeriod
           && (toPeriod == null || depositPeriod <= toPeriod)) {
       return slab.getAnnualInterestRate();
   }



-- 
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