title: How do I skip a section of code when unittesting in java
body: <p>I am working on a Java web app with unit/integration tests. App gets deployed to Jetty and uses H2 db while running the integration test phase of maven. I've one oracle function which is called from dao layer which can not be migrated to H2 db, hence i want to mock/skip this part in code while running the test cases. </p>
  
  <p>I thought of having a flag which can tell if i'm running application in test mode and put the condition in code for it, but doesn't look like cleaner approach to me. Please suggest best approach to achieve this.</p>