> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Cases

> Create and manage data quality test case instances applied to specific tables and columns

# Test Cases

A **Test Case** is an instance of a test definition applied to a specific table or column with concrete parameter values. Test cases produce test results when executed.

<Info>
  A test case links a test definition (the validation logic) to a specific entity (table or column) via an entity link, with parameter values that configure the check.
</Info>

## Entity Link Format

Test cases reference their target entity using an entity link string:

| Level      | Format                                    | Example                                                                       |
| ---------- | ----------------------------------------- | ----------------------------------------------------------------------------- |
| **Table**  | `<#E::table::tableFQN>`                   | `<#E::table::sample_data.ecommerce_db.shopify.dim_address>`                   |
| **Column** | `<#E::table::tableFQN::columns::colName>` | `<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>` |

## Fully Qualified Name

The FQN format for a test case depends on the level:

```
# Table-level test case
sample_data.ecommerce_db.shopify.dim_address.testCaseName

# Column-level test case
sample_data.ecommerce_db.shopify.dim_address.shop_id.testCaseName
```

## Test Case Lifecycle

1. **Create** -- Define a test case with a test definition, entity link, and parameter values.
2. **Execute** -- The test case runs (via a test suite execution or manually) and produces a result.
3. **Review** -- View test results with status (`Success`, `Failed`, `Aborted`) and result values.

***

## API Endpoints

| Method   | Endpoint                                        | Description                                                                 |
| -------- | ----------------------------------------------- | --------------------------------------------------------------------------- |
| `POST`   | `/v1/dataQuality/testCases`                     | [Create a test case](/v1.12.x/api-reference/data-quality/test-cases/create) |
| `GET`    | `/v1/dataQuality/testCases`                     | [List test cases](/v1.12.x/api-reference/data-quality/test-cases/list)      |
| `GET`    | `/v1/dataQuality/testCases/{id}`                | [Get by ID](/v1.12.x/api-reference/data-quality/test-cases/retrieve)        |
| `GET`    | `/v1/dataQuality/testCases/name/{fqn}`          | [Get by FQN](/v1.12.x/api-reference/data-quality/test-cases/retrieve)       |
| `PATCH`  | `/v1/dataQuality/testCases/{id}`                | [Update by ID](/v1.12.x/api-reference/data-quality/test-cases/update)       |
| `DELETE` | `/v1/dataQuality/testCases/{id}`                | [Delete by ID](/v1.12.x/api-reference/data-quality/test-cases/delete)       |
| `GET`    | `/v1/dataQuality/testCases/{id}/versions`       | [List versions](/v1.12.x/api-reference/data-quality/test-cases/versions)    |
| `GET`    | `/v1/dataQuality/testCases/{id}/testCaseResult` | [Get test results](/v1.12.x/api-reference/data-quality/test-cases/results)  |
| `PUT`    | `/v1/dataQuality/testCases/{id}/testCaseResult` | [Add test result](/v1.12.x/api-reference/data-quality/test-cases/results)   |
