Go rest api tester

April 15, 2021 ยท View on GitHub

GolangCI License

Go rest api tester

Simple HTTP rest api responder, responding whatever you like according to rules. Useful for integration tests.

Used in https://github.com/tektoncd/catalog task testing!

See some documentation here: https://github.com/tektoncd/catalog/blob/main/CONTRIBUTING.md#end-to-end-testing-for-external-services

RULES

  • will answer on a GET on URL /repo/foo/bar/issues/1/comments and reply with a 200 {"status": 200} with content-type: text/json
---
headers:
  method: GET
  path: /repos/{repo:[^/]+/[^/]+}/issues/{issue:[0-9]+}/comments
response:
  status: 200
  # file: post-comment.response.json
  output: '{"status": 200}'
  content-type: text/json