Tutorial: Creating a policy using the Test Util API
This tutorial assumes you have set up your environment with Postman and the correct sample data set. For more information, see Tutorial: Set up your Postman environment.
In this tutorial, you will add a policy to the policy data stored in the
TestSupportPolicyPlugin class. You can then reference this policy when
creating a new claim.
- Enable the Test Util API.
- In Studio, open config.properties.
- Add the following to the end of the
file:
published-apis.PUBLISHEDAPIS_testutil_publish = true plugin.PLUGIN_IPOLICYSEARCHADAPTER_PROFILE = testutil-api
- Start ClaimCenter.
- In Postman, start a new request by clicking the + to the right of the
Launchpad tab.
- On the Authorization tab, select Basic Auth using user su and password gw.
- Enter the following call, but do not click Send yet:
- POST
http://localhost:8080/cc/rest/test-util/v1/policies
- POST
- Specify the request payload.
- In the first row of tabs (the one that starts with Params), click Body.
- In the row of radio buttons, select raw.
- At the end of the row of radio buttons, change the drop-down list value from Text to JSON.
- Paste the text in the Sample policy payload into the text field underneath the radio buttons.
- Click Send.
Checking your work
ClaimCenter does not show data related to policies that are not associated with a claim. Therefore, there is no independent way to check your work for this tutorial, other than confirming that you get a response code and then attempting to create a claim using the policy.