Mock Server returning invalid results

Archived topic — some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus a config.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

I have a collection that for one of the requests I have created a number of examples. One of the examples uses a URL like:

http://cpp.testent.gartner.com/api/GenericDataHandler/ComponentData/?componentName=HlcItemStatusDates&operation=GetData&passedInData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=

I set up a Mock server for this collection and then add a call to the mock server

https://56a6042e-2be2-4eb1-b246-e9609a9e7c91.mock.pstmn.io/api/GenericDataHandler/ComponentData/?ComponentName=HlcItemStatusDates&operation=GetData&passedData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=

The problem I am seeing is that the response to the mock request does not match the example response. And yes there is only one request in the examples with the URL api/GenericDataHandler/ComponentData/?ComponentName=HlcItemStatusDates&operation=GetData&passedData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=

What am I doing wrong? Or what assumptions am I making that I shouldn’t?

Thank you.

@rkevinburton - Current Mock servers do not look at the query param part of your URL. Which means if you have multiple examples responses for the path api/GenericDataHandler/ComponentData/ the response returned by the mock server will be the first one that matches that path.

Can you confirm if this is the cause for invalid results?