From 5e0db34e708cd3ed3f54d2c73bfae12f38ee9808 Mon Sep 17 00:00:00 2001 From: chrisala Date: Thu, 9 Jan 2025 17:45:03 +1100 Subject: [PATCH] More test fixes #3401 --- .../mappings/jwtIdUserdetailslookup.json | 17 ++++++++++++++++ .../lookupUserDetailsByEmailAddress.json | 1 + .../mappings/lookupjwtIdUserDetails.json | 20 +++++++++++++++++++ .../wiremock/mappings/userdetailslookup.json | 9 ++++++++- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/integration-test/resources/wiremock/mappings/jwtIdUserdetailslookup.json create mode 100644 src/integration-test/resources/wiremock/mappings/lookupjwtIdUserDetails.json diff --git a/src/integration-test/resources/wiremock/mappings/jwtIdUserdetailslookup.json b/src/integration-test/resources/wiremock/mappings/jwtIdUserdetailslookup.json new file mode 100644 index 000000000..1a52ad899 --- /dev/null +++ b/src/integration-test/resources/wiremock/mappings/jwtIdUserdetailslookup.json @@ -0,0 +1,17 @@ +{ + + "priority": 1, + "request": { + "urlPath": "/userdetails/userDetails/getUserDetails", + "method": "ANY", + "queryParameters": { + "userName": { + "equalTo": "jwtId" + } + } + }, + "response": { + "transformers": ["response-template"], + "status": 404 + } +} diff --git a/src/integration-test/resources/wiremock/mappings/lookupUserDetailsByEmailAddress.json b/src/integration-test/resources/wiremock/mappings/lookupUserDetailsByEmailAddress.json index 64b706a7c..4b4032488 100644 --- a/src/integration-test/resources/wiremock/mappings/lookupUserDetailsByEmailAddress.json +++ b/src/integration-test/resources/wiremock/mappings/lookupUserDetailsByEmailAddress.json @@ -1,4 +1,5 @@ { + "priority": 3, "request": { "urlPath": "/userdetails/userDetails/userDetails/getUserDetails", "method": "ANY" diff --git a/src/integration-test/resources/wiremock/mappings/lookupjwtIdUserDetails.json b/src/integration-test/resources/wiremock/mappings/lookupjwtIdUserDetails.json new file mode 100644 index 000000000..270c825d5 --- /dev/null +++ b/src/integration-test/resources/wiremock/mappings/lookupjwtIdUserDetails.json @@ -0,0 +1,20 @@ +{ + "priority": 2, + "request": { + "urlPath": "/userdetails/userDetails/userDetails/getUserDetails", + "method": "ANY", + "queryParameters": { + "userName": { + "equalTo": "jwtId" + } + } + }, + "response": { + "transformers": ["response-template"], + "status": 404, + "headers": { + "Content-Type": "application/json" + }, + "body": null + } +} diff --git a/src/integration-test/resources/wiremock/mappings/userdetailslookup.json b/src/integration-test/resources/wiremock/mappings/userdetailslookup.json index 093133981..ad14716d1 100644 --- a/src/integration-test/resources/wiremock/mappings/userdetailslookup.json +++ b/src/integration-test/resources/wiremock/mappings/userdetailslookup.json @@ -1,4 +1,5 @@ { + "priority": 4, "request": { "urlPath": "/userdetails/userDetails/getUserDetails", "method": "ANY" @@ -9,6 +10,12 @@ "headers": { "Content-Type": "application/json" }, - "body": "{{#if (request.query.userName != jwtId)}} {\"userName\":\"user.{{request.query.userName}}@nowhere.com.au\",\"email\":\"user.{{request.query.userName}}@nowhere.com.au\",\"userId\":\"{{request.query.userName}}\",\"firstName\": \"First {{request.query.userName}}\",\"lastName\": \"Last {{request.query.userName}}\"}{{/if}}{{#if (request.query.userName == 'jwtId')}}null{{/if}}" + "jsonBody": { + "userName":"user.{{request.query.userName}}@nowhere.com.au", + "email":"user.{{request.query.userName}}@nowhere.com.au", + "userId":"{{request.query.userName}}", + "firstName": "First {{request.query.userName}}", + "lastName": "Last {{request.query.userName}}" + } } }