(integ-runner): (assertions on object keys) #33068
Labels
@aws-cdk/integ-runner
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Allow assertions about the keys contained in an API call response. ExpectedResults that contain generated data. Currently, only full matching is supported.
Use Case
One example - Writing a custom provider that generates a set of secret values and stores it in a secretsmanager secret as a JSON object. It's impossible to match the complete object since the secrets are generated by the custom provider. A partial match on the object (e.g. verifying a particular key exists) would be sufficient to verify the behavior of the provider.
Proposed Solution
In the base assertions module, this can be accomplished using
Match.absent()
andMatch.any_value()
. Adding comparable methods for integration test assertions seems like a reasonable implementation.Beyond that, adding the ability to match an object value by regex would allow for greater specificity in one's assertions.
Other Information
No response
Acknowledgements
CDK version used
2.174.0
Environment details (OS name and version, etc.)
MacOS 15.2
The text was updated successfully, but these errors were encountered: