{"id":13764142,"url":"https://github.com/quii/mockingjay-server","last_synced_at":"2025-04-04T18:08:29.775Z","repository":{"id":29871832,"uuid":"33417034","full_name":"quii/mockingjay-server","owner":"quii","description":"Fake server, Consumer Driven Contracts and help with testing performance from one configuration file with zero system dependencies and no coding whatsoever","archived":false,"fork":false,"pushed_at":"2022-05-26T17:45:27.000Z","size":38310,"stargazers_count":563,"open_issues_count":9,"forks_count":72,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T17:09:04.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-04T19:18:02.000Z","updated_at":"2025-03-22T21:32:18.000Z","dependencies_parsed_at":"2022-07-27T23:48:24.107Z","dependency_job_id":null,"html_url":"https://github.com/quii/mockingjay-server","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quii%2Fmockingjay-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quii%2Fmockingjay-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quii%2Fmockingjay-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quii%2Fmockingjay-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quii","download_url":"https://codeload.github.com/quii/mockingjay-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T15:01:16.290Z","updated_at":"2025-04-04T18:08:29.758Z","avatar_url":"https://github.com/quii.png","language":"Go","readme":"# mockingjay server\n\n[![Build Status](https://travis-ci.org/quii/mockingjay-server.svg?branch=master)](https://travis-ci.org/quii/mockingjay-server)[![Coverage Status](https://coveralls.io/repos/quii/mockingjay-server/badge.svg?branch=master)](https://coveralls.io/r/quii/mockingjay-server?branch=master)[![GoDoc](https://godoc.org/github.com/quii/mockingjay-server?status.svg)](https://godoc.org/github.com/quii/mockingjay-server)\n\n![mj example](http://i.imgur.com/ZtI1Q39.gif)\n\nMockingjay lets you define the contract between a consumer and producer and with just a configuration file you get:\n\n- A fast to launch fake server for your integration tests\n - Configurable to simulate the eratic nature of calling other services\n- [Consumer driven contracts (CDCs)](http://martinfowler.com/articles/consumerDrivenContracts.html) to run against your real downstream services.\n\n**Mockingjay makes it really easy to check your HTTP integration points**. It's fast, requires no coding and is better than other solutions because it will ensure your mock servers and real integration points are consistent so that you never have a green build but failing software.\n\n- [Installation](https://github.com/quii/mockingjay-server/wiki/Installing) - [Download a binary](https://github.com/quii/mockingjay-server/releases/latest), [use a Docker image](https://hub.docker.com/r/quii/mockingjay-server/) or `go get`\n- [Rationale](https://github.com/quii/mockingjay-server/wiki/Rationale)\n- [See how mockingjay can easily fit into your workflow to make integration testing really easy and robust](https://github.com/quii/mockingjay-server/wiki/Suggested-workflow)\n\n\n## Running a fake server\n\n````yaml\n---\n - name: My very important integration point\n   request:\n     uri: /hello\n     method: POST\n     body: \"Chris\" # * matches any body\n   response:\n     code: 200\n     body: '{\"message\": \"hello, Chris\"}'   # * matches any body\n     headers:\n       content-type: application/json\n\n# define as many as you need...\n````\n\n````bash\n$ mockingjay-server -config=example.yaml -port=1234 \u0026\n2015/04/13 14:27:54 Serving 3 endpoints defined from example.yaml on port 1234\n$ curl http://localhost:1234/hello\n{\"message\": \"hello, world\"}\n````\n\n## Check configuration is compatible with a real server\n\n````bash\n$ mockingjay-server -config=example.yaml -realURL=http://some-real-api.com\n2015/04/13 21:06:06 Test endpoint (GET /hello) is incompatible with http://some-real-api - Couldn't reach real server\n2015/04/13 21:06:06 Test endpoint 2 (DELETE /world) is incompatible with http://some-real-api - Couldn't reach real server\n2015/04/13 21:06:06 Failing endpoint (POST /card) is incompatible with http://some-real-api - Couldn't reach real server\n2015/04/13 21:06:06 At least one endpoint was incompatible with the real URL supplied\n````\nThis ensures your integration test is working against a *reliable* fake.\n\n### Inspect what requests mockingjay has received\n\n     http://{mockingjayhost}:{port}/requests\n\nCalling this will return you a JSON list of requests\n\n## Make your fake server flaky\n\nMockingjay has an annoying friend, a monkey. Given a monkey configuration you can make your fake service misbehave. This can be useful for performance tests where you want to simulate a more realistic scenario (i.e all integration points are painful).\n\n````yaml\n---\n# Writes a different body 50% of the time\n- body: \"This is wrong :( \"\n  frequency: 0.5\n\n# Delays initial writing of response by a second 20% of the time\n- delay: 1000\n  frequency: 0.2\n\n# Returns a 404 30% of the time\n- status: 404\n  frequency: 0.3\n\n# Write 10,000,000 garbage bytes 9% of the time\n- garbage: 10000000\n  frequency: 0.09\n````\n\n````bash\n$ mockingjay-server -config=examples/example.yaml -monkeyConfig=examples/monkey-business.yaml\n2015/04/17 14:19:53 Serving 3 endpoints defined from examples/example.yaml on port 9090\n2015/04/17 14:19:53 Monkey config loaded\n2015/04/17 14:19:53 50% of the time | Body: This is wrong :(\n2015/04/17 14:19:53 20% of the time | Delay: 1s\n2015/04/17 14:19:53 30% of the time | Status: 404\n2015/04/17 14:19:53  9% of the time | Garbage bytes: 10000000\n````\n\n## Building\n\n### Requirements\n\n- Go 1.3+ installed ($GOPATH set, et al)\n- golint https://github.com/golang/lint\n\n### Build application\n\n````bash\n$ go get github.com/quii/mockingjay-server\n$ cd $GOPATH/src/github.com/quii/mockingjay-server\n$ ./build.sh\n````\n\nMIT license\n","funding_links":[],"categories":["Software Packages","软件包","Go","Go Tools","Go 工具","Other Software","軟件包"],"sub_categories":["Other Software","其他软件","其他软件库和软件包","其他軟件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquii%2Fmockingjay-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquii%2Fmockingjay-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquii%2Fmockingjay-server/lists"}