question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`InputStream` supporting `mark` / `reset` should not be manipulated by assertions

See original GitHub issue

Related to https://github.com/assertj/assertj-core/issues/2490#issuecomment-1035488261, the assertions of AbstractInputStreamAssert could avoid manipulating the stream position when the InputStream implementation supports mark / reset operations, tested by markSupported.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
scordiocommented, May 5, 2022

@jessicant yes, I had roughly this in mind. Maybe an additional parameter is needed for the readLimit of mark, probably 1 is not enough in case of some assertions like hasContent.

1reaction
nith2001commented, May 3, 2022

@scordio Haha, no problem, Jessica and myself are still trying to get more experience before we take on harder issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

InputStream supporting mark / reset should not be ... - GitHub
About the code snippet, I'd say the mark/reset pair should be pushed down to InputStreams , being an implementation detail of the assertions, ......
Read more >
BufferedInputStream mark/reset issue - java - Stack Overflow
The problem here is that you have already read two or three bytes from the input stream with the BufferedInputStream .
Read more >
mark/reset method not supported for InputStream?
IOException:mark/reset not supported" and I used the markSupported() method to check and it verifies that it is not supported.
Read more >
4. Streams - Java Network Programming, 3rd Edition [Book]
BufferedInputStream does not declare any new methods of its own. It only overrides methods from InputStream . It does support marking and resetting....
Read more >
Karate | Test Automation Made Simple.
Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found