-
Notifications
You must be signed in to change notification settings - Fork 24
test: add integration tests for PATCH v1/endorsements/{id} endpoint #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add integration tests for PATCH v1/endorsements/{id} endpoint #207
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThe changes centralize various error message strings as constants in the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as UpdateEndorsementsIntegrationTest
participant API as EndorsementsController
participant Service as EndorsementService
participant Repo as EndorsementRepository
participant RDS as RdsServiceImplementation
Test->>API: PATCH /v1/endorsements/{id} (with message)
API->>Service: updateEndorsement(id, message, user)
Service->>Repo: findById(id)
Repo-->>Service: Endorsement or null
Service->>RDS: getUserDetails(userId)
RDS-->>Service: UserDetails or Exception
Service->>Repo: save(updated Endorsement)
Repo-->>Service: Updated Endorsement
Service-->>API: Updated Endorsement
API-->>Test: HTTP Response (200/400/401/403/404)
Assessment against linked issues
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
skill-tree/src/main/java/com/RDS/skilltree/services/external/RdsServiceImplementation.java(2 hunks)skill-tree/src/main/java/com/RDS/skilltree/utils/Constants.java(1 hunks)skill-tree/src/main/java/com/RDS/skilltree/viewmodels/UpdateEndorsementViewModel.java(1 hunks)skill-tree/src/main/resources/application-test.properties(1 hunks)skill-tree/src/test/java/com/RDS/skilltree/integration/skills/UpdateEndorsementsIntegrationTest.java(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
skill-tree/src/main/java/com/RDS/skilltree/viewmodels/UpdateEndorsementViewModel.java (1)
skill-tree/src/main/java/com/RDS/skilltree/utils/Constants.java (2)
Constants(3-16)ExceptionMessages(6-15)
skill-tree/src/main/java/com/RDS/skilltree/services/external/RdsServiceImplementation.java (1)
skill-tree/src/main/java/com/RDS/skilltree/utils/Constants.java (2)
Constants(3-16)ExceptionMessages(6-15)
🔇 Additional comments (1)
skill-tree/src/main/resources/application-test.properties (1)
1-1: Verify that every helper relying oncookieNamewas updatedChanging the cookie name in the test profile to match production (
rds-session-v2) is sensible, but double-check:
- Any code that reads the
cookieNameproperty programmatically.- Utility helpers (e.g.,
RestAPIHelper#getGuestUserCookie) that may still send the old value.- CI pipelines caching cookies between test steps.
A quick grep over the codebase (or running the existing integration test suite) will catch lingering references.
Date: 23 May 2025
Developer Name: @Shyam-Vishwakarma
Issue Ticket Number
Description
Added integration tests for PATCH v1/endorsements/{endorsementId} endpoint
Added centralized exception messages by adding constants in
Constants.javaand updated usage of the hardcoded error messages with these constants.Changed the
cookieNameproperty inapplication-test.propertiesfromrds-session-v2-developmenttords-session-v2to align with the production-like configuration and make consistent withRESTApiHelperclass.Note: Four tests are being skipped because the bugs related to these tests will be fixed once the issue [BUG] Fix bugs in PATCH /v1/endorsements/{id} endpoint #206 is resolved.
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Build success:Test Coverage
Screenshot 1
Additional Notes
mvn verify --file skill-tree/pom.xml -Dskip-ut=truecommand to run integration tests, andmvn test --file skill-tree/pom.xmlto run unit tests