Mock Data Usage
  • 05 Dec 2022
  • Dark
    Light
  • PDF

Mock Data Usage

  • Dark
    Light
  • PDF

Article summary

Defined in action.json

  • For each action there is an array of responseObjects. These tell the adapter the various responses that are available for the action.
    • The adapter has a hierarchy for determining which response to use for a request.
  • responseObjects
    • mockFile: This is used by the adapter libraries when running in stub mode (not integrated) to tell the adapter where the mock data that should be returned is located. It should be a file within the entity (generally all mock data files are in the mockdatafiles directory to prevent clutter in the base entity directory).

Example: Action.json with mockdata file path

{
  "name": "getIP",
  "protocol": "REST",
  "method": "GET",
  "entitypath": "{base_path}/{version}/addresses/{pathv1}",
  "schema": "schema.json",
  "timeout": 3000,
  "datatype": "PLAIN",
  "sendEmpty": true,
  "headers": {},
  "responseObjects": [
    {
      "type": "default",
      "key": "",
      "mockFile": "mockdatafiles/getIP-default.json"
    }
  ]
},
  • Mock data files should be in a place defined in the action.json.
  • In the above example, a file should exist in: mockdatafiles/getIP-default.json.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.