Skip to content

Commit

Permalink
chore: adding stub for forest client
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Oct 28, 2024
1 parent 9b4db98 commit ab81da4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,12 @@ services:
profiles: ["native"]
build: ./backend
ports: ["8080:8080"]
<<: *backend
<<: *backend

wiremock:
image: "wiremock/wiremock:latest"
container_name: forest-client-api-stub
ports: ["9000:9000","9001:9001"]
volumes:
- ./stub/:/home/wiremock/
entrypoint: ["/docker-entrypoint.sh", "--enable-stub-cors","--global-response-templating","--port","9000","--https-port","9001","--verbose"]
7 changes: 7 additions & 0 deletions stub/__files/forestclient/findByClientNumber_00012797.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"clientNumber": "00012797",
"clientName": "MINISTRY OF FORESTS",
"clientStatusCode": "ACT",
"clientTypeCode": "F",
"acronym": "MOF"
}
7 changes: 7 additions & 0 deletions stub/__files/forestclient/findByClientNumber_00132184.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"clientNumber": "00132184",
"clientName": "TIMBER SALES MANAGER BABINE",
"clientStatusCode": "ACT",
"clientTypeCode": "F",
"acronym": "TBA"
}
18 changes: 18 additions & 0 deletions stub/mappings/forestclient_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"mappings": [
{
"name": "Find by client number",
"request": {
"urlPattern": "/api/clients/findByClientNumber/([0-9]*)",
"method": "GET"
},
"response": {
"status": 200,
"transformers": [
"response-template"
],
"bodyFileName": "forestclient/{{request.path.[2]}}_{{request.path.[3]}}.json"
}
}
]
}

0 comments on commit ab81da4

Please sign in to comment.