JUnit for BufferedReader | Community
Skip to main content
Level 6
September 1, 2022
Solved

JUnit for BufferedReader

  • September 1, 2022
  • 3 replies
  • 2284 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

arunpatidar
Community Advisor
Community Advisor
September 1, 2022
Pradeep_Kumar_Srivastav
Community Advisor
Community Advisor
September 2, 2022
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
September 4, 2022

Can you please share the complete test case?