{{ message }}
Add unit tests for error handling and authorization checks#12
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
Add unit tests for error handling and authorization checks#12devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add JUnit 5 and Mockito test dependencies to pom.xml - Add maven-surefire-plugin for running JUnit 5 tests - Add RequestExceptionTest: tests for error handling with various HTTP status codes (400, 404, 422, 500, 503) - Add LoggingInterceptorTest: tests for error handling in HTTP interceptor - Add AuthorizationTest: tests for 401 Unauthorized and 403 Forbidden scenarios including: - Missing/expired/malformed tokens - Commenting on private transactions without permission - Accessing resources from other organizations - Insufficient scope errors - Read-only transaction modifications Total: 22 tests covering error handling and authorization scenarios Co-Authored-By: Jack <jack.l.killian@gmail.com>
Author
Author
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 unit tests to cover error handling and authorization scenarios that were previously missing from the test suite. This includes tests for HTTP error responses (400, 404, 422, 500, 503) and authorization failures (401 Unauthorized, 403 Forbidden).
Changes:
pom.xmlmaven-surefire-pluginfor running JUnit 5 testsRequestExceptionTest- Verifies exception message formatting for various HTTP error codesLoggingInterceptorTest- Tests error handling in the HTTP interceptor for 4xx/5xx responsesAuthorizationTest- Tests 401 (missing/expired/malformed tokens) and 403 (private transaction access, insufficient scope, cross-org access) scenariosReview & Testing Checklist for Human
mvn clean testlocally to confirm all 22 tests passTest Plan
mvn clean test- should see 22 tests passNotes
Link to Devin run: https://app.devin.ai/sessions/d14feb55c19d44f984fa1948afb60ec8
Requested by: Jack (@jack-killian)