Can I confirm something from the docs?
https://case.contract-testing.io/docs/reference/triggers#providing-triggers-during-contract-definition.
Gonna paraphrase the docs to see if my understanding is correct.
The 3 ways to define a trigger are:
1. In the `runExample` arguments (for a successful response)
2. In the `runRejectingExample` arguments (for an unsuccessful response)
3. A group of named triggers in the ContractCaseConfig object (for contract verification)
The docs has the usage of (1) as:
```await contract.runExample({
states: [...], // These `...` are not spreads, just for brevity
definition: willSendHttpRequest(...),
},
{
// Presumably the ContractCaseConfig object as an override for the parent config
trigger: (config: HttpRequestConfig) => {},
testResponse: (user) => {}
})```
But looking in
https://github.com/case-contract-testing/contract-case/blob/1eeef00cf6eef5ac942003544d0496fd466effa2/packages/case-core/src/index.http.client.define.spec.ts#L144, the triggers are defined as:
```contract.runRejectingExample({
states: [...],
definition: willSendHttpRequest(...),
trigger: (config: HttpRequestConfig) => { ... },
testResponse: (user) => { ... },
});```
Are both of these patterns going to be supported? Can I converge on just one of these in the DSL?
Looks like the former example is more aligned to the boundary schema, but the latter feels more natural.
From
https://github.com/case-contract-testing/contract-case/blob/main/docs/maintainers/AddingDsl.md#implementing-the-contractdefiner-class there is a TODO. Is this just going to say that a trigger needs to be paired with a response (whether success or rejecting), and you can?t have one without the other?
> TODO: Describe how to map trigger / testResponse - this is the only place where you may throw a `CaseConfigurationError`