Skip to content

✅ test(munit): cover all HTTP status codes simulated by the http-status API - #3

Draft
andersoal wants to merge 2 commits into
mainfrom
claude/wayfinder-http-status-munit-lpo24w
Draft

✅ test(munit): cover all HTTP status codes simulated by the http-status API#3
andersoal wants to merge 2 commits into
mainfrom
claude/wayfinder-http-status-munit-lpo24w

Conversation

@andersoal

Copy link
Copy Markdown
Owner

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-main flow source (APIKit router + listener on port 8081) and call the real API through the existing global HTTP_Request_configuration.

What it covers

  • All 19 codes (200, 201, 204, 209, 400, 401, 403, 404, 405, 409, 410, 415, 422, 429, 500, 502, 503, 504, 511) via GET /api/http-status/{httpStatus} using a permissive 200..599 response validator, asserting:
    • the returned attributes.statusCode equals the requested code, and
    • the JSON body echoes the code (payload.code), except for 204 No Content.
  • The 15 error codes again through the default response validator, asserting each one raises a real Mule error (error.errorMessage.attributes.statusCode matches) and logging the raised error.errorType for visibility.

Verification

  • XML well-formedness validated with xmllint.
  • ⚠️ mvn test could not be executed in this sandbox: the network policy blocks repository.mulesoft.org and maven.anypoint.mulesoft.com, so the Mule runtime/MUnit artifacts cannot be downloaded (also, only Java 21 is available here while app.runtime is 4.6.9). Please run mvn clean test locally to confirm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FHWtYyqVEVFwgk58e6eo77


Generated by Claude Code

claude added 2 commits July 19, 2026 18:31
…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
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