Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top1
top1
Image Removed

Image Added


Tip

To know about Mock Server framework.


Info

Platform Mock Server is used to test the working of agents by creating expectations for each DevOps tool. When Mock Server receives a requests it matches the request against active expectations that have been configured. Platform Mock Server is available to use in the form of jar file.


Panel
titleExpectations

Every expectation can have 4 fields:

  1. Path:-   URL of the expectation which agent will call for the response (String).
  2. Parameters:-  List of additional parameters required in the URL (list of key-value Pairs).
  3. isResponseJson:-  Whether the response is a json object or a list of json(true/false)
  4. Response:-  Mock Response (String).


Create Expectations


Panel

How to Create Expectations:

  1. Create a json file and put it in mock_json folder inside INSIGHTS_HOME. One json file will be created for each DevOps tool.
  2. Create a list in json file using square brackets like [].
  3. Create expectations using four fields specified above.
  4. Sample expectation looks like:-      

        {

                 "path":   "/rally/release",

                "parameters": {

                                        "workspace"    : "",

                                        "fetch"             : "true?pagesize=20",

                                        "start"              : "1"

                },

                "isResponseJson": true,

                "response": []

      }

    5. Remember response will always return list.

  • If isResponseJson field is set to true then response will contain only one json object in the list.
  • If isResponseJson field is set to false then response can contain multiple json objects in the list.
  • isResponseJson is set to false by default.



Back to Top