title: how to mock an interface using PowerMockito in Java
body: <pre><code>req1(an object of request type 1)
  req2(an object of request type 2)
  
  
      class response{
          public TxnResp txnResp(){ 
              TxnResp txnResp = service.txn(req1 , req2);
              return txnResp;
         }
      }
  </code></pre>
  
  <p>I am using <code>Powermockito</code> for mocking in my junit testing.</p>
  
  <p>"txn" is an interface. I need to mock this line  <code>TxnResp txnResp = service.txn(req1 , req2);</code> my test class. Because calling <code>txn</code> is returning some value's from the webservice, which are specified in the next line.</p>
  
  <p><code>txnResp</code> contains following values storeNo,retailerId and password. It has its own bean class, so that we can set values like <code>txnResp.setStoreId(1);</code> </p>
  
  <p>Could any one please help me to mock the above interface 'txn' and return value to <code>txnResp</code>.</p>
  
  <p>I am stuck for the last 5 hours in it. Any help will be highly appreciated.</p>