REST Resource: projects.locations.integrations.versions.testCases

Resource: TestCase

Defines the functional test case for Application Integration. Next available id: 15

JSON representation
{
  "name": string,
  "displayName": string,
  "description": string,
  "triggerId": string,
  "testInputParameters": [
    {
      object (IntegrationParameter)
    }
  ],
  "testTaskConfigs": [
    {
      object (TestTaskConfig)
    }
  ],
  "databasePersistencePolicy": enum (DatabasePersistencePolicy),
  "creatorEmail": string,
  "createTime": string,
  "lastModifierEmail": string,
  "updateTime": string,
  "lockHolderEmail": string,
  "triggerConfig": {
    object (TriggerConfig)
  }
}
Fields
name

string

Output only. Auto-generated primary key.

displayName

string

Required. The display name of test case.

description

string

Optional. Description of the test case.

triggerId

string

Required. This defines the trigger ID in workflow which is considered to be executed as starting point of the test case

testInputParameters[]

object (IntegrationParameter)

Optional. Parameters that are expected to be passed to the test case when the test case is triggered. This gives the user the ability to provide default values. This should include all the output variables of the trigger as input variables.

testTaskConfigs[]

object (TestTaskConfig)

Optional. However, the test case doesn't mock or assert anything without testTaskConfigs.

databasePersistencePolicy

enum (DatabasePersistencePolicy)

Optional. Various policies for how to persist the test execution info including execution info, execution export info, execution metadata index and execution param index..

creatorEmail

string

Optional. The creator's email address. Generated based on the End User Credentials/LOAS role of the user making the call.

createTime

string (Timestamp format)

Auto-generated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

lastModifierEmail

string

The last modifier's email address. Generated based on the End User Credentials/LOAS role of the user making the call.

updateTime

string (Timestamp format)

Auto-generated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

lockHolderEmail

string

Optional. The edit lock holder's email address. Generated based on the End User Credentials/LOAS role of the user making the call.

triggerConfig

object (TriggerConfig)

Optional. Auto-generated.

TestTaskConfig

The task mock configuration details and assertions for functional tests. Next available id: 6

JSON representation
{
  "taskNumber": string,
  "mockConfig": {
    object (MockConfig)
  },
  "assertions": [
    {
      object (Assertion)
    }
  ],
  "task": string,
  "taskConfig": {
    object (TaskConfig)
  }
}
Fields
taskNumber

string

Required. This defines in the test case, the task in integration which will be mocked by this test task config

mockConfig

object (MockConfig)

Optional. Defines how to mock the given task during test execution

assertions[]

object (Assertion)

Optional. List of conditions or expressions which should be evaluated to true unless there is a bug/problem in the integration. These are evaluated one the task execution is completed as per the mock strategy in test case

task

string

Required. This defines in the test case, the task name in integration which will be mocked by this test task config

taskConfig

object (TaskConfig)

Optional. Auto-generated.

MockConfig

The configuration for mocking of a task during test execution Next available id: 4

JSON representation
{
  "mockStrategy": enum (MockStrategy),
  "parameters": [
    {
      object (EventParameter)
    }
  ],
  "failedExecutions": string
}
Fields
mockStrategy

enum (MockStrategy)

Mockstrategy defines how the particular task should be mocked during test execution

parameters[]

object (EventParameter)

Optional. List of key-value pairs for specific mock strategy

failedExecutions

string (int64 format)

Optional. Number of times the given task should fail for failure mock strategy

MockStrategy

Possible values for mock strategy

Enums
MOCK_STRATEGY_UNSPECIFIED This should never be used to annotate a field
NO_MOCK_STRATEGY Execute actual task
SPECIFIC_MOCK_STRATEGY Don't execute actual task, instead use the values specified by user for output of the task
FAILURE_MOCK_STRATEGY Don't execute actual task, instead return task failure
SKIP_MOCK_STRATEGY Don't execute actual task, instead mark it as successful

Assertion

An assertion which will check for a condition over task execution status or an expression for task output variables

JSON representation
{
  "assertionStrategy": enum (AssertionStrategy),

  // Union field assertion_config can be only one of the following:
  "parameter": {
    object (EventParameter)
  },
  "condition": string,
  "retryCount": integer
  // End of list of possible types for union field assertion_config.
}
Fields
assertionStrategy

enum (AssertionStrategy)

Optional. The type of assertion to perform.

Union field assertion_config.

assertion_config can be only one of the following:

parameter

object (EventParameter)

Optional. Key-value pair for ASSERT_EQUALS, ASSERT_NOT_EQUALS, ASSERT_CONTAINS to succeed

condition

string

Optional. Standard filter expression for ASSERT_CONDITION to succeed

retryCount

integer

Number of times given task should be retried in case of ASSERT_FAILED_EXECUTION

AssertionStrategy

Enum for possible Assertion strategies.

Enums
ASSERTION_STRATEGY_UNSPECIFIED Unspecified Assertion strategy
ASSERT_SUCCESSFUL_EXECUTION Test a successful execution
ASSERT_FAILED_EXECUTION Test a failed execution
ASSERT_NO_EXECUTION Test that the task was never executed
ASSERT_EQUALS Test the parameter selected is equal to the expected value
ASSERT_NOT_EQUALS Test the parameter selected is not equal to the expected value
ASSERT_CONTAINS Test the parameter selected contains the configured value
ASSERT_CONDITION Test a specific condition

Methods

create

Creates a new test case

delete

Deletes a test case

download

Downloads a test case.

executeTest

Executes functional test

get

Get a test case

list

Lists all the test cases that satisfy the filters.

listExecutions

Lists the results of all functional test executions.

patch

Updates a test case

takeoverEditLock

Clear the lock fields and assign them to current user

upload

Uploads a test case.