Add comprehensive unit tests to reach 80% JaCoCo coverage threshold#147
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add comprehensive unit tests to reach 80% JaCoCo coverage threshold#147devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add GraphQL datafetcher tests: ArticleDatafetcher, CommentDatafetcher, MeDatafetcher, ProfileDatafetcher, TagDatafetcher - Add GraphQL mutation tests: ArticleMutation, CommentMutation, UserMutation, RelationMutation - Add SecurityUtil test - Add GraphQLCustomizeExceptionHandler test - Add ArticleCommandService test - Add CursorPager and pagination utility tests - Add data class tests (ArticleData, CommentData, ProfileData, etc.) - Add generated DGS types test (builder/setter/equals coverage) - Add CoreDomain test (Article, User, Comment, Tag, AuthorizationService) Coverage improvement: 33% -> 87% (instructions), 34% -> 89% (lines) All tests pass, no production code modified.
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.
Summary
Adds 16 new test files (~2900 lines) to bring JaCoCo instruction coverage from 33% → 87% and line coverage from 34% → 89%, passing the
jacocoTestCoverageVerificationgate (80% minimum). No production code was modified.Coverage before → after
Test classes added
GraphQL layer (previously 0.5–4.5% coverage → ~96%):
ArticleDatafetcherTest— feed, userFeed, userFavorites, userArticles, pagination cursorsArticleMutationTest— create/update/delete/favorite/unfavorite with auth checksCommentDatafetcherTest— article comments with cursor paginationCommentMutationTest— create/delete with authorizationUserMutationTest— register/login/update user flowsMeDatafetcherTest— current user query via JWTProfileDatafetcherTest— profile lookups and author resolutionRelationMutationTest— follow/unfollow with authTagDatafetcherTest— tag listingSecurityUtilTest— authenticated/anonymous user extractionGraphQLCustomizeExceptionHandlerTest— error mapping for validation + auth exceptionsApplication/service layer:
ArticleCommandServiceTest— article creation and update commandsCursorPagerTest— keyset pagination utilities and cursor parsingDataClassTest— Lombok-generated data class coverage (ArticleData, CommentData, ProfileData, etc.)Core domain layer:
CoreDomainTest— Article, User, Comment, Tag, FollowRelation, ArticleFavorite, AuthorizationServiceGenerated DGS types:
GraphQLTypesTest— builder/setter/equals/hashCode coverage for all generated GraphQL typesTesting patterns followed
All tests follow existing conventions:
SecurityContextHolderwithTestingAuthenticationToken/AnonymousAuthenticationTokenfor auth testingDgsDataFetchingEnvironmentmocks for datafetcher argument resolutionLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/c8713192767f4ce5a1c15fa6cc5ac5df
Requested by: @bsmitches