NaturalIntelligence/Stubmatic

View on GitHub
functional-tests/assets/mappings/response.yaml

Summary

Maintainability
Test Coverage
#Short notation
-  GET: /stubs/healthcheck
   response: OK

#Short notation without response body
-  HEAD: /stubs/healthcheck
#   status: 200

#without response body
-  request:
      url: /stubs/status

   response:
      status: 200

#from body attribute
-  request:
      url: /stubs/body

   response:
      body: This is sample contents served from body

#dynamic URL mapping used in response body
-  request:
      method: POST
      url: /stubs/phone-([0-9]+)/body

   response:
      body: "spacing is optional. {{url[1] }} and {{ url[1] }} are valid"

#markers
-  request:
      url: /stubs/markers

   response:
      file: markers.xml 

#latency
-  request:
      url: /stubs/delay

   response:
      latency: 2000

#random latency
-  request:
      url: /stubs/delay/random

   response:
      latency: [1000,2000]

#no latency when an error should return with 500 status code
-  request:
      url: /stubs/delay/err

   response:
      latency: 2000
      file: notexist.xml

#multiple methods
-  request:
      method: ["GET", "HEAD","POST"]
      url: /stubs/methods/multiple

   response:
      body: "multiple methods are supported"

#all methods
-  request:
      method: "*"
      url: /stubs/methods/all

   response:
      body: "You can bind all methods to single mapping."