https://github.com/eliasnogueira/wiremock-credit-restriction-api
Service virtualisation example for the Simulations API
https://github.com/eliasnogueira/wiremock-credit-restriction-api
java service-virtualization testing wiremock
Last synced: 2 months ago
JSON representation
Service virtualisation example for the Simulations API
- Host: GitHub
- URL: https://github.com/eliasnogueira/wiremock-credit-restriction-api
- Owner: eliasnogueira
- License: mit
- Created: 2022-11-23T17:07:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T21:19:19.000Z (8 months ago)
- Last Synced: 2025-04-11T00:43:31.607Z (6 months ago)
- Topics: java, service-virtualization, testing, wiremock
- Homepage: https://github.com/eliasnogueira/credit-simulator-api
- Size: 13.2 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Wiremock Credit Restriction API
This project is the Service Virtualization example for
the [credit-simulator-api](https://github.com/eliasnogueira/credit-simulator-api).## How to run
* Start your Docker application
* Run `docker-compose up` in your Terminal
* Wait for the Wiremock banner## Current implementation
There are two mappings implemented, which are necessary to run the `POST /v1/api/simulations/` in
the `credit-simulator-api` project:* simulation_with_restriction.json: return HTTP 403 for the matched request (please look at the `bodyPatterns`
attribute)
* the response body is defined in the `__files/simulation_with_restriction_response.json`
* restriction_complete.json: return HTTP 200 which means a restriction
* the response body is defined in the `__files/restrictions_response_200.json`Both are necessary because the restriction one is called internally from the POST request in the Simulations API, the
simulation one is also necessary to correctly reply when a restriction is found.Both have fixed the scenario with a restriction using the CPF `97093236014`. Any other request will be successful,
returning the HTTP 201 POST request in the Simulations API.