Sitelet https://github.com/assertj/assertj/pull/4170
Skip to content

Improve InputStream assertions with binary and textual comparison APIs - #4170

Open
qlfyd123 wants to merge 8 commits into
assertj:mainfrom
qlfyd123:improve-inputstream-assertions
Open

Improve InputStream assertions with binary and textual comparison APIs#4170
qlfyd123 wants to merge 8 commits into
assertj:mainfrom
qlfyd123:improve-inputstream-assertions

Conversation

@qlfyd123

Copy link
Copy Markdown
Contributor

Check List:

Following the contributing guidelines will make it easier for us to review and accept your PR.

This PR improves InputStream assertions by introducing dedicated methods for binary and textual content comparison, allowing for more precise assertions and better charset handling.

Changes

  • New Binary Comparison: Added hasSameBinaryContentAs(InputStream) for byte-to-byte comparison of two input streams.
  • New Textual Comparison: Added hasSameTextualContentAs(InputStream, Charset) for character-based comparison, allowing users to specify the expected stream's charset.
  • Charset Configuration: Added usingCharset(Charset) and usingCharset(String) to AbstractInputStreamAssert to define the charset for the actual InputStream being asserted.
  • Deprecated hasSameContentAs(InputStream) in favor of the more explicit hasSameBinaryContentAs or hasSameTextualContentAs methods.

@qlfyd123

Copy link
Copy Markdown
Contributor Author

Hi @joel-costigliola.
This pr is ready to review. can you review this pr when you have a chance? thanks!

@qlfyd123
qlfyd123 force-pushed the improve-inputstream-assertions branch from 4dafa94 to 0aca611 Compare April 1, 2026 01:45
@testlens-app

testlens-app Bot commented Apr 1, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 0aca611
▶️ Tests: 188921 executed
⚪️ Checks: 18/18 completed


Learn more about TestLens at testlens.app.

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.

AbstractInputStreamAssert#hasSameContentAs(InputStream) converts bytes to String

1 participant