Skip to content

Add comprehensive new test cases across all layers#573

Open
devin-ai-integration[bot] wants to merge 3 commits intodevin/1776604281-java17-springboot3-upgradefrom
devin/1777377429-new-test-cases
Open

Add comprehensive new test cases across all layers#573
devin-ai-integration[bot] wants to merge 3 commits intodevin/1776604281-java17-springboot3-upgradefrom
devin/1777377429-new-test-cases

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 28, 2026

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 generation
  • ArticleUpdateTest — Article update logic, slug regeneration, tag deduplication, timestamp behavior
  • AuthorizationServiceTest — Article/comment write authorization for authors, comment owners, and unauthorized users
  • UtilTestisEmpty() 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 fields
  • ProfileApiEdgeCaseTest — 404 for non-existent profiles, follow/unfollow non-existent users, 401 without auth
  • ArticleApiEdgeCaseTest — Read as authenticated user, 404 on update/delete non-existent articles, 401 without auth, partial update
  • CommentsApiEdgeCaseTest — 404 on non-existent article/comment, 401 without auth, article author deleting another user's comment
  • ArticleFavoriteApiEdgeCaseTest — 401 without auth, 404 on non-existent articles
  • ListArticleApiFilterTest — Filtering by tag/author/favorited, pagination params, combined filters, feed pagination

Review & Testing Checklist for Human

  • Verify all 11 new test files compile and pass (./gradlew test)
  • Spot-check that test assertions match expected API behavior (especially authorization and 404 edge cases)
  • Confirm no existing tests were modified — all changes are purely additive

Notes

  • All tests follow the existing patterns (RestAssured + MockMvc for API tests, plain JUnit for unit tests)
  • Tests pass locally alongside all existing tests with ./gradlew test

Link to Devin session: https://app.devin.ai/sessions/0f1e4b42fdb74defa8b6b2bb3393595a
Requested by: @scottyandrade99


Open in Devin Review

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>
@staging-devin-ai-integration
Copy link
Copy Markdown

Devin Review

Status Commit
⚪ Not started

Open in Devin Review (Staging)

💡 Connect your GitHub account to enable automatic code reviews.

@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits April 28, 2026 12:08
Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…econd race

Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant