Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

JUnit for BufferedReader

Avatar

Level 6

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?