This is an automated email from the ASF dual-hosted git repository. adamsaghy pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/fineract.git
commit a8d90159df9330c3c95e78862ed97e6ed6570feb Merge: e7d381590b 0189970fbd Author: Adam Saghy <[email protected]> AuthorDate: Tue Nov 3 12:38:49 2026 +0000 Merge pull request #6797 from adamsaghy/FINERACT-2967/finish-feign-migration FINERACT-2967: Finish feign migration .agents/skills/fineract-testing/SKILL.md | 8 +- .../groovy/org.apache.fineract.dependencies.gradle | 6 - config/checkstyle/checkstyle.xml | 10 +- config/checkstyle/restassured-baseline.xml | 95 - .../fineract/client/feign/FineractFeignClient.java | 11 + .../client/feign/FineractFeignClientConfig.java | 23 +- .../feign/FineractFeignClientConfigTest.java | 9 + .../FineractFeignClientIntegrationTest.java | 30 + .../en/chapters/testing/integration-feign.adoc | 50 +- .../src/docs/en/chapters/testing/integration.adoc | 28 +- fineract-e2e-tests-core/build.gradle | 1 - .../apache/fineract/test/helper/ErrorResponse.java | 11 - .../test/stepdef/common/BatchApiStepDef.java | 31 +- fineract-e2e-tests-runner/build.gradle | 1 - .../api/LoanProductsApiResourceSwagger.java | 12 + .../data/InteropIdentifierRequestData.java | 4 + .../accounts/api/AccountsApiResourceSwagger.java | 12 +- .../products/api/ProductsApiResourceSwagger.java | 9 +- .../FixedDepositAccountsApiResourceSwagger.java | 18 + .../api/ShareDividendApiResource.java | 13 +- .../api/ShareDividendApiResourceSwagger.java | 121 + .../api/AuthenticationApiResourceSwagger.java | 2 + .../security/api/TwoFactorApiResource.java | 13 +- .../security/api/TwoFactorApiResourceSwagger.java | 94 + .../api/TwoFactorConfigurationApiResource.java | 10 +- .../TwoFactorConfigurationApiResourceSwagger.java | 97 + integration-tests/README.md | 4 +- integration-tests/dependencies.gradle | 10 - ...ansferOfficeHierarchyAccessIntegrationTest.java | 9 +- ...PaymentAllocationLoanRepaymentScheduleTest.java | 62 +- .../BatchWorkingCapitalLoanIntegrationTest.java | 12 +- .../integrationtests/CenterIntegrationTest.java | 5 +- .../integrationtests/DateValidationTest.java | 188 +- .../DelinquencyAndChargebackIntegrationTest.java | 11 +- .../ExternalBusinessEventTest.java | 6 +- .../ExternalIdSupportIntegrationTest.java | 42 +- .../FloatingRateInterestRecalculationTest.java | 49 +- .../integrationtests/GlobalConfigurationTest.java | 75 +- .../fineract/integrationtests/GroupTest.java | 2 - .../InstanceModeIntegrationTest.java | 8 +- ...ChargeOffWithAdvancedPaymentAllocationTest.java | 31 +- ...eseReplayWithAdvancedPaymentAllocationTest.java | 29 +- ...ccountCreditRefundPayoutWithChargebackTest.java | 11 +- ...AccountDisbursementToSavingsAccountingTest.java | 16 +- ...sbursementToSavingsWithAutoDownPaymentTest.java | 12 +- .../integrationtests/LoanAccountFraudTest.java | 4 +- ...nsactionOnDisbursementByAccountingTypeTest.java | 14 +- .../LoanAccrualTransactionReversalTest.java | 13 +- ...gEntriesForReverseReplayedTransactionsTest.java | 11 +- ...gePaymentWithAdvancedPaymentAllocationTest.java | 17 +- ...backOnPaymentTypeRepaymentTransactionsTest.java | 15 +- ...ncyDetailsNextPaymentDateConfigurationTest.java | 13 +- .../LoanDelinquencyForNonActiveAccountsTest.java | 23 +- .../LoanDownPaymentTransactionTypeTest.java | 7 +- .../LoanInterestRecalculationCOBTest.java | 4 +- .../integrationtests/LoanInterestRefundTest.java | 4 +- ...nManualInterestRefundResponseStructureTest.java | 4 +- .../LoanOfficeHierarchyAccessIntegrationTest.java | 9 +- .../LoanPostChargeOffScenariosTest.java | 35 +- .../LoanProductBasicDetailsTest.java | 7 +- .../integrationtests/LoanProductTemplateTest.java | 7 +- ...hAdvancedPaymentAllocationIntegrationTests.java | 12 +- ...oanProductWithDownPaymentConfigurationTest.java | 11 +- .../LoanRefundTransactionTest.java | 10 +- ...paymentScheduleForChargesAfterMaturityTest.java | 12 +- .../LoanRepaymentScheduleWithDownPaymentTest.java | 73 +- .../fineract/integrationtests/LoanSummaryTest.java | 13 +- .../LoanTransactionChargebackTest.java | 17 +- ...ionFullAmountChargebackForOverpaidLoanTest.java | 11 +- .../LoanTransactionInterestPaymentWaiverTest.java | 24 +- .../LoanTransactionReverseReplayChargeOffTest.java | 4 +- .../LoanTransactionReverseReplayRelationTest.java | 7 +- .../LoanTransactionReverseReplayTest.java | 8 +- .../integrationtests/LoanWaiveChargeTest.java | 8 +- .../MultiActivityAccrualsTest.java | 4 +- .../PaymentTypeIntegrationTest.java | 4 +- ...epositOfficeHierarchyAccessIntegrationTest.java | 9 +- .../RepaymentReverseExternalIdTest.java | 12 +- .../RepaymentWithPostDatedChecksTest.java | 9 +- ...avingsOfficeHierarchyAccessIntegrationTest.java | 9 +- .../ShareProductDatatableIntegrationTest.java | 61 +- ...qlInjectionReportingServiceIntegrationTest.java | 3 +- .../StandingInstructionLoanAccountTest.java | 14 +- .../integrationtests/TaxComponentEditLockTest.java | 12 +- .../TaxGroupComponentEndDateChangeTest.java | 5 +- .../TaxGroupComponentEndDateTest.java | 5 +- .../TaxGroupComponentStartDateTest.java | 5 +- .../TaxGroupEditAfterComponentEndedTest.java | 5 +- .../TaxGroupMixedComponentUpdateTest.java | 5 +- .../fineract/integrationtests/TaxesTest.java | 7 +- ...ndoRepaymentWithDownPaymentIntegrationTest.java | 19 +- .../WorkingCapitalLoanApplicationCRUDTest.java | 22 +- ...orkingCapitalLoanApplicationValidationTest.java | 13 +- .../WorkingCapitalLoanApprovalRejectionTest.java | 7 +- .../WorkingCapitalLoanBreachActionTest.java | 6 +- .../WorkingCapitalLoanBreachPastDueAmountTest.java | 6 +- ...rkingCapitalLoanBreachResetDuringPauseTest.java | 6 +- .../WorkingCapitalLoanChargeOffAccountingTest.java | 6 +- .../WorkingCapitalLoanCreditBalanceRefundTest.java | 6 +- ...lLoanDelinquencyActionEffectiveEndDateTest.java | 12 +- ...apitalLoanDelinquencyActionIntegrationTest.java | 12 +- ...pitalLoanDelinquencyDisableIntegrationTest.java | 20 +- ...oanDelinquencyRangeScheduleIntegrationTest.java | 16 +- .../WorkingCapitalLoanDisbursementTest.java | 15 +- ...apitalLoanDiscountFeeAmortizationDriftTest.java | 7 +- .../WorkingCapitalLoanEirValidationTest.java | 8 +- .../WorkingCapitalLoanMarkAsFraudTest.java | 7 +- .../WorkingCapitalLoanNearBreachConfigTest.java | 6 +- .../WorkingCapitalLoanOriginatorsTest.java | 6 +- .../WorkingCapitalLoanProductCRUDTest.java | 5 +- ...ngCapitalLoanRecoveryPaymentAccountingTest.java | 6 +- .../WorkingCapitalLoanRepaymentAccountingTest.java | 6 +- .../WorkingCapitalLoanRepaymentTest.java | 6 +- .../WorkingCapitalLoanStartDatesTest.java | 16 +- ...rkingCapitalLoanTransactionPaymentTypeTest.java | 7 +- .../WorkingCapitalLoanWriteOffAccountingTest.java | 6 +- .../client/feign/FeignLoanTestBase.java | 29 +- .../client/feign/FeignWorkingCapitalTestBase.java | 8 +- .../feign/helpers/ClientIdentifierCommandsApi.java | 7 +- .../CreditBureauIntegrationCommandsApi.java | 6 +- .../feign/helpers/ExternalServiceCommandsApi.java | 4 +- .../client/feign/helpers/FeignClientHelper.java | 2 +- .../feign/helpers/FeignDelinquencyHelper.java | 48 +- .../FeignFinancialActivityAccountHelper.java | 4 + .../feign/helpers/FeignFixedDepositHelper.java | 6 + .../helpers/FeignGlobalConfigurationHelper.java | 26 +- .../client/feign/helpers/FeignInteropHelper.java | 188 ++ .../client/feign/helpers/FeignLoanHelper.java | 4 + .../feign/helpers/FeignPaymentTypeHelper.java | 5 + .../feign/helpers/FeignShareAccountHelper.java | 124 +- .../helpers/InteropTransactionRequestsApi.java} | 21 +- .../feign/helpers/LoanProductCommandsApi.java | 12 +- .../feign/helpers/ShareAccountCommandsApi.java | 28 +- .../client/feign/modules/LoanProductTemplates.java | 4 +- ...ignOfficeSpecificLoanProductVisibilityTest.java | 9 +- ...nWorkingCapitalLoanChargeAfterMaturityTest.java | 7 +- .../FeignWorkingCapitalLoanParentClearTest.java | 5 +- ...rkingCapitalLoanRepaymentBackdatedUndoTest.java | 7 +- ...kingCapitalLoanRepaymentBeforeFirstCobTest.java | 7 +- .../FeignWorkingCapitalLoanStatusHelpersTest.java | 7 +- .../common/BusinessDateHelper.java | 9 +- .../common/BusinessStepHelper.java | 66 - .../integrationtests/common/CenterDomain.java | 276 -- .../integrationtests/common/CenterHelper.java | 379 --- .../integrationtests/common/ClientHelper.java | 457 --- .../common/CollateralManagementHelper.java | 207 -- .../common/ExternalAssetOwnerHelper.java | 132 - .../common/ExternalEventConfigurationHelper.java | 88 - .../common/FineractClientHelper.java | 58 - .../common/GlobalConfigurationHelper.java | 142 +- .../integrationtests/common/GroupHelper.java | 369 --- .../integrationtests/common/NotesHelper.java | 227 -- .../integrationtests/common/PaymentTypeHelper.java | 68 - .../fineract/integrationtests/common/Utils.java | 232 +- .../common/accounting/AccountHelper.java | 187 -- .../common/accounting/AccountingRuleBuilder.java | 58 - .../accounting/FinancialActivityAccountHelper.java | 86 - .../FinancialActivityAccountsMappingBuilder.java | 36 - .../common/accounting/GLAccountBuilder.java | 106 - .../common/accounting/JournalEntryHelper.java | 93 - .../common/charges/ChargesHelper.java | 532 ---- .../common/error/ErrorResponse.java | 15 - .../externalevents/ExternalEventsExtension.java | 44 +- .../fixeddeposit/FixedDepositAccountHelper.java | 621 ---- .../fixeddeposit/FixedDepositProductHelper.java | 550 ---- .../integrationtests/common/funds/FundsHelper.java | 106 - .../common/funds/FundsResourceHandler.java | 56 - .../common/loans/LoanCOBCatchUpHelper.java | 62 - .../common/loans/LoanProductHelper.java | 63 - .../common/loans/LoanStatusChecker.java | 70 - .../common/loans/LoanTestLifecycleExtension.java | 48 +- .../common/loans/LoanTransactionHelper.java | 3154 -------------------- .../common/organisation/StaffHelper.java | 123 - .../common/products/DelinquencyBucketsHelper.java | 127 - .../common/products/DelinquencyRangesHelper.java | 54 - .../common/savings/AccountTransferHelper.java | 214 -- .../common/savings/SavingsAccountHelper.java | 1360 --------- .../savings/SavingsApplicationTestBuilder.java | 122 - .../common/savings/SavingsProductHelper.java | 470 --- .../common/savings/SavingsStatusChecker.java | 148 - .../savings/SavingsTestLifecycleExtension.java | 42 +- .../common/savings/SavingsTransactionData.java | 57 - .../common/shares/DividendsIntegrationTests.java | 232 +- .../common/shares/ShareAccountHelper.java | 117 - .../shares/ShareAccountIntegrationTests.java | 1530 ++++------ .../shares/ShareAccountTransactionHelper.java | 73 - .../shares/ShareDividendsTransactionHelper.java | 75 - .../common/shares/ShareProductHelper.java | 259 -- .../shares/ShareProductTransactionHelper.java | 63 - .../integrationtests/common/system/CodeHelper.java | 256 -- .../common/system/DatatableHelper.java | 264 -- .../guarantor/GuarantorHelper.java | 117 - .../guarantor/GuarantorTestBuilder.java | 98 - .../interoperation/InteropHelper.java | 460 --- .../interoperation/InteropTest.java | 263 +- .../integrationtests/investor/InvestorHelper.java | 41 - .../InitiateExternalAssetOwnerTransferTest.java | 4 +- .../support/instancemode/InstanceModeHelper.java | 25 +- .../instancemode/InstanceModeSupportExtension.java | 44 +- ...VariableInstallmentsDecliningBalanceHelper.java | 407 --- .../VariableInstallmentsFlatHelper.java | 298 -- .../VariableIntallmentsTransactionHelper.java | 72 - oauth2-tests/dependencies.gradle | 6 +- .../oauth2tests/OAuth2AuthenticationTest.java | 169 +- twofactor-tests/dependencies.gradle | 6 +- .../TwoFactorAuthenticationTest.java | 327 +- 206 files changed, 2839 insertions(+), 16368 deletions(-) diff --cc integration-tests/src/test/java/org/apache/fineract/integrationtests/RecurringDepositOfficeHierarchyAccessIntegrationTest.java index 2fe22f84c0,b78997f07d..a3b2d407f0 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/RecurringDepositOfficeHierarchyAccessIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/RecurringDepositOfficeHierarchyAccessIntegrationTest.java @@@ -37,11 -36,10 +37,11 @@@ import org.apache.fineract.integrationt import org.apache.fineract.integrationtests.client.feign.helpers.FeignOfficeHelper; import org.apache.fineract.integrationtests.client.feign.helpers.FeignRoleHelper; import org.apache.fineract.integrationtests.client.feign.helpers.FeignUserHelper; + import org.apache.fineract.integrationtests.client.feign.modules.ClientTestData; import org.apache.fineract.integrationtests.client.feign.modules.DepositRequestBuilders; import org.apache.fineract.integrationtests.client.feign.modules.DepositTestData; +import org.apache.fineract.integrationtests.client.feign.modules.DepositTestValidators; import org.apache.fineract.integrationtests.client.feign.modules.SavingsTestData; - import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.FineractFeignClientHelper; import org.apache.fineract.integrationtests.common.Utils; import org.junit.jupiter.api.Test; @@@ -93,41 -87,11 +93,42 @@@ public class RecurringDepositOfficeHier "User from the account's office must be able to make a deposit"); } + @Test + public void testRecurringDepositActivationIsRestrictedToUserOfficeHierarchy() { + LocalDate today = Utils.getLocalDateOfTenant(); + String validFrom = Utils.dateFormatter.format(today.minusMonths(3)); + String validTo = Utils.dateFormatter.format(today.plusYears(10)); + String startDate = Utils.dateFormatter.format(today.minusMonths(1)); + Long accountOfficeId = officeHelper.createOffice(OFFICE_OPENING_DATE).getOfficeId(); + Long siblingOfficeId = officeHelper.createOffice(OFFICE_OPENING_DATE).getOfficeId(); + + Long clientId = createClientInOffice(accountOfficeId); + Long productId = recurringDepositProductHelper.createProduct(DepositRequestBuilders.withChart( + DepositRequestBuilders.recurringDepositProduct().accountingRule(SavingsTestData.AccountingRule.NONE), validFrom, validTo, + DepositTestData.recurringChartSlabsFor("period"))).getResourceId(); + Long accountId = recurringDepositHelper.submitApplication(DepositRequestBuilders.recurringDepositAccount(clientId, productId, + startDate, startDate, DepositTestData.PreClosurePenalInterestOnType.WHOLE_TERM)).getSavingsId(); + recurringDepositHelper.approve(accountId, startDate); + + FineractFeignClient siblingOfficeUser = createUserInOffice(siblingOfficeId, ACTIVATION_PERMISSIONS); + FineractFeignClient accountOfficeUser = createUserInOffice(accountOfficeId, ACTIVATION_PERMISSIONS); + + CallFailedRuntimeException failure = FeignCalls.failVoid(() -> activate(siblingOfficeUser, accountId, startDate)); + assertEquals(403, failure.getStatus()); + assertTrue(failure.getResponseBody().contains(HIERARCHY_ERROR_MESSAGE), + "Expected office hierarchy error but was: " + failure.getResponseBody()); + DepositTestValidators.verifyRecurringDepositIsApproved(recurringDepositHelper.getAccount(accountId).getStatus()); + + assertNotNull(ok(() -> activate(accountOfficeUser, accountId, startDate)).getResourceId(), + "User from the account's office must be able to activate the account"); + DepositTestValidators.verifyRecurringDepositIsActive(recurringDepositHelper.getAccount(accountId).getStatus()); + } + private Long createClientInOffice(Long officeId) { - return clientHelper.createClient(new PostClientsRequest().officeId(officeId).legalFormId(1L) - .firstname(Utils.randomFirstNameGenerator()).lastname(Utils.randomLastNameGenerator()).active(true) - .activationDate(ClientHelper.DEFAULT_DATE).dateFormat(SavingsTestData.DATETIME_PATTERN).locale(SavingsTestData.LOCALE)) + return clientHelper + .createClient(new PostClientsRequest().officeId(officeId).legalFormId(1L).firstname(Utils.randomFirstNameGenerator()) + .lastname(Utils.randomLastNameGenerator()).active(true).activationDate(ClientTestData.DEFAULT_ACTIVATION_DATE) + .dateFormat(SavingsTestData.DATETIME_PATTERN).locale(SavingsTestData.LOCALE)) .getClientId(); }
