AshharAhmadKhan opened a new pull request, #6360: URL: https://github.com/apache/fineract/pull/6360
Description /v1/email has zero test coverage at any layer, no unit tests for EmailApiResource, no integration tests in integration-tests, no E2E coverage. This was true even after FINERACT-2782 (missing UPDATE handler), FINERACT-2785 (validator checking wrong constants), and FINERACT-2786 (NPE on CREATE) were all found and fixed independently, purely through manual/code inspection rather than any failing test. All three of the above bugs made /v1/email CREATE and UPDATE completely unusable in production, yet none were caught by CI. A single integration test exercising the real HTTP layer end to end would have caught all three, the validator bug and NPE on the first CREATE call, and the missing handler on the first UPDATE call. This PR adds that test. Changes Added EmailTest.java to integration-tests, covering: testEmailCreateRetrieveUpdateDeleteLifecycle() — full CREATE → RETRIEVE → UPDATE → DELETE → RETRIEVE-after-delete (404) flow, against a client with a real emailAddress, since EmailMessageAssembler derives the recipient from the linked client/staff record. testEmailCreateWithStaffIdOnlyDoesNotThrow() - confirms staffId alone (no clientId) satisfies validation, per the either.clientId.or.staffId.must.be.provided rule in EmailDataValidator. testEmailCreateWithoutClientOrStaffIdFails() - confirms the same rule rejects requests missing both. Verified locally end to end See https://issues.apache.org/jira/browse/FINERACT-2792 Related #6325 (missing UPDATE command handler, merged) #6330 (validator constants bug, merged) #6331 (NPE on CREATE, merged) -- 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]
