I am trying to cover a Unit test case for an Exception. my code looks like this
if (null != csvWriter) {
try {
csvWriter.close();
} catch (Exception ee) {
log.error("Error in closing csvWriter. You may loose content.");
}
}
I want to cover the exception in Mockito unit case. Is there a way?