From 8c673fd66fa88f8082ab56c6e0560318120147af Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Sat, 14 Mar 2026 21:45:20 -0600 Subject: [PATCH] add user filter requests --- petshop-api.postman_collection.json | 105 ++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/petshop-api.postman_collection.json b/petshop-api.postman_collection.json index 6ecec217..73f6d258 100644 --- a/petshop-api.postman_collection.json +++ b/petshop-api.postman_collection.json @@ -2987,6 +2987,111 @@ } ] }, + { + "name": "List Staff Users", + "request": { + "method": "GET", + "url": "{{baseUrl}}/api/v1/users?role=STAFF", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ] + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "var jsonData = pm.response.json();", + "pm.test('All returned users are STAFF', function () {", + " pm.expect(jsonData.content.every(function (user) { return user.role === 'STAFF'; })).to.be.true;", + "});" + ] + } + } + ] + }, + { + "name": "List Admin Users", + "request": { + "method": "GET", + "url": "{{baseUrl}}/api/v1/users?role=ADMIN", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ] + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "var jsonData = pm.response.json();", + "pm.test('All returned users are ADMIN', function () {", + " pm.expect(jsonData.content.every(function (user) { return user.role === 'ADMIN'; })).to.be.true;", + "});" + ] + } + } + ] + }, + { + "name": "List Customer Users", + "request": { + "method": "GET", + "url": "{{baseUrl}}/api/v1/users?role=CUSTOMER", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ] + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "var jsonData = pm.response.json();", + "pm.test('All returned users are CUSTOMER', function () {", + " pm.expect(jsonData.content.every(function (user) { return user.role === 'CUSTOMER'; })).to.be.true;", + "});" + ] + } + } + ] + }, { "name": "Get User", "request": {