[FEAT] 로그인 응답에 온보딩 완료 여부 추가#269
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Walkthrough로그인 응답 DTO에 사용자의 온보딩 완료 여부를 나타내는 Changes온보딩 상태 로그인 응답
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/test/java/app/nook/controller/user/AuthControllerTest.java (1)
60-105: ⚡ Quick win
onboardingCompleted = true케이스에 대한 테스트가 없습니다현재 모든 성공 케이스 테스트는
onboardingCompleted(false)만 검증합니다. 온보딩을 완료한 사용자(onboardingCompleted = true)에 대한 테스트 케이스를 최소 하나 추가하면, 필드 직렬화의 정확성을 더 완전하게 검증할 수 있습니다.예:
소셜로그인_성공또는내정보_조회_성공테스트에서onboardingCompleted(true)mock 응답을 사용하는 별도 테스트 케이스를 추가하거나,$.result.onboardingCompleted가true인 시나리오를 커버하는 테스트를 추가하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/app/nook/controller/user/AuthControllerTest.java` around lines 60 - 105, Add a parallel test that asserts onboardingCompleted=true: in AuthControllerTest create a new test (e.g., 소셜로그인_성공_온보딩완료) that builds an OAuthDTO.OAuthLoginRequest, stubs oAuthService.login(...) to return a UserDTO.LoginResponse with onboardingCompleted(true) (similar to the existing 소셜로그인_성공), then call mockMvc.perform(post("/api/v1/auth/oauth")...) and assert jsonPath("$.result.onboardingCompleted").value(true) and include the same requestFields/responseFields snippet in restDocs to ensure serialization is validated for the true case.src/main/java/app/nook/user/dto/UserDTO.java (1)
17-25: 💤 Low value
Boolean래퍼 타입으로 인해 필드가 조용히 누락될 수 있습니다클래스 레벨의
@JsonInclude(JsonInclude.Include.NON_NULL)과Boolean래퍼 타입의 조합은, 빌더에서onboardingCompleted를 설정하지 않은 경우 JSON 응답에서 해당 필드가 아무런 오류 없이 누락됩니다. 현재 모든 코드 경로에서 이 필드를 설정하고 있지만, 향후 새로운 로그인 흐름이 추가될 때 설정을 누락하면 프론트엔드가 예측 불가능한 동작을 할 수 있습니다.
Boolean대신boolean원시 타입을 사용하면, 필드가 항상 직렬화되므로 누락 위험이 없습니다 (단,@JsonInclude(NON_NULL)는 원시 타입에는 영향을 주지 않습니다).🛡️ 원시 타입 사용 제안
- private Boolean onboardingCompleted; + private boolean onboardingCompleted;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/app/nook/user/dto/UserDTO.java` around lines 17 - 25, Change the nullable wrapper type for onboardingCompleted in the LoginResponse inner class to the primitive boolean so the field is always present in serialized JSON even when not explicitly set by builders; update the field declaration for onboardingCompleted in the LoginResponse class (and any related getters/setters or builder code) to use boolean (default false) while leaving the class-level `@JsonInclude`(JsonInclude.Include.NON_NULL) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/main/java/app/nook/user/dto/UserDTO.java`:
- Around line 17-25: Change the nullable wrapper type for onboardingCompleted in
the LoginResponse inner class to the primitive boolean so the field is always
present in serialized JSON even when not explicitly set by builders; update the
field declaration for onboardingCompleted in the LoginResponse class (and any
related getters/setters or builder code) to use boolean (default false) while
leaving the class-level `@JsonInclude`(JsonInclude.Include.NON_NULL) unchanged.
In `@src/test/java/app/nook/controller/user/AuthControllerTest.java`:
- Around line 60-105: Add a parallel test that asserts onboardingCompleted=true:
in AuthControllerTest create a new test (e.g., 소셜로그인_성공_온보딩완료) that builds an
OAuthDTO.OAuthLoginRequest, stubs oAuthService.login(...) to return a
UserDTO.LoginResponse with onboardingCompleted(true) (similar to the existing
소셜로그인_성공), then call mockMvc.perform(post("/api/v1/auth/oauth")...) and assert
jsonPath("$.result.onboardingCompleted").value(true) and include the same
requestFields/responseFields snippet in restDocs to ensure serialization is
validated for the true case.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9b492998-1fab-480e-9a3d-c9287315408b
📒 Files selected for processing (6)
src/main/java/app/nook/user/domain/User.javasrc/main/java/app/nook/user/dto/UserDTO.javasrc/main/java/app/nook/user/oauth/OAuthService.javasrc/main/java/app/nook/user/service/OnboardingService.javasrc/main/java/app/nook/user/service/UserService.javasrc/test/java/app/nook/controller/user/AuthControllerTest.java
|
📄 작업 내용 요약
onboardingCompleted필드 추가isOnboardingCompleted()로 정리📎 Issue 번호
✅ 작업 목록
📝 기타 참고사항
Summary by CodeRabbit
릴리스 노트
New Features
Bug Fixes