title: Test catch block logic with Junit and mockito
body: <p>I have class to test like below:</p>
  
  <pre><code>public class ReportWriter {
      private FileWrter fw; 
      private static Logger logger = Logger.getLogger(ReportWriter.class); 
      public ReportWriter(FileWrter fw) {
          this.fw = fw;
      } 
      public void writeData(Data) {
          try{
              fw.open();
              fw.write(data);
              fw.close();
          } **catch(DiskFullException e) {
              //after catch we log and handle it without rethrow the exception
              logger.log(Level.WARN, "warning log here", e);
              // some more logic here
              sendEmailToSupport();
          }**
      } 
  }
  </code></pre>
  
  <p>The question is how to test the logic in catch block?</p>