title: How to mock if condition using JUnit?
body: <p>I am trying to mock a method using mockito. How to mock if condition using mockito?</p>
  
  <p>Here is my code</p>
  
  <p>@Override
      public RemedyWrapperOutput createRemedyTicket(RemedyWrapperInput remedyWrapperInput) throws Exception {</p>
  
  <pre><code>    logger.info("Inside createRemedyTicket");
  
      RemedyWrapperOutput result = new RemedyWrapperOutput();
  
      final RemedyRecord remData = remedyDao.getByApiAndTitle(remedyWrapperInput.getInstance(),
              remedyWrapperInput.getTitle());
  
      /**
       * if no records exists in the DB or if the RemedyStatus is
       * CLOSED/RESOLVED/CANCELLED, we create a new ticket.
       */
      if (remData == null ||remData.getStatus().equals(RemedyStatus.RESOLVED)
              || remData.getStatus().equals(RemedyStatus.CLOSED)|| remData.getStatus().equals(RemedyStatus.CANCELLED)) {
          createRemedyTicket(remedyWrapperInput, result);
      } else {
          /* If record exists check if its within duration */
  
          /**
           * If not within time range create a ticket if New and Assigned
           * status. For all other status stop processing.
           */
          if (!checkIfInTimeRange(remData.getCreationDateTime())) {
  
              if (remData.getStatus() != null &amp;&amp; (remData.getStatus().equals(RemedyStatus.NEW)
                            || remData.getStatus().equals(RemedyStatus.ASSIGNED)
                            || remData.getStatus().equals(RemedyStatus.PENDING)
                            || remData.getStatus().equals(RemedyStatus.IN_PROGRESS))) {
  
                     int id = remedyDao.create(createRemedyInput(remedyWrapperInput, remData));
                     callRemedyRestApi(remedyWrapperInput, result, id);
                     result.setMessage("Remedy request submitted");
              }  
          } else {
              result.setMessage("A request of this category has already been logged inside specified time range.");
          }
  
          // Update the last update time to current time
          remedyDao.update(remData);
      }
      return result;
  }
  </code></pre>