Add comprehensive new test cases across all layers#573
Open
devin-ai-integration[bot] wants to merge 3 commits intodevin/1776604281-java17-springboot3-upgradefrom
Open
Add comprehensive new test cases across all layers#573devin-ai-integration[bot] wants to merge 3 commits intodevin/1776604281-java17-springboot3-upgradefrom
devin-ai-integration[bot] wants to merge 3 commits intodevin/1776604281-java17-springboot3-upgradefrom
Conversation
New test files: - TagsApiTest: Tags API endpoint tests (previously untested) - AuthorizationServiceTest: Unit tests for article/comment authorization - UserTest: User domain model creation and update tests - UtilTest: Util.isEmpty edge case tests - ArticleUpdateTest: Article update, slug generation, tag dedup tests - UsersApiLoginEdgeCaseTest: Login edge cases (non-existent email, blank fields) - ProfileApiEdgeCaseTest: Profile 404s, follow/unfollow auth and edge cases - ArticleApiEdgeCaseTest: Auth, 404s, partial update, read as authed user - CommentsApiEdgeCaseTest: Auth, 404s, article author delete, edge cases - ArticleFavoriteApiEdgeCaseTest: Auth and 404 edge cases - ListArticleApiFilterTest: Tag/author/favorited filters, pagination, feed pagination Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
Devin Review
|
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:
|
Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…econd race Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
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 11 new test files with ~60 new test cases that significantly expand coverage across all layers of the application. These target gaps identified in the existing test suite including completely untested endpoints, missing edge cases, domain model unit tests, and authorization logic.
New Test Files
Unit Tests (Core/Domain):
UserTest— User creation, selective field updates, null handling, unique ID generationArticleUpdateTest— Article update logic, slug regeneration, tag deduplication, timestamp behaviorAuthorizationServiceTest— Article/comment write authorization for authors, comment owners, and unauthorized usersUtilTest—isEmpty()edge cases (null, empty, whitespace, non-empty)API Tests (Controller Layer):
TagsApiTest— GET /tags endpoint (previously had zero API-level tests)UsersApiLoginEdgeCaseTest— Login with non-existent email, blank fields, invalid email format; registration with blank/missing fieldsProfileApiEdgeCaseTest— 404 for non-existent profiles, follow/unfollow non-existent users, 401 without authArticleApiEdgeCaseTest— Read as authenticated user, 404 on update/delete non-existent articles, 401 without auth, partial updateCommentsApiEdgeCaseTest— 404 on non-existent article/comment, 401 without auth, article author deleting another user's commentArticleFavoriteApiEdgeCaseTest— 401 without auth, 404 on non-existent articlesListArticleApiFilterTest— Filtering by tag/author/favorited, pagination params, combined filters, feed paginationReview & Testing Checklist for Human
./gradlew test)Notes
./gradlew testLink to Devin session: https://app.devin.ai/sessions/0f1e4b42fdb74defa8b6b2bb3393595a
Requested by: @scottyandrade99