Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

JUnit for BufferedReader

Avatar

Level 5

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?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Can you please share the complete test case?

 

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

Can you please share the complete test case?