how to use/work with Stub JSON data as to unit test the interfaces!

Basically, i am trying to unit test one of the interfaces with JSON Data.

  Discussion posts and replies are publicly visible

  • This depends somewhat on how you set up your interface. Do you have a single rule input or multiple? Are you using CDTs for rule inputs? Does your JSON data match the structure of your CDT?

    The best case scenario here is that you would use a CDT as the type of data in your rule input. Then, you would have JSON that exactly matches the fields names / structure of your CDT. If that's the case, it's pretty easy:

    1. Select the Test button at the top of your interface
    2. In the input box that opens, add this expression to the box: a!fromJson("[your JSON here"])
      (Note: you could also query the JSON from a database or integration instead of directly posting in the text above)
    3. Click Test Interface - you should see your interface populated with the data you provided
    4. You can also click "Set as default values" in the test window if you want to keep those test values saved with the interface

    If your JSON data doesn't exactly match the names of your CDT fields, you may need to massage the data a bit to make it match. Also, if you use many separate rule inputs, it's probably easier to just enter text values for each of them.