Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request pre-processing, response value assertions, and stateful contract testing. #1444

Merged
merged 23 commits into from
Nov 22, 2024

Conversation

StarKhan6368
Copy link
Collaborator

What: Examples pre-processing, response value assertions, and stateful contract testing.

Why:

  • This enables the substitution of payload data from a custom config or a running entity prior to making requests
  • Enables the assertion of response values based on the request, a running entity cache, and additional stores.

How:

  • Implement a running entity cache and configuration store.
  • Implement substitution from these stores into the requests whenever necessary.
  • Create assertions for Equals, NotEquals, If-Then-Else, and array_has operations.
  • And more.

Checklist:

StarKhan6368 and others added 23 commits November 19, 2024 08:53
- Add ability to load partial examples for contract test.
- Add ExamplePreProcessor for substitution of values from payload config
  or running entity created from test responses.
- [WIP] Discriminator to ignore if it sees substitution pattern.
- Add env-var and attribute in SpecmaticConfig to specify payload config
- Add ExamplePostValidator to validate the response based on response
  value validation, only works when enabled.
- Process getHttpRequest before sending out, resolve any running
  entity substitutions
- Pending response based lookup modification
- The lookup key for the response needs to be dynamically modified
  when an array value is used.
 - [WIP] Discriminator failures on pattern tokens
- Fix matches to originalScenario and not newBasedOn
- Also parse response header asserts.
- Use additionalExampleParamsFilePath
- Move traverse functions to ExampleProcessor
- Can replace and merge with existing ENTITY
- Modifications to HttpRequestPattern.matchBody parsing logic
- This fixes unknown information appearing on request failure or
  test abortions.
@joelrosario joelrosario merged commit a18f874 into main Nov 22, 2024
2 checks passed
@joelrosario joelrosario deleted the req-proc-res-val branch November 22, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants