# What the source fixture holds, and what {{product_name}} must make of it. # # The test modules beside this file are generic: they are the same in every source-aligned CDC # product, and everything specific to this one is here. Rows come from # fixture/init/010_customer.sql; the canonical identifiers are not written down, because the # tests derive them with the platform's identity rule, which is what the transform implements. source: system: "{{system}}" object: "{{source_schema}}.{{source_object}}" table: "{{source_schema}}.{{source_object}}" key: "id" rows: 6 # The columns a test replays a source row with. Only what the transform reads: a replayed # record is JSON on the raw topic, and a column the raw contract types differently (a DATE # the connector encodes as a number) would be refused by the transform's parser. replay_columns: ["id", "cust_name", "cust_type", "status_code", "trading_name"] capture: raw_topic: "raw.{{system}}.{{source_schema}}.{{source_object}}" # What the capture adds around a source row. A record a test puts on the raw topic carries it # too, so a replayed record is indistinguishable from a captured one. replay_envelope: {"__op": "r", "__lsn": 0, "__source_ts_ms": 0} # Fields the capture adds to every record, so a consumer can tell what happened and when. provenance_fields: ["__op", "__lsn", "__source_ts_ms"] # A row inserted by a test, to prove capture is live rather than a one-off snapshot. It is # removed again afterwards; ids above 900 are the tests' own. probe: insert: "INSERT INTO {{source_schema}}.{{source_object}} (id, cust_name, cust_type, status_code) VALUES (900, 'Live Capture Ltd', 'O', 'A')" delete: "DELETE FROM {{source_schema}}.{{source_object}} WHERE id = 900" source_key: 900 transform: target_topic: "{{target_domain}}.{{target_product}}.{{target_table}}.inbound" target_key: "party_id" headers: ["source_system", "source_object", "source_key", "produced_by"] accepted: - source_key: 1 record: party_type: "Person" legal_name: "Ada Lovelace" also_known_as: null party_status: "Active" - source_key: 2 record: party_type: "Person" legal_name: "Grace Hopper" also_known_as: null party_status: "Prospect" - source_key: 3 record: party_type: "Company" legal_name: "Semprini Holdings Ltd" also_known_as: "Semprini" party_status: "Active" - source_key: 4 record: party_type: "Company" legal_name: "Northwind Trading Co" also_known_as: "Northwind" party_status: "Closed" rejected: - source_key: 5 reason_contains: "party_status" - source_key: 6 reason_contains: "party_type" # Records put straight onto the raw topic, as the connector would have written them: one the # transform must refuse, one it must accept. Together they prove a bad record is quarantined # rather than stopping the flow. probe_records: bad: record: {"id": 901, "cust_name": "Poison Ltd", "cust_type": "Q", "status_code": "A", "__op": "c", "__lsn": 0, "__source_ts_ms": 0} source_key: 901 reason_contains: "party_type" good: record: {"id": 902, "cust_name": "Survivor Ltd", "cust_type": "O", "status_code": "A", "__op": "c", "__lsn": 0, "__source_ts_ms": 0} source_key: 902 party_type: "Company" legal_name: "Survivor Ltd" delivery: # Where the canonical product puts what this product sends it. schema: "canonical_party" table: "party" key: "party_id"