✅ test(munit): cover all HTTP status codes simulated by the http-status API - #3
Draft
andersoal wants to merge 2 commits into
Draft
✅ test(munit): cover all HTTP status codes simulated by the http-status API#3andersoal wants to merge 2 commits into
andersoal wants to merge 2 commits into
Conversation
…us API
Add http-status-all-test-suite.xml exercising GET /api/http-status/{httpStatus}
for every supported code:
- all 19 codes (200..511) via a permissive 200..599 response validator,
asserting returned statusCode and that the JSON body echoes the code
- the 15 error codes again through the default response validator,
asserting each raises a real Mule error with the expected statusCode
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHWtYyqVEVFwgk58e6eo77
… code Replace the two foreach-driven tests with 34 dedicated munit:test blocks (19 simulated via the permissive validator + 15 raising real Mule errors via the default validator), one per HTTP status code, so each is exercised and reported as its own independent test case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FHWtYyqVEVFwgk58e6eo77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first MUnit test suite to this repo (
src/test/munit/http-status-all-test-suite.xml— the folder previously only contained.gitkeep), so that every HTTP status code the http-status API can simulate is covered in MUnit.The tests enable the
http-status-mainflow source (APIKit router + listener on port 8081) and call the real API through the existing globalHTTP_Request_configuration.What it covers
200, 201, 204, 209, 400, 401, 403, 404, 405, 409, 410, 415, 422, 429, 500, 502, 503, 504, 511) viaGET /api/http-status/{httpStatus}using a permissive200..599response validator, asserting:attributes.statusCodeequals the requested code, andpayload.code), except for204 No Content.error.errorMessage.attributes.statusCodematches) and logging the raisederror.errorTypefor visibility.Verification
xmllint.mvn testcould not be executed in this sandbox: the network policy blocksrepository.mulesoft.organdmaven.anypoint.mulesoft.com, so the Mule runtime/MUnit artifacts cannot be downloaded (also, only Java 21 is available here whileapp.runtimeis 4.6.9). Please runmvn clean testlocally to confirm.🤖 Generated with Claude Code
https://claude.ai/code/session_01FHWtYyqVEVFwgk58e6eo77
Generated by Claude Code