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?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Shaheena_Sheikh for BufferedReader IO exception you can use https://www.javafixing.com/2021/11/fixed-junit-test-for-inputstreamreader.html
Can you please share the complete test case?
Views
Likes
Replies