PingAuthorize API Reference

Test Suite

Use the test suite to define test cases, test scenarios, and assertions to validate the behavior of Trust Framework and policy entities.

Building a library of test cases supports a test-driven approach to policy and Trust Framework development. This library can serve as a suite of regression checks, ensuring consistent behavior with each new version of your policies or Trust Framework.

Test scenarios include the subject, resources, actions, and attributes relevant to a decision, as well as optional overrides for attribute and service values. Test cases build on test scenarios by:

  • specifying which policy, rule, or Trust Framework definition to test, and

  • adding optional assertions to validate the decision result.

After you define a test scenario, you can reference that scenario by ID in your test cases.

For more information about each test suite entity type, refer to Test Suite in the PingAuthorize Policy Administration Guide.

The test suite endpoint provides operations for creating, reading, updating, and deleting test suite entities. Each operation requires either a branch ID or a statement ID in the request URL.

Test suite data model

Test case data model

Property Type Required Mutable Description

id

UUID

N/A

Read-only

Specifies the ID of the test case.

version

UUID

N/A

Read-only

Specifies the version ID of the test scenario.

name

String

Required

Mutable

Specifies the unique name of the test case.

description

String

Optional

Mutable

Provides a description for the test case.

parentId

UUID

Optional

Mutable

Specifies the ID of the test case parent.

objectType

String

N/A

Mutable

Specifies the type of the entity being created or updated. Always set to TestCaseDefinition.

permissions.rolePermissions

JSON[]

Optional

Mutable

Provides a collection of permissions as permission:role key-value pairs. For example, [{"WRITE": "Role 1"}].

permissions.inherit

Boolean

Optional

Mutable

Specifies whether the test case inherits permissions from its parent or not.

testCase.testedEntities

Test entity[]

Optional

Mutable

Provides a collection of entities to include in the test case.

testCase.testedEntities.assertions

Assertion[]

Optional

Mutable

Specifies an assertion object to include with the test case.

testCase.testScenarioDefinitionId

String

Optional

Mutable

Specifies the ID of a test scenario to reference in the test case.

testCase.testScenario.request.domainId

String

Optional

Mutable

Specifies the ID of a domain to include in the test request.

testCase.testScenario.request.serviceId

String

Optional

Mutable

Specifies the ID of a service to include in the test request.

testCase.testScenario.request.identityProviderId

String

Optional

Mutable

Specifies the ID of an identity provider to include in the test request.

testCase.testScenario.request.actionId

String

Optional

Mutable

Specifies the ID of an action to include in the test request.

testCase.testScenario.attributeOverrides

JSON

Optional

Mutable

Specifies how to override attribute values with a list of key-value pairs. For example, {"3577dd53-a71a-4ce8-ab40-c9c083c7c5b9": "override-value"}.

testCase.testScenario.serviceOverrides

JSON

Optional

Mutable

Specifies how to override service values with a list of key-value pairs. For example, {"3553dd53-a71a-4ce8-fb40-c9c083c7c5g9": "override-value"}.

Test scenario data model

Property Type Required Mutable Description

id

UUID

N/A

Read-only

Specifies the ID of the test scenario.

version

UUID

N/A

Read-only

Specifies the version ID of the test scenario.

name

String

Required

Mutable

Specifies the unique name of the test scenario.

description

String

Optional

Mutable

Provides a description for the test scenario.

parentId

UUID

Optional

Mutable

Specifies the ID of the test scenario parent.

objectType

String

N/A

Mutable

Specifies the type of the entity being created or updated. Always set to TestScenarioDefinition.

permissions.rolePermissions

JSON[]

Optional

Mutable

Provides a collection of permissions as permission:role key-value pairs. For example, [{"WRITE": "Role 1"}].

permissions.inherit

Boolean

Optional

Mutable

Specifies whether the test scenario inherits permissions from its parent or not.

testScenario.request.domainId

String

Optional

Mutable

Specifies the ID of a domain to include in the test request.

testScenario.request.serviceId

String

Optional

Mutable

Specifies the ID of the service to include in the test request.

testScenario.request.identityProviderId

String

Optional

Mutable

Specifies the ID of the identity provider to include in the test request.

testScenario.request.actionId

String

Optional

Mutable

Specifies the ID of the action to include in the test request.

testScenario.attributeOverrides

JSON

Optional

Mutable

Specifies how to override attribute values with a list of key-value pairs. For example, {"3577dd53-a71a-4ce8-ab40-c9c083c7c5b9": "override-value"}.

testScenario.serviceOverrides

JSON

Optional

Mutable

Specifies how to override service values with a list of key-value pairs. For example, {"3553dd53-a71a-4ce8-fb40-c9c083c7c5g9": "override-value"}.

Test entity data model

Property Type Required Mutable Description

entityId

UUID

N/A

Read-only

Specifies the unique ID of the entity to include in the test case.

entityType

String

Required

Immutable

Specifies the type of the entity to include in the test case. For example, String.

assertions

Assertion[]

Optional

Mutable

Provides a collection of assertions to include in the test case.

Assertion data model

Property Type Required Mutable Description

id

UUID

N/A

Read-only

Specifies the ID of the assertion.

version

UUID

N/A

Read-only

Specifies the version ID of the assertion.

parentId

UUID

Optional

Mutable

Specifies the ID of a parent for the assertion.

name

String

Required

Mutable

Specifies the unique name of the assertion.

description

String

Optional

Mutable

Provides a description for the assertion.

objectType

String

N/A

Mutable

Specifies the type of the entity being created or updated. Always set to AssertionDefinition.

permissions.inherit

Boolean

Optional

Mutable

Determines whether the assertion inherits permissions from its parent.

permissions.rolePermissions

JSON[]

Optional

Mutable

Provides a collection of permissions as permission:role key-value pairs. For example, [{"WRITE": "Role 1"}].

assertion.type

String

Required

Mutable

Specifies the assertion type. For example, json-path. To use an already-defined assertion in a test case, set the type to referenced.

assertion.accessor

String

Required

Mutable

Specifies a JSONPath accessor to extract information from the response.

assertion.comparator

String

Optional

Mutable

Specifies a comparison to perform between the extracted value and the expected value. Defaults to EQUALS. For detailed information about comparators, refer to Conditions in the PingAuthorize Policy Administration Guide.

assertion.expectation.valueType

String

Required

Mutable

Specifies the type of the expected value. For example, String.

assertion.expectation.value

String

Required

Mutable

Specifies the expected value.