JUnit for BufferedReader | Community
Skip to main content
New Participant
September 1, 2022
Solved

JUnit for BufferedReader

  • September 1, 2022
  • 3 replies
  • 2278 views

new BufferedReader(new InputStreamReader(<inputStremObject>, StandardCharsets.UTF_8))

I have mocked InputStream, InputStreamReader and BufferedReader and I'm fetching a JSON file asset. <bufferedReaderObject>.readLine() throws IOException (error msg: Underlying input stream returned zero bytes) in my test file. How do I handle this JUnit scenario?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Can you please share the complete test case?

 

3 replies

joerghoh
joerghohAccepted solution
Employee
September 4, 2022

Can you please share the complete test case?

 

Pradeep_Kumar_Srivastav
New Participant
September 2, 2022
arunpatidar
New Participant
September 1, 2022