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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Junit5, Mockito for catch block for tidyJsonItemWriter.dump

anilc27140375
Level 1
Level 1

How to cover the catch block for tidyJsonItemWriter.dump() method

1 Accepted Solution
Nikhil-Kumar
Correct answer by
Community Advisor
Community Advisor

@anilc27140375 
Please have a look into below link, it's not exact the same thing. But it might help.
https://www.codejava.net/testing/junit-test-exception-examples-how-to-assert-an-exception-is-thrown

Thanks,
Nikhil

View solution in original post

2 Replies
Nikhil-Kumar
Correct answer by
Community Advisor
Community Advisor

@anilc27140375 
Please have a look into below link, it's not exact the same thing. But it might help.
https://www.codejava.net/testing/junit-test-exception-examples-how-to-assert-an-exception-is-thrown

Thanks,
Nikhil

View solution in original post

Vijayalakshmi_S
Community Advisor
Community Advisor

Hi @anilc27140375,

Can you let know if you are printing log message or any logic is handled in catch block for JSONException, RepositoryException and/or ValueFormatException part of dump method