Skip to content

FINERACT-2537: Add unit tests for StreamResponseUtil#5627

Open
devi-pathak2263 wants to merge 1 commit intoapache:developfrom
devi-pathak2263:add-streamresponseutil-tests
Open

FINERACT-2537: Add unit tests for StreamResponseUtil#5627
devi-pathak2263 wants to merge 1 commit intoapache:developfrom
devi-pathak2263:add-streamresponseutil-tests

Conversation

@devi-pathak2263
Copy link

@devi-pathak2263 devi-pathak2263 commented Mar 16, 2026

Description

This PR adds unit tests for the 'StreamResponseUtil' utility class in 'fineract-core'.

The following scenarios are covered:

  • Response generation via 'ok(StreamResponseData)'
  • Asynchronous response handling via 'ok(AsyncResponse, StreamResponseData)'
  • Behavior when 'dispositionType' is absent or present ('attachment'/'inline')
  • Correct generation of 'Content-Disposition' headers
  • Verification that 'StreamingOutput' writes the expected stream content

These tests improve code coverage and ensure reliable behavior of response streaming utilities.

JIRA:

https://issues.apache.org/jira/browse/FINERACT-2537

Testing

Executed locally:

  • ./gradlew spotlessApply
  • ./gradlew :fineract-core:test

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • 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 for verifying the changes made.
  • Follow our 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". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

@devi-pathak2263 devi-pathak2263 force-pushed the add-streamresponseutil-tests branch 3 times, most recently from c8a58b9 to 327f5e5 Compare March 16, 2026 14:38
@adamsaghy
Copy link
Contributor

@devi-pathak2263 Can you please:

Set the commit email address to match with your github account email address?
Set GPG signature for commit?

@devi-pathak2263 devi-pathak2263 force-pushed the add-streamresponseutil-tests branch from 327f5e5 to 34d4689 Compare March 17, 2026 11:56
@devi-pathak2263
Copy link
Author

@devi-pathak2263 Can you please:

Set the commit email address to match with your github account email address? Set GPG signature for commit?

I have updated the commit author email to match my GitHub account and amended the commit with a GPG signature. I also updated the test imports to follow project conventions.

Please let me know if anything else needs adjustment.

- Added unit tests covering response creation and streaming behavior
- Improved async handling using Future.get()
- Used ArgumentCaptor for stable verification
- Ensured UTF-8 charset usage
@devi-pathak2263 devi-pathak2263 force-pushed the add-streamresponseutil-tests branch from 34d4689 to f2af213 Compare March 18, 2026 15:42
@devi-pathak2263
Copy link
Author

Hi team, could someone please approve the workflows for this PR so that CI checks can run? Thanks!

@devi-pathak2263
Copy link
Author

Hi team, all checks have passed. Please let me know if any further changes are required. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants