FINERACT-2718: Migrate group center tests to feign - #6194
Conversation
03827d9 to
293ee66
Compare
adamsaghy
left a comment
There was a problem hiding this comment.
Why the FeignRawHttpHelper usages? We would like to avoid serializing back and forth json objects...
293ee66 to
d57728e
Compare
|
@DeathGun44 Please rebase |
… swagger DTOs Document the fields the group, center and client command endpoints already accept and the changes objects they already return, plus the group and GLIM fields of the loan application and approval bodies, so the generated client can express them without hand-built json. Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Delete the FeignGroupCenterHelper stopgap and repoint its callers at the typed helpers. The group and center helpers themselves no longer build json by hand either: every command, retrieval and update goes through the generated client, and the two listings the openapi schema cannot describe go through a typed feign interface bound to the generated page item models. Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
d57728e to
cc5a6a9
Compare
Done! To be straight about it, only one of its three methods is really forced:
Rebased onto current develop |
|
the test seems flaky, also updated the pr description |
What this PR does
Migrates the group and center integration tests from the old REST-assured HTTP client to the typed Feign SDK client
Why
The old tests call the server with hand-written REST-assured requests and read untyped JSON. Moving them onto the generated Feign client gives typed requests and responses, so the tests are safer to change and consistent with the rest of the migrated suite.
What changed
Test classes migrated
CenterIntegrationTestGroupTestGroupLoanIntegrationTestNew typed helpers:
FeignGroupHelper,FeignCenterHelper,FeignStaffHelper,FeignGlimHelperRemoved the old stopgap:
FeignGroupCenterHelper(a raw-HTTP helper from an earlier PR) and repointed its two usersLoanReschedulingWithinCenterTestandExternalIdSupportIntegrationTest- at the new typed helpers.Production change (minimal, additive):
PostGroupsRequestandPostCentersRequestin the Swagger DTOs so groups and centers can be created through the typed model. These are additive only - the API wire format is unchanged.Production change (minimal, additive):
?command=...request fields, thechangesobjects those commands return, the retrieval fields the tests assert on, and the group / GLIM fields on the loan application and approve bodies. TouchesGroupsApiResourceSwagger,CentersApiResourceSwagger,ClientsApiResourceSwaggerandLoansApiResourceSwagger.requiredchanged, and the API wire format is unchanged. The backward-compatibility check against develop reports no breaking changes.Raw HTTP is gone
No
FeignRawHttpHelperand no REST-assured remain in the migrated code - every request and response goes through the generated Feign models, including the?command=...endpoints and the GLIM application / approve / retrieval flow. Retrieval no longer needs the REST-assured-eraCenterDomainPOJO either.One case is still bound by hand, but stays typed:
GET /centersandGET /groupsreturn a plain JSON array unlesspaged=true, and an operation can only declare one response schema (the paged one), so the generatedretrieveAllCenters/retrieveAllGroupscan't decode the array. Rather than document the endpoint incorrectly, those requests are bound to the generated page-item models through a small Feign interface,NonPagedListingApi- the same pattern as the existingInternalExternalEventsApi.paged=trueis not an equivalent substitute there:retrievePagedAllignoresorphansOnly, so the paged variant returns every group of the office. That is documented on the interface.No assertion was weakened and no REST-assured was introduced.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.