Karate mock server - WARN - no scenarios matched, though mock server was started with -m option and mock server feature file

Viewed 44

Trying to replicate a issue using karate mocks and unable to progress getting required response from the mock server initiated. Below is what is done, cant figure out where am I going wrong,

  1. Downloaded the jar file under "Assets" sections[hoping this is correct version] from the link https://github.com/karatelabs/karate/releases/tag/v1.2.0

  2. mock.feature file is created with below, Feature: mock server

        Scenario: pathMatches('/upload') && methodIs('patch')
        * print 'method:', requestMethod
    
  3. test.feature file created below for calling mock server endpoint Feature: Edit application

Background: Pre-Conditions * def requestPayload = read('classpath:examples/users/Request.json') * print requestPayload

Scenario: Test edit application * url 'http://localhost:8080/upload' And request requestPayload And header Content-Type = 'application/json-patch+json' When method patch Then status 200

  1. Testing this mock server endpoint through POSTMAN and Karate runner class, I notice error below in mock server logs

WARN com.intuit.karate.core.MockHandler - no scenarios matched, returning 404: PATCH /upload

1 Answers
Related