Hghar
Lightweight dummy server to mock external services for integration testing.
Installation
go get github.com/YoussefKaib/Hghar
go build ./...
./Hghar
Docker Build
docker-compose up --build
Endpoints Path
testdata/mocked_endpoints/external_moq_services.json
Endpoints Example:
{
"services": [
{
"request":"/foo",
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"query_params": {
"city": ["Chicago"]
},
"body": "",
"response_file": "testdata/mocked_response/foo_file_response"
},
{
"request":"/bar",
"status": 500,
"headers": {
"Content-Type": "application/json"
},
"query_params": {
"city": ["New York"]
},
"body": "",
"response_file": "testdata/mocked_response/bar_file_response"
}
]
}
Response Path
testdata/mocked_response/foo_file_response
Contributing
Pull requests, bug fixes, and new features are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature
)
- Commit your changes (
git commit -a -m 'Add some feature'
)
- Push to the branch (
git push origin my-new-feature
)
- Create new Pull Request on GitHub