-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: 주석처리 및 시간 변경 #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @chominju02, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 풀 리퀘스트는 주로 사소한 리팩토링과 스케줄링된 작업의 시간 조정을 다룹니다. 애플리케이션 서비스에서 임포트 문을 재정렬하고 시험 날짜 유효성 검사를 일시적으로 주석 처리하는 변경 사항이 포함됩니다. 또한, 시험 번호 생성 크론 잡의 실행 시간이 한 시간 늦춰졌습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughCommented out an exam-date validator call in ApplicationService.handleApplication; adjusted imports in that file. Disabled ApplicationService tests by commenting them out. Updated ExamNumberGenerationJobRound1 cron expression to run at 10:00 (Oct 13) instead of 09:00. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant AppSvc as ApplicationService
participant Repo as Repository
participant Validator
Client->>AppSvc: handleApplication(request)
AppSvc->>Repo: loadExams()
Note over AppSvc,Validator: Validator check for exam dates was removed
AppSvc->>Repo: persist application
AppSvc-->>Client: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이 PR은 원서 접수 로직의 일부를 주석 처리하고, 크론잡 실행 시간을 변경하는 내용을 담고 있습니다.
ApplicationService.java에서 시험 마감 기한을 확인하는 중요한 검증 로직이 주석 처리되었습니다. 이로 인해 마감된 시험에 대해서도 원서 접수가 가능해질 수 있어 보입니다. 또한, 여러 개의 명시적 import 구문이 와일드카드(*) import로 변경되었는데, 이는 코드 가독성과 유지보수성을 저해할 수 있습니다.
ExamNumberGenerationJobRound1.java의 크론잡 실행 시간 변경은 의도된 것으로 보입니다.
리뷰에서는 주석 처리된 검증 로직과 와일드카드 import 사용에 대한 의견을 제시했습니다.
| ) { | ||
| List<ExamJpaEntity> exams = examJpaRepository.findAllById(examIds); | ||
| validator.examDateNotPassed(exams); | ||
| // validator.examDateNotPassed(exams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시험 마감 기한을 검증하는 validator.examDateNotPassed(exams) 호출이 주석 처리되었습니다. 이 검증 로직은 마감 기한이 지난 시험에 대한 원서 접수를 막는 중요한 역할을 하는 것으로 보입니다.
이 변경으로 인해 이미 마감된 시험에 원서가 접수될 수 있는 잠재적인 위험이 있습니다. PR 설명에 이 변경에 대한 이유가 없어 의도를 파악하기 어렵습니다. 만약 의도된 변경이 아니라면, 해당 라인의 주석을 해제하는 것이 좋겠습니다. 의도된 변경이라면, 그 이유를 코드 주석이나 PR 설명에 추가해주시면 좋겠습니다.
| // validator.examDateNotPassed(exams); | |
| validator.examDateNotPassed(exams); |
| import life.mosu.mosuserver.presentation.application.dto.CreateApplicationResponse; | ||
| import life.mosu.mosuserver.presentation.application.dto.ExamApplicationRequest; | ||
| import life.mosu.mosuserver.presentation.application.dto.SchoolApplicationCountResponse; | ||
| import life.mosu.mosuserver.presentation.application.dto.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와일드카드(*) import를 사용하여 여러 클래스를 한 번에 가져오도록 변경하셨네요. 하지만 명시적으로 개별 클래스를 import하는 것이 코드의 가독성을 높이고, 어떤 클래스가 사용되는지 명확하게 파악하는 데 도움이 됩니다. 또한, 잠재적인 이름 충돌을 방지할 수 있습니다.
다른 파일들과의 일관성을 위해, 그리고 더 나은 유지보수성을 위해 이전처럼 명시적 import를 사용하는 것을 권장합니다.
| import life.mosu.mosuserver.presentation.application.dto.*; | |
| import life.mosu.mosuserver.presentation.application.dto.ApplicationGuestRequest; | |
| import life.mosu.mosuserver.presentation.application.dto.ApplicationRequest; | |
| import life.mosu.mosuserver.presentation.application.dto.ApplicationResponse; | |
| import life.mosu.mosuserver.presentation.application.dto.CreateApplicationResponse; | |
| import life.mosu.mosuserver.presentation.application.dto.ExamApplicationRequest; | |
| import life.mosu.mosuserver.presentation.application.dto.SchoolApplicationCountResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/life/mosu/mosuserver/application/application/ApplicationService.java (1)
15-15: Minor: Explicit imports preferred over wildcard for clarity.Explicitly importing
ListandSetimproves clarity, though the DTO wildcard import (line 15) remains. Consider applying the same pattern to DTOs if only a few are used.Also applies to: 23-24
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/life/mosu/mosuserver/application/application/ApplicationService.java(2 hunks)src/main/java/life/mosu/mosuserver/infra/cron/job/ExamNumberGenerationJobRound1.java(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/life/mosu/mosuserver/application/application/ApplicationService.java (1)
src/main/java/life/mosu/mosuserver/application/application/validator/ApplicationValidator.java (1)
Slf4j(21-124)
🔇 Additional comments (1)
src/main/java/life/mosu/mosuserver/infra/cron/job/ExamNumberGenerationJobRound1.java (1)
14-14: Verify the scheduled date is still valid.The cron job is scheduled to run at 10:00 AM on October 13, 2025. Since we are currently in October 2025, this date may have already passed. If October 13 has passed, this one-time job will never execute, and exam numbers for the October 19 exam will not be generated.
Please confirm:
- Whether October 13, 2025 has passed
- If so, whether the date needs to be updated or if the job has already run
- Whether the time change from 9:00 to 10:00 was intentional and documented
| ) { | ||
| List<ExamJpaEntity> exams = examJpaRepository.findAllById(examIds); | ||
| validator.examDateNotPassed(exams); | ||
| // validator.examDateNotPassed(exams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Validation bypass allows applications to expired exams.
Commenting out validator.examDateNotPassed(exams) removes two essential safeguards:
- Automatic closure: Exams are no longer auto-closed when their deadline passes
- Runtime enforcement: Users can now submit applications to exams past their deadline
While examNotFull (line 83) checks for CLOSED status, it relies on exams being closed through other means. Without the deadline check, expired exams remain open and accept invalid applications.
Verify the following before merging:
Please clarify:
- Why was this validation disabled? (Testing? Business requirement change?)
- Is there an alternative mechanism to prevent applications to expired exams?
- How will exams be closed when their deadline passes?
🏁 Script executed:
#!/bin/bash
# Check if exam closure is handled elsewhere (e.g., scheduled jobs, other validators)
# Search for other invocations of examDateNotPassed
rg -nP '\bexamDateNotPassed\b' --type=java
# Search for other mechanisms that close exams or check deadlines
rg -nP '(exam\.(close|setExamStatus)|ExamStatus\.CLOSED|getDeadlineTime)' --type=java -C3
# Search for scheduled jobs or cron tasks related to exam lifecycle
rg -nP '(@Scheduled|@CronJob|deadline|close.*exam)' --type=java -C3Length of output: 22895
Critical: restore exam expiration enforcement
Commenting out validator.examDateNotPassed(exams) bypasses auto-closing of expired exams and their rejection, leaving deadlines unenforced. No other automated mechanism handles expiration. Restore this validation or implement an alternative expiration process before merging.
🤖 Prompt for AI Agents
In
src/main/java/life/mosu/mosuserver/application/application/ApplicationService.java
around line 82, the call to validator.examDateNotPassed(exams) was commented
out, which disables automatic closing/rejection of expired exams; restore the
expiration enforcement by re-enabling that validator call (or, if there was a
reason it was removed, implement an equivalent expiration sweep that runs before
this flow to close and reject exams past their deadlines), ensure the
validator/sweep runs synchronously before continuing processing here, and keep
any related error handling/logging so expired exams are properly
closed/rejected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/test/java/life/mosu/mosuserver/application/application/ApplicationServiceTest.java(1 hunks)
| //package life.mosu.mosuserver.application.application; | ||
| // | ||
| //import static org.assertj.core.api.Assertions.assertThat; | ||
| //import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
| //import static org.mockito.ArgumentMatchers.any; | ||
| //import static org.mockito.ArgumentMatchers.anyList; | ||
| //import static org.mockito.ArgumentMatchers.eq; | ||
| //import static org.mockito.BDDMockito.given; | ||
| //import static org.mockito.BDDMockito.then; | ||
| //import static org.mockito.Mockito.doThrow; | ||
| //import static org.mockito.Mockito.never; | ||
| // | ||
| //import java.time.LocalDate; | ||
| //import java.util.List; | ||
| //import java.util.Set; | ||
| //import life.mosu.mosuserver.application.application.dto.RegisterApplicationCommand; | ||
| //import life.mosu.mosuserver.application.application.processor.GetApplicationsStepProcessor; | ||
| //import life.mosu.mosuserver.application.application.processor.RegisterApplicationStepProcessor; | ||
| //import life.mosu.mosuserver.application.application.processor.SaveExamTicketStepProcessor; | ||
| //import life.mosu.mosuserver.application.application.validator.ApplicationValidator; | ||
| //import life.mosu.mosuserver.application.exam.cache.ExamQuotaCacheManager; | ||
| //import life.mosu.mosuserver.application.user.UserService; | ||
| //import life.mosu.mosuserver.domain.application.entity.ApplicationJpaEntity; | ||
| //import life.mosu.mosuserver.domain.application.repository.ApplicationJpaRepository; | ||
| //import life.mosu.mosuserver.domain.exam.entity.ExamJpaEntity; | ||
| //import life.mosu.mosuserver.domain.exam.entity.ExamJpaRepository; | ||
| //import life.mosu.mosuserver.global.exception.CustomRuntimeException; | ||
| //import life.mosu.mosuserver.global.exception.ErrorCode; | ||
| //import life.mosu.mosuserver.presentation.application.dto.AgreementRequest; | ||
| //import life.mosu.mosuserver.presentation.application.dto.ApplicationGuestRequest; | ||
| //import life.mosu.mosuserver.presentation.application.dto.ApplicationRequest; | ||
| //import life.mosu.mosuserver.presentation.application.dto.ApplicationResponse; | ||
| //import life.mosu.mosuserver.presentation.application.dto.CreateApplicationResponse; | ||
| //import life.mosu.mosuserver.presentation.application.dto.ExamApplicationRequest; | ||
| //import life.mosu.mosuserver.presentation.common.FileRequest; | ||
| //import org.junit.jupiter.api.BeforeEach; | ||
| //import org.junit.jupiter.api.DisplayName; | ||
| //import org.junit.jupiter.api.Nested; | ||
| //import org.junit.jupiter.api.Test; | ||
| //import org.junit.jupiter.api.extension.ExtendWith; | ||
| //import org.mockito.Mock; | ||
| //import org.mockito.junit.jupiter.MockitoExtension; | ||
| // | ||
| //@ExtendWith(MockitoExtension.class) | ||
| //@DisplayName("ApplicationService 단위 테스트") | ||
| //class ApplicationServiceTest { | ||
| // | ||
| // private ApplicationService applicationService; | ||
| // | ||
| // @Mock | ||
| // private UserService userService; | ||
| // | ||
| // @Mock | ||
| // private ApplicationJpaRepository applicationJpaRepository; | ||
| // | ||
| // @Mock | ||
| // private ExamJpaRepository examJpaRepository; | ||
| // | ||
| // @Mock | ||
| // private ExamQuotaCacheManager cacheManager; | ||
| // | ||
| // @Mock | ||
| // private RegisterApplicationStepProcessor registerApplicationStepProcessor; | ||
| // | ||
| // @Mock | ||
| // private SaveExamTicketStepProcessor saveExamTicketStepProcessor; | ||
| // | ||
| // @Mock | ||
| // private GetApplicationsStepProcessor getApplicationsStepProcessor; | ||
| // | ||
| // @Mock | ||
| // private ApplicationValidator validator; | ||
| // | ||
| // @BeforeEach | ||
| // void setUp() { | ||
| // applicationService = new ApplicationService( | ||
| // userService, | ||
| // applicationJpaRepository, | ||
| // examJpaRepository, | ||
| // cacheManager, | ||
| // registerApplicationStepProcessor, | ||
| // saveExamTicketStepProcessor, | ||
| // getApplicationsStepProcessor, | ||
| // validator | ||
| // ); | ||
| // } | ||
| // | ||
| // // 테스트 데이터 생성 메서드들 | ||
| // private ApplicationRequest createApplicationRequest() { | ||
| // return new ApplicationRequest( | ||
| // new FileRequest("test-file.pdf", "base64encodedcontent"), | ||
| // "010-1234-5678", | ||
| // List.of( | ||
| // new ExamApplicationRequest(1L, true), | ||
| // new ExamApplicationRequest(2L, false) | ||
| // ), | ||
| // new AgreementRequest(true, true), | ||
| // List.of("국어", "수학") | ||
| // ); | ||
| // } | ||
| // | ||
| // private ApplicationRequest createApplicationRequestWithDuplicateExams() { | ||
| // return new ApplicationRequest( | ||
| // new FileRequest("test-file.pdf", "base64encodedcontent"), | ||
| // "010-1234-5678", | ||
| // List.of( | ||
| // new ExamApplicationRequest(1L, true), | ||
| // new ExamApplicationRequest(1L, false) // 중복된 시험 ID | ||
| // ), | ||
| // new AgreementRequest(true, true), | ||
| // List.of("국어", "수학") | ||
| // ); | ||
| // } | ||
| // | ||
| // private ApplicationRequest createApplicationRequestWithWrongSubjects() { | ||
| // return new ApplicationRequest( | ||
| // new FileRequest("test-file.pdf", "base64encodedcontent"), | ||
| // "010-1234-5678", | ||
| // List.of( | ||
| // new ExamApplicationRequest(1L, true), | ||
| // new ExamApplicationRequest(2L, false) | ||
| // ), | ||
| // new AgreementRequest(true, true), | ||
| // List.of("국어") // 과목이 1개만 있음 (2개여야 함) | ||
| // ); | ||
| // } | ||
| // | ||
| // private ApplicationGuestRequest createApplicationGuestRequest() { | ||
| // return new ApplicationGuestRequest( | ||
| // "테스트 학교", | ||
| // "남자", | ||
| // "홍길동", | ||
| // LocalDate.of(2000, 1, 1), | ||
| // "010-1234-5678", | ||
| // new ExamApplicationRequest(1L, true), | ||
| // Set.of("국어", "수학"), | ||
| // new FileRequest("test-file.pdf", "base64encodedcontent") | ||
| // ); | ||
| // } | ||
| // | ||
| // private ApplicationGuestRequest createApplicationGuestRequestWithWrongSubjects() { | ||
| // return new ApplicationGuestRequest( | ||
| // "테스트 학교", | ||
| // "남자", | ||
| // "홍길동", | ||
| // LocalDate.of(2000, 1, 1), | ||
| // "010-1234-5678", | ||
| // new ExamApplicationRequest(1L, true), | ||
| // Set.of("국어"), // 과목이 1개만 있음 (2개여야 함) | ||
| // new FileRequest("test-file.pdf", "base64encodedcontent") | ||
| // ); | ||
| // } | ||
| // | ||
| // @Nested | ||
| // @DisplayName("apply 메서드 테스트") | ||
| // class ApplyTest { | ||
| // | ||
| // @Test | ||
| // @DisplayName("정상적인 시험 신청 - 성공") | ||
| // void apply_Success() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // ApplicationRequest request = createApplicationRequest(); | ||
| // ApplicationJpaEntity savedApplication = new ApplicationJpaEntity(userId, | ||
| // "010-1234-5678", true, true); | ||
| // // Reflection을 사용하여 ID 설정 | ||
| // try { | ||
| // var idField = ApplicationJpaEntity.class.getDeclaredField("id"); | ||
| // idField.setAccessible(true); | ||
| // idField.set(savedApplication, 1L); | ||
| // } catch (Exception e) { | ||
| // // 테스트용이므로 간단히 처리 | ||
| // } | ||
| // | ||
| // List<ExamJpaEntity> exams = List.of( | ||
| // ExamJpaEntity.builder().build(), | ||
| // ExamJpaEntity.builder().build() | ||
| // ); | ||
| // | ||
| // given(examJpaRepository.findAllById(anyList())).willReturn(exams); | ||
| // given(applicationJpaRepository.save(any(ApplicationJpaEntity.class))).willReturn( | ||
| // savedApplication); | ||
| // | ||
| // // when | ||
| // CreateApplicationResponse response = applicationService.apply(userId, request); | ||
| // | ||
| // // then | ||
| // assertThat(response).isNotNull(); | ||
| // assertThat(response.applicationId()).isEqualTo(1L); | ||
| // | ||
| // then(validator).should().agreedToTerms(request); | ||
| // then(validator).should().requestNoDuplicateExams(anyList()); | ||
| // then(validator).should().examDateNotPassed(exams); | ||
| // then(validator).should().examNotFull(exams); | ||
| // then(validator).should().examIdsAndLunchSelection(anyList()); | ||
| // then(validator).should().noDuplicateApplication(eq(userId), anyList()); | ||
| // then(applicationJpaRepository).should().save(any(ApplicationJpaEntity.class)); | ||
| // then(registerApplicationStepProcessor).should() | ||
| // .process(any(RegisterApplicationCommand.class)); | ||
| // then(saveExamTicketStepProcessor).should().process(any()); | ||
| // | ||
| // } | ||
| // | ||
| // @Test | ||
| // @DisplayName("약관 동의하지 않은 경우 - 실패") | ||
| // void apply_WhenNotAgreedToTerms_ThrowsException() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // ApplicationRequest request = createApplicationRequest(); | ||
| // | ||
| // doThrow(new CustomRuntimeException(ErrorCode.NOT_AGREED_TO_TERMS)) | ||
| // .when(validator).agreedToTerms(request); | ||
| // | ||
| // // when & then | ||
| // assertThatThrownBy(() -> applicationService.apply(userId, request)) | ||
| // .isInstanceOf(CustomRuntimeException.class) | ||
| // .hasMessage(ErrorCode.NOT_AGREED_TO_TERMS.getMessage()); | ||
| // | ||
| // then(validator).should().agreedToTerms(request); | ||
| // then(examJpaRepository).should(never()).findAllById(anyList()); | ||
| // } | ||
| // | ||
| // @Test | ||
| // @DisplayName("중복된 시험 ID가 있는 경우 - 실패") | ||
| // void apply_WhenDuplicateExamIds_ThrowsException() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // ApplicationRequest request = createApplicationRequestWithDuplicateExams(); | ||
| // | ||
| // doThrow(new CustomRuntimeException(ErrorCode.EXAM_DUPLICATED)) | ||
| // .when(validator).requestNoDuplicateExams(anyList()); | ||
| // | ||
| // // when & then | ||
| // assertThatThrownBy(() -> applicationService.apply(userId, request)) | ||
| // .isInstanceOf(CustomRuntimeException.class) | ||
| // .hasMessage(ErrorCode.EXAM_DUPLICATED.getMessage()); | ||
| // | ||
| // then(validator).should().agreedToTerms(request); | ||
| // then(validator).should().requestNoDuplicateExams(anyList()); | ||
| // then(examJpaRepository).should(never()).findAllById(anyList()); | ||
| // } | ||
| // | ||
| // @Test | ||
| // @DisplayName("잘못된 과목 개수 - 실패") | ||
| // void apply_WhenWrongSubjectCount_ThrowsException() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // ApplicationRequest request = createApplicationRequestWithWrongSubjects(); | ||
| // | ||
| // // when & then | ||
| // assertThatThrownBy(() -> applicationService.apply(userId, request)) | ||
| // .isInstanceOf(CustomRuntimeException.class) | ||
| // .hasMessage(ErrorCode.WRONG_SUBJECT_COUNT.getMessage()); | ||
| // } | ||
| // } | ||
| // | ||
| // @Nested | ||
| // @DisplayName("applyByGuest 메서드 테스트") | ||
| // class ApplyByGuestTest { | ||
| // | ||
| // @Test | ||
| // @DisplayName("게스트 신청 - 성공") | ||
| // void applyByGuest_Success() { | ||
| // // given | ||
| // ApplicationGuestRequest request = createApplicationGuestRequest(); | ||
| // Long userId = 1L; | ||
| // ApplicationJpaEntity savedApplication = ApplicationJpaEntity.builder() | ||
| // .userId(userId) | ||
| // .agreedToNotices(true) | ||
| // .agreedToRefundPolicy(true) | ||
| // .build(); | ||
| // List<ExamJpaEntity> exams = List.of(ExamJpaEntity.builder().build()); | ||
| // | ||
| // given(userService.saveOrGetUser(any())).willReturn(userId); | ||
| // given(examJpaRepository.findAllById(anyList())).willReturn(exams); | ||
| // given(applicationJpaRepository.save(any(ApplicationJpaEntity.class))).willReturn( | ||
| // savedApplication); | ||
| // | ||
| // // when | ||
| // CreateApplicationResponse response = applicationService.applyByGuest(request); | ||
| // | ||
| // // then | ||
| // assertThat(response).isNotNull(); | ||
| // assertThat(response.applicationId()).isNull(); // ID는 builder에서 설정하지 않으므로 null | ||
| // | ||
| // then(userService).should().saveOrGetUser(any()); | ||
| // then(examJpaRepository).should().findAllById(anyList()); | ||
| // then(cacheManager).should() | ||
| // .increaseCurrentApplications(request.examApplication().examId()); | ||
| // } | ||
| // | ||
| // @Test | ||
| // @DisplayName("게스트 신청 시 잘못된 과목 개수 - 실패") | ||
| // void applyByGuest_WhenWrongSubjectCount_ThrowsException() { | ||
| // // given | ||
| // ApplicationGuestRequest request = createApplicationGuestRequestWithWrongSubjects(); | ||
| // | ||
| // // when & then | ||
| // assertThatThrownBy(() -> applicationService.applyByGuest(request)) | ||
| // .isInstanceOf(CustomRuntimeException.class) | ||
| // .hasMessage(ErrorCode.WRONG_SUBJECT_COUNT.getMessage()); | ||
| // } | ||
| // } | ||
| // | ||
| // @Nested | ||
| // @DisplayName("getApplications 메서드 테스트") | ||
| // class GetApplicationsTest { | ||
| // | ||
| // @Test | ||
| // @DisplayName("사용자의 신청 목록 조회 - 성공") | ||
| // void getApplications_Success() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // List<ApplicationResponse> expectedApplications = List.of( | ||
| // new ApplicationResponse(1L, List.of()), | ||
| // new ApplicationResponse(2L, List.of()) | ||
| // ); | ||
| // | ||
| // given(getApplicationsStepProcessor.process(userId)) | ||
| // .willReturn(expectedApplications); | ||
| // | ||
| // // when | ||
| // List<ApplicationResponse> applications = applicationService.getApplications(userId); | ||
| // | ||
| // // then | ||
| // assertThat(applications).hasSize(2); | ||
| // assertThat(applications.get(0).applicationId()).isEqualTo(1L); | ||
| // assertThat(applications.get(1).applicationId()).isEqualTo(2L); | ||
| // | ||
| // then(getApplicationsStepProcessor).should().process(userId); | ||
| // } | ||
| // | ||
| // @Test | ||
| // @DisplayName("신청 목록이 없는 경우 - 빈 목록 반환") | ||
| // void getApplications_WhenNoApplications_ReturnsEmptyList() { | ||
| // // given | ||
| // Long userId = 1L; | ||
| // List<ApplicationResponse> expectedApplications = List.of(); | ||
| // | ||
| // given(getApplicationsStepProcessor.process(userId)) | ||
| // .willReturn(expectedApplications); | ||
| // | ||
| // // when | ||
| // List<ApplicationResponse> applications = applicationService.getApplications(userId); | ||
| // | ||
| // // then | ||
| // assertThat(applications).isEmpty(); | ||
| // | ||
| // then(getApplicationsStepProcessor).should().process(userId); | ||
| // } | ||
| // } | ||
| //} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Entire test suite disabled—restore test coverage.
Commenting out the entire ApplicationService test suite removes all test coverage for critical application logic, including validation, duplicate prevention, and business rules. This significantly degrades code quality and allows bugs to slip through undetected.
Based on the AI summary, this change appears related to commenting out validator.examDateNotPassed(exams) in production code. Rather than disabling tests, update them to reflect the intended behavior.
Run the following script to check for alternative test coverage:
Would you like me to help update these tests to align with the current production code behavior, or open an issue to track re-enabling this test suite?
🏁 Script executed:
#!/bin/bash
# Check if ApplicationService has test coverage elsewhere
rg -n --type=java -C3 'class.*Test.*extends\|@Test.*' | rg -A3 -B3 'ApplicationService'
# Look for the commented validator call in production code
rg -n --type=java -C5 'examDateNotPassed'Length of output: 9842
Restore and update ApplicationServiceTest
Un-comment src/test/java/life/mosu/mosuserver/application/application/ApplicationServiceTest.java, remove or adjust the verification of validator.examDateNotPassed(exams) (no longer called in ApplicationService), and re-enable all other validation and processing assertions to maintain full coverage of apply(), applyByGuest(), and getApplications() flows.
✨ 구현한 기능
📢 논의하고 싶은 내용
🎸 기타
Summary by CodeRabbit
Bug Fixes
Chores
Tests