Add comprehensive tests for User API controllers#357
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
Add comprehensive tests for User API controllers#357devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
- UsersApiTest: Add tests for blank email, blank password, missing fields, all blank fields, duplicated email+username combo, nonexistent email login, blank login fields, invalid email format login, response structure validation - CurrentUserApiTest: Add tests for duplicate username on update, both email and username duplicate on update, partial updates (bio only, image only), invalid token on update, invalid email format on update, self-email/username update allowed, response structure validation for GET and PUT Co-Authored-By: mason.batchelor@cognition.ai <masonbatchelor81@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Add comprehensive edge case tests for User API controllers
Summary
Adds 24 new test cases across
UsersApiTestandCurrentUserApiTestto improve coverage for validation errors, authentication scenarios, and error handling edge cases that were previously untested.UsersApiTest (14 new tests):
email,username,bio,image,token) present on successful registration and loginCurrentUserApiTest (10 new tests):
Also includes a trivial spotless auto-format change in
DefaultJwtServiceTest.java(line wrapping only).Review & Testing Checklist for Human
should_update_user_profile_with_only_bio/image) correctly mock empty-string defaults — these rely onUpdateUserParam's@Builder.Defaultvalues being"". If those defaults ever change, these tests will silently break.notNullValue()assertions (used for blank/missing email in registration) are acceptable. Exact message matching was avoided because both@NotBlankand@Emailvalidators can fire, but this makes the assertions weaker../gradlew testwith Java 11 to confirm all 24 new + 15 existing tests pass end to end.Notes