1. Update the previous mock server with the following:

    1. Update the Hello World variant of 'get/message' request to
      • Remove the header parameters
      • Return the file as before by using RespondWithFile without handler
    2. Update the default handler to return ONLY code 400 if the customer id is greater than 5 characters
  2. Start mock server and test Step 1

  3. Now add data for setMockId for /get/message and /get/number routes.

    1. Return the following for URL hit count 1

      • /get/message
      {
          "message" : 1
      }
      
      • /get/number
      {
          "number" : 1
      }
      
    2. Return the following for URL hit count 2

      • /get/message
      {
          "message" : 2
      }
      
      • /get/number
      {
          "number" : 2
      }
      
    3. Return the following for default

      • /get/message
      {
          "message" : "Undefined"
      }
      
      • /get/number
      {
          "number" : "Undefined"
      }
      
  4. Call API to setMockId to the folder name via Midway UI

  5. Hit the rest endpoint /get/message and /get/number one time each and verify the response is "message" : 1 and "number" : 1 respectively.

  6. Hit the rest endpoint /get/message and /get/number once more and verify the response for second hit is "message" : 2 and "number" : 2 respectively.

  7. Hit the rest endpoint /get/message and /get/number one more time to verify that the response is "message" : "undefined" and "number" : "undefined" respectively.

  8. Call ResetMockId API via Midway UI

  9. Hit the rest endpoint /get/message and /get/number once each and verify the response is based on the handler and not on SetMockId - You may have to add appropriate file based on the route path.

  10. Update run-mock-server-console.js to add two parallel sessions to the server.

  11. Now call GetSessionId to register a session using Midway UI.

  12. Now set Hello World and Hello Universe variant for get/message api for the two sessions Ids respectively.

  13. Now hit the server https://localhost:8000/sessionId/get/message for different session Ids and verify that you get different responses as per each variant.