title: JUnit for both try and catch block coverage
body: <p>I am trying to write a JUnit for below code but I am not getting any idea how to cover the code which is written in catch block statement. Please can any one write a sample JUnit for below code.</p>
  
  <p>Here I don't want to cover any exception, but want to cover the lines of code written in the catch block using Mockito. </p>
  
  <pre><code>public Product getProductLookUpData() {
  
          Product product = null;
          try{
              // Try to get value from cacheable method
              product = productCacheDao.getProductLookUpData();
              .....//statements
          } catch (Exception ex) {
              // getting value from db
              product = productDao.getIpacMetricCodeLookUpData();
              ....//statements
          }
  
          return product;
      }
  </code></pre>