Skip to content

Commit

Permalink
responses and config files
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdavis2001 committed May 23, 2024
1 parent c56eeb4 commit af4dd69
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mock-integrations/lpa-data-store/mock-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
plugin: "openapi"
specFile: "mock-openapi.yaml"

response:
scriptFile: "mock-responses.js"

pickFirstIfNoneMatch: false
validation:
request: true
18 changes: 18 additions & 0 deletions mock-integrations/lpa-data-store/mock-responses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var lpa = "lpa" + context.request.pathParams.uid.slice(-4);

switch (lpa) {
case 'lpa0138':
case 'lpa6361':
case 'lpa7237':
case 'lpa0252':
respond().withExampleName(lpa);
break;

default:
// default to bad request
respond()
.withStatusCode(404)
.usingDefaultBehaviour();
break;
}

0 comments on commit af4dd69

Please sign in to comment.