Krishna Mewara created FINERACT-2967:
----------------------------------------
Summary: Migrate the remaining REST Assured and Retrofit test code
to the Feign client and remove REST Assured from the build
Key: FINERACT-2967
URL: https://issues.apache.org/jira/browse/FINERACT-2967
Project: Apache Fineract
Issue Type: Improvement
Components: Test
Affects Versions: 1.15.0
Reporter: Krishna Mewara
Assignee: Krishna Mewara
Fix For: 1.16.0
Some test helpers and tests still call the server through REST Assured or the
Retrofit client (fineract-client). This ticket moves them to the generated
Feign client (fineract-client-feign), deletes the legacy helpers, and removes
the dependencies.
Test changes
- Move the remaining helper calls in the shared test extensions, global
configuration, delinquency, client, payment type and fund setup to the Feign
helpers.
- Migrate DateValidationTest, ShareAccountIntegrationTests,
DividendsIntegrationTests, ShareProductDatatableIntegrationTest, InteropTest,
FloatingRateInterestRecalculationTest, OAuth2AuthenticationTest and
TwoFactorAuthenticationTest to the Feign client.
- Delete the REST Assured and Retrofit test helpers that are left without
callers, and the REST Assured methods in Utils.
- In the e2e BatchApiStepDef, send the created user's credentials in the batch
reschedule steps again. The earlier Feign migration dropped them, so those
steps ran as the admin user.
OpenAPI spec fixes (needed so the generated client can make these calls)
- PostFixedDepositAccountsRequest: add charges.
- Share accounts and products: document the dividend payloads, and add the
missing close, timeline, update and product fields. Type unitPrice as a decimal.
- Interop party registration: hide the path fields from the request body.
- PostLoanProductsRequest: add the six floating rate fields.
- Two-factor authentication endpoints: add request and response schemas, and
add isTwoFactorAuthenticationRequired to PostAuthenticationResponse.
Feign client
- Add FineractFeignClient.Builder.withoutCredentials(), which builds a client
that sends no Basic Authorization header. It's used for OAuth2 bearer tokens
and unauthenticated requests.
Build and checks
- Remove io.rest-assured from every module, and fineract-client / Retrofit from
the test dependencies of integration-tests and the e2e modules.
- Make the FeignNoRestAssured Checkstyle check apply to all files, and delete
restassured-baseline.xml.
- Update the testing documentation.
Not changed
- No test is removed: every migrated test keeps its checks and runs against the
server through the Feign client.
- The fineract-client module, its unit tests, and the production webhook code
that uses Retrofit are not modified.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)