valid-test-case-expected-status
Overview
This rule belongs to the apimatic-codegen-validation ruleset and states that:
The expected status of a test case must be a valid HTTP status code or range and its corresponding response definition must be present in the endpoint responses.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | The expected status of test case is invalid. |
| Code | APIMATICCODEGEN_V167 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Test Cases |
| Products Impacted | Code Generation, Developer Experience Portal |
| Tags | apimatic code generation codegen sdks portal docs validation apimatic response status test case endpoint |
Suggested Fixes
- The expected status must contain only 3 characters (digits or X for ranges).
- For ranges, use "X" in upper case only. Ranges like 2xX or 2Xx are not valid.
- XXX is not a valid range.
- If only digits are used, the expected status must be a valid HTTP status code.
- Must match regex pattern [1-5][0-5X][0-8X]
- Disable the test case by turning off the
Enabledflag.
For More Information
- https://docs.apimatic.io/testing/defining-your-first-test-case/#step-4-specify-header-status
- https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
- https://docs.apimatic.io/testing/defining-test-case/#step-2-describe-test-case
- https://www.apimatic.io/continuous-code-generation
- https://docs.apimatic.io/rulesets/overview/