WireMock

Admin

Admin - API Endpoints

Stubbing

Stubbing - JSON

  • Debug loading mappings files

    • com.github.tomakehurst.wiremock.core.WireMockConfiguration.getMappingsSource
    • com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto
  • Debug loading files from __files

    • com.github.tomakehurst.wiremock.http.Response.getBytesFromStream to debug loading response body from a file whose name specified by bodyFileName in mapping file.
  • Reference

    // mappings/GET-some_thing.json
    {
      "request": {
        "method": "GET",
        "url": "/some/thing"
      },
      "response": {
        "status": 200,
        "bodyFileName": "200_body.json",
        "headers": {
          "Content-Type": "application/json"
        }
      }
    }
     
    // __files/200_body.json
    {
      "name": "Allen"
    }

Resources