title: In Karate API mocking not working as expected for me
body: <p>I am exploring Karate API double (mocking) for the integration test. For the below scenarios, I'm not getting the expected mocking response. Your help will be appreciated.</p>
  
  <p><strong>My Setup :</strong> 
   1. Karate Mock Server up with pathMatches rules on port <strong>8001</strong>: <a href="http://localhost:8001" rel="nofollow noreferrer">http://localhost:8001</a> ( working, validated against "/cat" and some test calls) 
   2. My own Application is up from docker on port <strong>8080</strong>. From Docker exposed 8001 port as well. </p>
  
  <p><strong>Mocking Case:</strong> 
   1. <em>My</em> <em>application REST call</em> exposed to all users <a href="http://localhost:8080/service/v1/findUser" rel="nofollow noreferrer">http://localhost:8080/service/v1/findUser</a>. This exposed API, <em>underlying</em> calling other <em>REST call</em> <a href="http://dev-STG/userservice/v1/findUser" rel="nofollow noreferrer">http://dev-STG/userservice/v1/findUser</a> which actually giving JSON response. So, I want to mock underlying API call and validate my API behavior accordingly.</p>
  
  <p><strong>Steps tried:</strong> 
   1. Now, in my application config, m replacing actual underlying API call to Karate mock server(<a href="http://localhost:8001/userservice/v1/findUser" rel="nofollow noreferrer">http://localhost:8001/userservice/v1/findUser</a>). Then did build &amp; up my application docker.</p>
  
  <ol start="2">
  <li>In Karate, I defined test e.g "testIntgrtn.feature" which calling <em>my application API</em> "<a href="http://localhost:8080/service/v1/findUser" rel="nofollow noreferrer">http://localhost:8080/service/v1/findUser</a>" and Karate mock server up and set with pathmatch "/userservice/v1/findUser".</li>
  <li>After executing "testIntgrtn.feature" karate not mocking for an underlying call(<a href="http://localhost:8001/userservice/v1/findUser" rel="nofollow noreferrer">http://localhost:8001/userservice/v1/findUser</a>).</li>
  <li><p>Now, in "testIntgrtn.feature" file I changed my-application URL to underlying REST URL i.e (<a href="http://localhost:8001/userservice/v1/findUser" rel="nofollow noreferrer">http://localhost:8001/userservice/v1/findUser</a>) then mocking will work like charm. </p>
  
  <p>I'm not understanding why <em>underlying API call</em> not getting mocked here? Did I miss something here?
  Also, in Karate can we monitor all REST calls (like cypress mocking). </p></li>
  </ol>
  
  <p>Thanks for this wonderful framework. Which is intuitive for writing automation cases.  </p>