Skip to content

Add test coverage for JsonErrorReportValve#965

Open
onkar717 wants to merge 1 commit intoapache:mainfrom
onkar717:add-json-error-report-valve-tests
Open

Add test coverage for JsonErrorReportValve#965
onkar717 wants to merge 1 commit intoapache:mainfrom
onkar717:add-json-error-report-valve-tests

Conversation

@onkar717
Copy link

Description

Add dedicated test coverage for JsonErrorReportValve.

JsonErrorReportValve currently lacks specific tests compared to ErrorReportValve. This PR introduces TestJsonErrorReportValve to verify JSON error reporting behavior.

Motivation

JsonErrorReportValve does not currently have dedicated tests. Adding coverage helps ensure correctness and stability of JSON error reporting functionality.

Tests added

• JSON response for HTTP 500 errors
• JSON response for HTTP 404 errors
• Throwable information when exceptions occur
• JSON escaping of special characters
• Custom status code handling
• Chained exception handling

Implementation notes

Tests follow existing patterns from TestErrorReportValve and use TomcatBaseTest utilities. No new dependencies were introduced.

Impact

Improves test coverage and helps prevent regressions.

No production code changes were made.
This is a test-only change.

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.

1 participant