Digital Twin Registry: E2E test spec¶
A partner finds a twin by its part number and reads it through the owner's connector, and a twin that does not exist is not found.
Repository: sldt-digital-twin-registry · Spec 1.0 · Proven · Raw spec for your AI · All specs
Note
The worked example is built from tests 1 to 3 of this spec and passes in GitHub Actions. Test 4 is new and has not been run yet.
1 · The product in brief¶
A company lists its parts in the registry as "digital twins": one shell descriptor per part, with the part numbers it is known by and a pointer to where its data is. A partner who knows a part number asks the registry, through the owner's connector, which twin belongs to it. Without the registry, a partner cannot find any data.
2 · The journey the test tells¶
| Side | Played by |
|---|---|
| Your side (SUT) | The owner's connector and its Digital Twin Registry |
| Partner side (engine) | The partner's connector, where the tests run from |
- The owner offers its registry in its connector, under an access and a usage policy.
- The owner registers a twin with a part number the partner may see.
- The partner negotiates access to the registry and gets a token.
- The partner looks the part number up and gets the twin's id.
- The partner reads the twin. Its answer matches the AAS shell descriptor schema.
- The owner removes the twin and the offer again.
3 · The TCK you deliver¶
tck/e2e/
├── index.yaml # the manifest
├── tests/
│ ├── register_and_read.yaml
│ ├── partner_reads_through_connector.yaml
│ ├── unknown_twin_is_not_found.yaml
│ └── hidden_twin_stays_hidden.yaml (optional)
└── schemas/
└── shell_descriptor.json
.tractusx # e2eTest: tck/e2e
.github/workflows/e2e-test.yml
| Manifest field | Value |
|---|---|
kind · syntax |
tck · v1-alpha |
id |
digital-twin-registry-e2e |
metadata.license |
Apache-2.0 |
metadata.standards |
CX-0002 v2.3.0 |
dataspace |
ecosystem: Catena-X, version: saturn |
infrastructure.engine |
connector |
infrastructure.sut |
connector, Digital Twin Registry |
Variables (env.variables)
| id | Kind | What it is | Example | In the workflow |
|---|---|---|---|---|
engine_bpnl |
variable/type/string, source: input, scope: engine |
BPN of the partner. The twin is made visible to this BPN. | BPNL000000000002 |
Filled from engine_bpnl. |
sut_bpnl |
variable/type/string, source: input, scope: sut |
BPN of the owner. Only test 4 needs it, for a part number the partner may not see. | BPNL000000000001 |
Filled from sut_bpnl. |
dtr_internal_url |
variable/type/string, source: input, scope: sut |
The registry API as the owner's connector reaches it. It is the asset's base URL. | http://provider-dtr.umbrella.svc.cluster.local:8080/api/v3 |
Filled from dtr_internal_url. |
access_policy |
config/connector/policy |
Who may see the registry offer: active members. | – | Written in the manifest |
usage_policy |
config/connector/policy |
What the registry may be used for: active membership, the framework agreement DataExchangeGovernance:1.0 and the usage purpose cx.core.digitalTwinRegistry:1. | – | Written in the manifest |
Schemas (env.schemas)
| id | File | What it checks | Copy it from |
|---|---|---|---|
shell_descriptor |
schemas/shell_descriptor.json |
The AAS shell descriptor. Every answer that returns a twin is held to it. | examples/digital-twin-registry/tck/e2e/schemas/shell_descriptor.json |
Runs in the workshop: Yes. Workflow input run-in-toolbox: true.
4 · The tests¶
Every row is one step. Every ☐ is one validate entry. The step names are TestLab's own: look each one up in the IDE's block catalog for its inputs.
Test 1 · A registered twin can be read back and matches the AAS schema¶
tests/register_and_read.yaml · id register-and-read · Positive · Contract
Proves: The owner's registry stores a twin as it was given and returns it in the shape the standard prescribes.
execution
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Mint a twin id that is new in every run. | util/generate_uuid |
– |
| 2 | Register a twin with that id, one manufacturerPartId and one submodel descriptor. | digital-twin-registry/provider/create_shell_descriptor |
☐ The id returned is the id that was sent. ☐ The answer matches the shell_descriptor schema. |
| 3 | Read the twin back as the owner. | digital-twin-registry/provider/get_shell_descriptor |
☐ id and idShort are the ones that were sent. ☐ The manufacturerPartId has the value that was sent. ☐ The answer matches the shell_descriptor schema. |
teardown
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Delete the twin. | digital-twin-registry/provider/delete_shell_descriptor |
☐ The registry answers 204. |
Test 2 · A partner finds and reads the twin through the owner's connector¶
tests/partner_reads_through_connector.yaml · id partner-reads-through-connector · Journey · Positive · Contract
Proves: A partner who knows nothing but a part number reaches the right twin through the dataspace.
setup
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Create the access policy. | connector/provider/create_policy |
– |
| 2 | Create the usage policy. | connector/provider/create_policy |
– |
| 3 | Offer the registry as an asset of type https://w3id.org/catenax/taxonomy#DigitalTwinRegistry, with base URL dtr_internal_url. | connector/provider/create_asset |
– |
| 4 | Publish the offer under both policies. | connector/provider/create_contract_definition |
– |
| 5 | Register a twin whose customerPartId is visible to the partner's BPN and whose manufacturerPartId is PUBLIC_READABLE. | digital-twin-registry/provider/wizard/create_shell_descriptor |
– |
| 6 | Attach a submodel descriptor that points at the owner's connector. | digital-twin-registry/provider/create_submodel_descriptor |
– |
execution
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | As the partner, negotiate access to the registry. | connector/discover/digital-twin-registry/auth |
☐ A data plane URL is returned. ☐ An EDR token is returned. |
| 2 | Look the twin up by its manufacturerPartId. | digital-twin-registry/consumer/dataplane/lookup_shell |
☐ The list of shell ids contains the twin registered in setup. |
| 3 | Read the twin through the data plane. | digital-twin-registry/consumer/dataplane/get_shell_descriptor |
☐ The id is the twin registered in setup. ☐ The answer matches the shell_descriptor schema. |
teardown
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Delete the twin. | digital-twin-registry/provider/delete_shell_descriptor |
– |
| 2 | Delete the contract definition. | connector/provider/delete_contract_definition |
– |
| 3 | Delete the asset. | connector/provider/delete_asset |
– |
| 4 | Delete the usage policy. | connector/provider/delete_policy |
– |
| 5 | Delete the access policy. | connector/provider/delete_policy |
– |
Test 3 · A twin that does not exist is answered with 404¶
tests/unknown_twin_is_not_found.yaml · id unknown-twin-is-not-found · Negative
Proves: The registry does not invent data for an id it has never held.
execution
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Ask the registry for a twin id it has never held, base64url-encoded in the path as the AAS API expects. | connector/dataplane/http_request |
☐ The registry answers 404. |
Test 4 · A twin the partner may not see is not in its lookup (optional)¶
tests/hidden_twin_stays_hidden.yaml · id hidden-twin-stays-hidden · Negative
Proves: The registry only shows a partner the part numbers that were shared with its BPN.
setup
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Create both policies, the asset and the contract definition, as in test 2. | connector/provider/create_policy |
– |
| 2 | Register a twin whose only part number is visible to the owner's own BPN, not to the partner. | digital-twin-registry/provider/wizard/create_shell_descriptor |
– |
execution
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | As the partner, negotiate access to the registry. | connector/discover/digital-twin-registry/auth |
– |
| 2 | Look the hidden twin up by its part number. | digital-twin-registry/consumer/dataplane/lookup_shell |
☐ The list of shell ids does not contain the hidden twin. |
teardown
| # | What happens | Step | Must be true |
|---|---|---|---|
| 1 | Delete the twin, the offer and both policies, in that order. | digital-twin-registry/provider/delete_shell_descriptor |
– |
5 · Break it on purpose¶
A check that cannot fail proves nothing. Make each change once, see the test go red for this reason, and change it back.
| Test | Change | Expect |
|---|---|---|
register_and_read.yaml |
Expect idShort "e2eTwinX" instead of "e2eTwin". | The read-back check fails and names idShort. |
partner_reads_through_connector.yaml |
Remove the submodel descriptor from setup. | The schema check on the partner's read fails. This is the red run of the worked example. |
unknown_twin_is_not_found.yaml |
Expect 200 instead of 404. | The check fails with the real answer, 404. |
6 · Watch out¶
- A twin without a submodel descriptor fails the schema check. That is correct, not a bug in the test.
- Use a new twin id in every run (util/generate_uuid), or the second run fails with a conflict.
- The not-found test needs the id base64url-encoded in the path, without padding.
7 · Not in this spec¶
- Submodel data itself. The registry only points at it; reading it is a test for the submodel server.
- Paging through many twins.
8 · Give it to your assistant¶
Attach or paste the raw spec, then send:
Build the E2E test project for Digital Twin Registry in tck/e2e, exactly as the spec
sldt-digital-twin-registry.yaml describes it. The manifest id is digital-twin-registry-e2e; every test
file repeats it as namespace. Write the required tests first: register_and_read.yaml, partner_reads_through_connector.yaml, unknown_twin_is_not_found.yaml.
Use only the steps the spec names, and look each one up in the block catalog
before you write its inputs. Every check in the spec becomes one validate entry.
Addresses, BPNs and secrets are variables, never values in a test.
Compile after each file and fix what the compiler reports.
Done when¶
The definition of done for every product, and:
-
tests/register_and_read.yamlis green. -
tests/partner_reads_through_connector.yamlis green. -
tests/unknown_twin_is_not_found.yamlis green.
Sources¶
NOTICE¶
This work is licensed under the CC-BY-4.0.
- SPDX-License-Identifier: CC-BY-4.0
- SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
- Source URL: https://github.com/eclipse-tractusx/tutorial-resources