Skip to content

Conversation

@svozza
Copy link
Contributor

@svozza svozza commented Nov 14, 2025

Summary

This PR removes the need for us to implement a custom response stream mock when testing handlers that use the streamify or resolveStream functions.

Changes

  • Creates ResponseStream class that matches the actiual type used by lambda functions when streaming
  • Updated the fallback streamifyResponse function to use the ResponseStream class

Testing

  • Updated the streaming tests to use the new ResponseStream class
  • Removed the MockResponseStream class

Issue number: closes #4752


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza requested a review from sdangol November 14, 2025 20:36
@svozza svozza self-assigned this Nov 14, 2025
@boring-cyborg boring-cyborg bot added event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Nov 14, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Nov 14, 2025
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a comment in the linked issue about the general idea of exporting this, however everything else already looks good 👍

@svozza svozza force-pushed the httpstream-mock branch 2 times, most recently from ea90f8b to b5db916 Compare November 15, 2025 09:24
@svozza
Copy link
Contributor Author

svozza commented Nov 15, 2025

I've update the PR based on your feedback.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR and for engaging in the discussion.

I've left a comment in this other issue to remind us to add details on how to test this feature to the docs.

@sonarqubecloud
Copy link

@dreamorosi dreamorosi merged commit 8f487b9 into main Nov 15, 2025
37 checks passed
@dreamorosi dreamorosi deleted the httpstream-mock branch November 15, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event-handler This item relates to the Event Handler Utility size/L PRs between 100-499 LOC tests PRs that add or change tests

Projects

Development

Successfully merging this pull request may close these issues.

Maintenance: Simplify Stream Testing in Event Handler HTTP APIs

2 participants