In this article
This article provides a worked example on how to update the Test result associated to a countermeasure using the following API endpoint:
api/v1/products/:product-id/components/:component-id/tests/:cwe
This will be executed against a the Browser component. To execute the endpoint, we will use Postman and also provide the curl command required.
To update Test result via API (command line), see following article: How to update a single test result via an API endpoint
Permissions required
- TEST_UPDATE
Setup
For this guide, we will use the following Threat Model:
As an example, we will update the Test result of the Countermeasure "Encrypt data between the client and server/service" to Failed. Currently, the status is the default "Not Tested":
Instructions
1. From the Project Details page, note the Reference ID (product-id):
2. From the main Diagram page, note the Reference ID of the Browser component (component-id):
3. On selecting the Countermeasure (see Setup), note the Countermeasure reference (cwe):
4. In Postman, update the following and save:
i. The Path Variables for the API: Updates a single test to a component as per the above values and save:
ii. The Body with the following code to update the Test result status to "failed":
Note 1: to see the full command, click on the Code snippet icon for use within your command line session:
5. Click the Send button
6. Note the the Test result has been updated to "Failed" indicated by the red dot (you may need to refresh the page):
Note 2: Test results status include the following:
failed
error
not-tested
passed
not-applicable
partially-tested
Comments
0 comments
Article is closed for comments.