-
Notifications
You must be signed in to change notification settings - Fork 1
[BE-Feat] 논의 기본정보 수정 기능 구현 #364
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
# Conflicts: # backend/src/main/java/endolphin/backend/domain/discussion/DiscussionService.java
WalkthroughThis pull request introduces an update discussion endpoint in the discussion domain. A new DTO ( Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller
participant Service
participant Entity
participant BitmapSvc
Client->>Controller: PUT /{discussionId} with UpdateDiscussionRequest
Controller->>Service: updateDiscussion(discussionId, request)
Service->>Entity: discussion.update(request)
alt Time fields changed
Service->>BitmapSvc: deleteDiscussionBitmapsAsync(discussionId)
BitmapSvc-->>Service: Async deletion result
end
Service->>Controller: Return updated DiscussionResponse
Controller->>Client: 200 OK, DiscussionResponse
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 3
🧹 Nitpick comments (6)
backend/src/main/java/endolphin/backend/domain/discussion/entity/Discussion.java (1)
97-107: Update method properly implements all fields from request.The update method provides a clean way to modify all necessary discussion fields from the request object. This follows good design practices by centralizing the update logic in the entity.
Consider adding validation to ensure dateRangeStart is before or equal to dateRangeEnd, and timeRangeStart is before timeRangeEnd within this method for additional data integrity.
public void update(UpdateDiscussionRequest request) { this.title = request.title(); this.dateRangeStart = request.dateRangeStart(); this.dateRangeEnd = request.dateRangeEnd(); this.timeRangeStart = request.timeRangeStart(); this.timeRangeEnd = request.timeRangeEnd(); this.duration = request.duration(); this.meetingMethod = request.meetingMethod(); this.location = request.location(); this.deadline = request.deadline(); + + // Optional: Add additional validation + if (this.dateRangeStart.isAfter(this.dateRangeEnd)) { + throw new IllegalArgumentException("Start date cannot be after end date"); + } + if (this.timeRangeStart.isAfter(this.timeRangeEnd)) { + throw new IllegalArgumentException("Start time cannot be after end time"); + } }backend/src/main/java/endolphin/backend/domain/discussion/dto/UpdateDiscussionRequest.java (1)
1-26: Well-structured DTO with appropriate validations.The record class is well designed with comprehensive validation annotations for most fields. This ensures data integrity when updating discussion information.
There are a few validations that might enhance the robustness of this DTO:
- No cross-field validations to ensure dateRangeStart is before or equal to dateRangeEnd
- No validation to ensure timeRangeStart is before timeRangeEnd
- No validation to ensure the duration makes sense with the time range
Consider adding custom validation annotations or implementing a validator class to handle these cross-field validations.
You could add a validator class like this:
@Component public class UpdateDiscussionRequestValidator implements Validator { @Override public boolean supports(Class<?> clazz) { return UpdateDiscussionRequest.class.isAssignableFrom(clazz); } @Override public void validate(Object target, Errors errors) { UpdateDiscussionRequest request = (UpdateDiscussionRequest) target; // Validate date range if (request.dateRangeStart() != null && request.dateRangeEnd() != null && request.dateRangeStart().isAfter(request.dateRangeEnd())) { errors.rejectValue("dateRangeStart", "date.invalid", "Start date cannot be after end date"); } // Validate time range if (request.timeRangeStart() != null && request.timeRangeEnd() != null && request.timeRangeStart().isAfter(request.timeRangeEnd())) { errors.rejectValue("timeRangeStart", "time.invalid", "Start time cannot be after end time"); } // Validate duration with time range if (request.timeRangeStart() != null && request.timeRangeEnd() != null && request.duration() != null) { int minutesBetween = (int) ChronoUnit.MINUTES.between( request.timeRangeStart(), request.timeRangeEnd()); if (request.duration() > minutesBetween) { errors.rejectValue("duration", "duration.invalid", "Duration cannot exceed the time range"); } } } }backend/src/main/java/endolphin/backend/global/redis/DiscussionBitmapService.java (1)
125-140: Consider making deleteDiscussionBitmaps private if not intended for direct use.The extracted
deleteDiscussionBitmapsmethod contains the core logic for bitmap deletion, but it's currently public. If it's not intended to be called directly from outside this class, consider making it private to encapsulate the implementation details.-public void deleteDiscussionBitmaps(Long discussionId) { +private void deleteDiscussionBitmaps(Long discussionId) {backend/src/test/java/endolphin/backend/domain/discussion/DiscussionServiceTest.java (3)
824-868: Good negative test case with proper verification.This test properly verifies that bitmap deletion and personal event restoration are not called when time-related fields don't change.
For consistency in naming between test cases:
// then -verify(discussionBitmapService, never()).deleteDiscussionBitmaps(anyLong()); +verify(discussionBitmapService, never()).deleteDiscussionBitmapsAsync(anyLong()); verify(personalEventService, never()).restorePersonalEvents(any(Discussion.class));
870-904: Well-structured authorization test.This test properly verifies that non-host users cannot update discussions. The exception validation and verification that no methods are called are done correctly.
For consistency with other tests:
verify(discussionRepository, never()).save(any(Discussion.class)); -verify(discussionBitmapService, never()).deleteDiscussionBitmaps(anyLong()); +verify(discussionBitmapService, never()).deleteDiscussionBitmapsAsync(anyLong()); verify(personalEventService, never()).restorePersonalEvents(any());
777-904: Consider reducing test duplication.The three new test methods contain similar setup code for creating discussions and update requests.
Consider extracting common setup code to helper methods or using JUnit's
@BeforeEachto reduce duplication. For example:private Discussion createTestDiscussion(Long id) { Discussion discussion = Discussion.builder() .title("Test Discussion") .dateStart(LocalDate.of(2025, 3, 1)) .dateEnd(LocalDate.of(2025, 3, 1)) .timeStart(LocalTime.of(10, 0)) .timeEnd(LocalTime.of(12, 0)) .duration(120) .deadline(LocalDate.of(2025, 3, 15)) .meetingMethod(MeetingMethod.ONLINE) .location("Test Location") .build(); discussion.setDiscussionStatus(DiscussionStatus.ONGOING); ReflectionTestUtils.setField(discussion, "id", id); return discussion; } private UpdateDiscussionRequest createUpdateRequest(LocalDate endDate) { return new UpdateDiscussionRequest( "팀 회의", LocalDate.of(2025, 3, 1), endDate, LocalTime.of(10, 0), LocalTime.of(12, 0), 120, MeetingMethod.ONLINE, "회의실 1", LocalDate.of(2025, 3, 15) ); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
backend/src/main/java/endolphin/backend/domain/discussion/DiscussionController.java(2 hunks)backend/src/main/java/endolphin/backend/domain/discussion/DiscussionService.java(3 hunks)backend/src/main/java/endolphin/backend/domain/discussion/dto/UpdateDiscussionRequest.java(1 hunks)backend/src/main/java/endolphin/backend/domain/discussion/entity/Discussion.java(2 hunks)backend/src/main/java/endolphin/backend/global/redis/DiscussionBitmapService.java(2 hunks)backend/src/main/java/endolphin/backend/global/scheduler/DiscussionStatusScheduler.java(1 hunks)backend/src/test/java/endolphin/backend/domain/discussion/DiscussionServiceTest.java(6 hunks)backend/src/test/java/endolphin/backend/global/redis/DiscussionBitmapServiceTest.java(2 hunks)backend/src/test/java/endolphin/backend/global/scheduler/DiscussionStatusSchedulerTest.java(2 hunks)
🔇 Additional comments (15)
backend/src/main/java/endolphin/backend/domain/discussion/entity/Discussion.java (1)
3-3: Appropriate import addition.The import for
UpdateDiscussionRequestis correctly added to support the new update functionality.backend/src/test/java/endolphin/backend/global/scheduler/DiscussionStatusSchedulerTest.java (2)
62-63: Method call correctly updated to use async version.The test has been properly updated to use the new asynchronous method
deleteDiscussionBitmapsAsyncinstead of the previous synchronous method. This ensures the test aligns with the implementation changes.
154-155: Method call correctly updated to use async version.The test has been properly updated to use the new asynchronous method
deleteDiscussionBitmapsAsyncinstead of the previous synchronous method. This ensures the test aligns with the implementation changes.backend/src/main/java/endolphin/backend/global/scheduler/DiscussionStatusScheduler.java (1)
62-70:Details
❓ Verification inconclusive
Successfully migrated to asynchronous bitmap deletion.
The implementation has been correctly updated to use the asynchronous method
deleteDiscussionBitmapsAsyncinstead of the synchronous version. The callbacks for success and error handling are well-implemented.However, since this is happening within a transactional method, be aware that the asynchronous operation will execute outside the transaction boundary. Ensure that failure in the async operation won't leave the system in an inconsistent state.
Consider verifying the transaction behavior with the following test:
🏁 Script executed:
#!/bin/bash # Check if there's any transaction management in the DiscussionBitmapService implementation rg -A 5 -B 5 "deleteDiscussionBitmapsAsync" backend/src/main/java/endolphin/backend/global/redis/DiscussionBitmapService.java rg "@Transactional" backend/src/main/java/endolphin/backend/global/redis/DiscussionBitmapService.javaLength of output: 533
Attention: Verify Asynchronous Transaction Context
The migration to asynchronous bitmap deletion is correctly implemented using
deleteDiscussionBitmapsAsync(). The asynchronous callbacks for logging success and handling errors are well set up.
- It appears that the
deleteDiscussionBitmapsAsync()method is annotated with@Asyncbut does not have any transaction management (no@Transactionalfound). This means that the deletion runs outside the transaction boundary.- Please verify that executing this asynchronous call outside an active transaction is intentional and that any failure in this operation won’t compromise system consistency.
backend/src/main/java/endolphin/backend/domain/discussion/DiscussionController.java (2)
17-17: Good addition of the necessary import.The import for
UpdateDiscussionRequestis properly added to support the new update discussion functionality.
290-311: Well-implemented discussion update endpoint.The new endpoint follows RESTful practices with appropriate:
- HTTP method (PUT) for updates
- Path variable validation
- Request body validation
- Comprehensive API documentation
- Clear error response definitions
The implementation correctly delegates to the service layer while maintaining the controller's responsibility of handling HTTP concerns.
backend/src/test/java/endolphin/backend/global/redis/DiscussionBitmapServiceTest.java (3)
53-53: Method name updated to match implementation.Test method name has been appropriately updated to reflect the renamed service method.
66-67: Service method call updated to match implementation.The test now correctly calls the renamed async method.
73-74: Assertion message properly updated.The assertion message has been updated to reflect the new method name, maintaining test clarity.
backend/src/main/java/endolphin/backend/global/redis/DiscussionBitmapService.java (1)
99-123: Well-implemented asynchronous deletion with retry mechanism.The new
deleteDiscussionBitmapsAsyncmethod:
- Maintains asynchronous behavior with CompletableFuture
- Implements a robust retry mechanism (3 attempts)
- Properly handles interruptions and failures
- Returns appropriate responses for success and failure cases
This is a good improvement that enhances reliability for bitmap deletion operations.
backend/src/main/java/endolphin/backend/domain/discussion/DiscussionService.java (2)
118-124: Asynchronous bitmap deletion with proper error handling.The updated method call to
deleteDiscussionBitmapsAsyncmaintains the asynchronous operation pattern and includes proper logging for both success and failure cases.
398-403: Good helper method for time change detection.The
isTimeChangedmethod clearly expresses the logic for determining if any time-related fields have changed. This improves readability and encapsulates the condition in a well-named method.backend/src/test/java/endolphin/backend/domain/discussion/DiscussionServiceTest.java (3)
8-8: Imports added correctly for the new functionality.The imports for
anyLongandUpdateDiscussionRequestare appropriately added to support the new updateDiscussion functionality and its test cases.Also applies to: 26-26
239-240: Good use of CompletableFuture for failure testing.This test correctly mocks a failed future for testing async failure handling.
258-258: Method name update to match implementation.The verification correctly uses
deleteDiscussionBitmapsAsynchere.
| public DiscussionResponse updateDiscussion(Long discussionId, UpdateDiscussionRequest request) { | ||
| Discussion discussion = getDiscussionById(discussionId); | ||
|
|
||
| if (!discussionParticipantService.amIHost(discussionId)) { | ||
| throw new ApiException(ErrorCode.NOT_ALLOWED_USER); | ||
| } | ||
|
|
||
| if (isTimeChanged(discussion, request)) { | ||
| discussionBitmapService.deleteDiscussionBitmaps(discussionId); | ||
| personalEventService.restorePersonalEvents(discussion); | ||
| } | ||
|
|
||
| discussion.update(request); | ||
| discussion = discussionRepository.save(discussion); | ||
|
|
||
| return new DiscussionResponse( | ||
| discussion.getId(), | ||
| discussion.getTitle(), | ||
| discussion.getDateRangeStart(), | ||
| discussion.getDateRangeEnd(), | ||
| discussion.getMeetingMethod(), | ||
| discussion.getLocation(), | ||
| discussion.getDuration(), | ||
| TimeUtil.calculateTimeLeft(discussion.getDeadline()) | ||
| ); | ||
| } |
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.
New update functionality handles permission validation and time-change detection.
The implementation:
- Validates the user is the host
- Handles special case when time-related fields change
- Updates the discussion entity
- Returns a consistent response structure
However, there's an inconsistency in how bitmap deletion is handled.
In this method, deleteDiscussionBitmaps is called directly, which executes synchronously without the retry mechanism. In contrast, confirmSchedule uses the asynchronous version with retries. For consistency and resilience, consider using the async version here as well:
-discussionBitmapService.deleteDiscussionBitmaps(discussionId);
+discussionBitmapService.deleteDiscussionBitmapsAsync(discussionId)
+ .thenRun(() -> log.info("Redis keys deleted successfully for discussionId : {}", discussionId))
+ .exceptionally(ex -> {
+ log.error("Failed to delete Redis keys for update operation", ex);
+ return null;
+ });📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| public DiscussionResponse updateDiscussion(Long discussionId, UpdateDiscussionRequest request) { | |
| Discussion discussion = getDiscussionById(discussionId); | |
| if (!discussionParticipantService.amIHost(discussionId)) { | |
| throw new ApiException(ErrorCode.NOT_ALLOWED_USER); | |
| } | |
| if (isTimeChanged(discussion, request)) { | |
| discussionBitmapService.deleteDiscussionBitmaps(discussionId); | |
| personalEventService.restorePersonalEvents(discussion); | |
| } | |
| discussion.update(request); | |
| discussion = discussionRepository.save(discussion); | |
| return new DiscussionResponse( | |
| discussion.getId(), | |
| discussion.getTitle(), | |
| discussion.getDateRangeStart(), | |
| discussion.getDateRangeEnd(), | |
| discussion.getMeetingMethod(), | |
| discussion.getLocation(), | |
| discussion.getDuration(), | |
| TimeUtil.calculateTimeLeft(discussion.getDeadline()) | |
| ); | |
| } | |
| public DiscussionResponse updateDiscussion(Long discussionId, UpdateDiscussionRequest request) { | |
| Discussion discussion = getDiscussionById(discussionId); | |
| if (!discussionParticipantService.amIHost(discussionId)) { | |
| throw new ApiException(ErrorCode.NOT_ALLOWED_USER); | |
| } | |
| if (isTimeChanged(discussion, request)) { | |
| - discussionBitmapService.deleteDiscussionBitmaps(discussionId); | |
| + discussionBitmapService.deleteDiscussionBitmapsAsync(discussionId) | |
| + .thenRun(() -> log.info("Redis keys deleted successfully for discussionId : {}", discussionId)) | |
| + .exceptionally(ex -> { | |
| + log.error("Failed to delete Redis keys for update operation", ex); | |
| + return null; | |
| + }); | |
| personalEventService.restorePersonalEvents(discussion); | |
| } | |
| discussion.update(request); | |
| discussion = discussionRepository.save(discussion); | |
| return new DiscussionResponse( | |
| discussion.getId(), | |
| discussion.getTitle(), | |
| discussion.getDateRangeStart(), | |
| discussion.getDateRangeEnd(), | |
| discussion.getMeetingMethod(), | |
| discussion.getLocation(), | |
| discussion.getDuration(), | |
| TimeUtil.calculateTimeLeft(discussion.getDeadline()) | |
| ); | |
| } |
| when(discussionBitmapService.deleteDiscussionBitmapsAsync( | ||
| any(Long.class) | ||
| )).thenReturn(CompletableFuture.completedFuture(null)); |
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.
🛠️ Refactor suggestion
Method name inconsistency between tests.
The method name has been changed from deleteDiscussionBitmapsUsingScan to deleteDiscussionBitmapsAsync here, which indicates a change to asynchronous processing. However, this test uses deleteDiscussionBitmapsAsync while the new tests below use deleteDiscussionBitmaps (non-async version).
Make sure to consistently use the same method name throughout all tests:
when(discussionBitmapService.deleteDiscussionBitmapsAsync(
any(Long.class)
)).thenReturn(CompletableFuture.completedFuture(null));Committable suggestion skipped: line range outside the PR's diff.
| @DisplayName("updateDiscussion: 시간이 변경된 경우 (host) - bitmap 삭제 및 개인 일정 복원 호출") | ||
| @Test | ||
| public void updateDiscussion_whenTimeChanged_callsBitmapDeletionAndRestore() { | ||
| // Given | ||
| Long discussionId = 1L; | ||
| Discussion discussion = Discussion.builder() | ||
| .title("Test Discussion") | ||
| .dateStart(LocalDate.of(2025, 3, 1)) | ||
| .dateEnd(LocalDate.of(2025, 3, 1)) | ||
| .timeStart(LocalTime.of(10, 0)) | ||
| .timeEnd(LocalTime.of(12, 0)) | ||
| .duration(120) | ||
| .deadline(LocalDate.now().plusDays(10)) | ||
| .meetingMethod(MeetingMethod.ONLINE) | ||
| .location("Test Location") | ||
| .build(); | ||
| discussion.setDiscussionStatus(DiscussionStatus.ONGOING); | ||
| ReflectionTestUtils.setField(discussion, "id", discussionId); | ||
|
|
||
| UpdateDiscussionRequest request = new UpdateDiscussionRequest( | ||
| "team meeting", | ||
| LocalDate.of(2025, 3, 1), | ||
| LocalDate.of(2025, 3, 2), | ||
| LocalTime.of(10, 0), | ||
| LocalTime.of(12, 0), | ||
| 120, | ||
| MeetingMethod.ONLINE, | ||
| "회의실 1", | ||
| LocalDate.now().plusDays(10) | ||
| ); | ||
|
|
||
| when(discussionRepository.findById(discussionId)).thenReturn(Optional.of(discussion)); | ||
| when(discussionParticipantService.amIHost(discussionId)).thenReturn(true); | ||
| when(discussionRepository.save(discussion)).thenReturn(discussion); | ||
|
|
||
| // when | ||
| DiscussionResponse response = discussionService.updateDiscussion(discussionId, request); | ||
|
|
||
| // then | ||
| verify(discussionBitmapService).deleteDiscussionBitmaps(discussionId); | ||
| verify(personalEventService).restorePersonalEvents(discussion); | ||
|
|
||
| assertThat(response).isNotNull(); | ||
| assertThat(response.id()).isEqualTo(discussionId); | ||
| assertThat(response.title()).isEqualTo("team meeting"); | ||
| } |
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.
🛠️ Refactor suggestion
Thorough test for time change scenario, but method name inconsistency.
This test comprehensively checks the behavior when discussion time changes. It verifies that bitmap deletion and personal event restoration are triggered. However, there's an inconsistency in the method name used for verification.
Update the verification to use the async method name for consistency:
// then
-verify(discussionBitmapService).deleteDiscussionBitmaps(discussionId);
+verify(discussionBitmapService).deleteDiscussionBitmapsAsync(discussionId);
verify(personalEventService).restorePersonalEvents(discussion);Additionally, consider using fixed dates for deadline rather than relative dates like LocalDate.now().plusDays(10) to make tests more deterministic and less time-sensitive.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @DisplayName("updateDiscussion: 시간이 변경된 경우 (host) - bitmap 삭제 및 개인 일정 복원 호출") | |
| @Test | |
| public void updateDiscussion_whenTimeChanged_callsBitmapDeletionAndRestore() { | |
| // Given | |
| Long discussionId = 1L; | |
| Discussion discussion = Discussion.builder() | |
| .title("Test Discussion") | |
| .dateStart(LocalDate.of(2025, 3, 1)) | |
| .dateEnd(LocalDate.of(2025, 3, 1)) | |
| .timeStart(LocalTime.of(10, 0)) | |
| .timeEnd(LocalTime.of(12, 0)) | |
| .duration(120) | |
| .deadline(LocalDate.now().plusDays(10)) | |
| .meetingMethod(MeetingMethod.ONLINE) | |
| .location("Test Location") | |
| .build(); | |
| discussion.setDiscussionStatus(DiscussionStatus.ONGOING); | |
| ReflectionTestUtils.setField(discussion, "id", discussionId); | |
| UpdateDiscussionRequest request = new UpdateDiscussionRequest( | |
| "team meeting", | |
| LocalDate.of(2025, 3, 1), | |
| LocalDate.of(2025, 3, 2), | |
| LocalTime.of(10, 0), | |
| LocalTime.of(12, 0), | |
| 120, | |
| MeetingMethod.ONLINE, | |
| "회의실 1", | |
| LocalDate.now().plusDays(10) | |
| ); | |
| when(discussionRepository.findById(discussionId)).thenReturn(Optional.of(discussion)); | |
| when(discussionParticipantService.amIHost(discussionId)).thenReturn(true); | |
| when(discussionRepository.save(discussion)).thenReturn(discussion); | |
| // when | |
| DiscussionResponse response = discussionService.updateDiscussion(discussionId, request); | |
| // then | |
| verify(discussionBitmapService).deleteDiscussionBitmaps(discussionId); | |
| verify(personalEventService).restorePersonalEvents(discussion); | |
| assertThat(response).isNotNull(); | |
| assertThat(response.id()).isEqualTo(discussionId); | |
| assertThat(response.title()).isEqualTo("team meeting"); | |
| } | |
| @DisplayName("updateDiscussion: 시간이 변경된 경우 (host) - bitmap 삭제 및 개인 일정 복원 호출") | |
| @Test | |
| public void updateDiscussion_whenTimeChanged_callsBitmapDeletionAndRestore() { | |
| // Given | |
| Long discussionId = 1L; | |
| Discussion discussion = Discussion.builder() | |
| .title("Test Discussion") | |
| .dateStart(LocalDate.of(2025, 3, 1)) | |
| .dateEnd(LocalDate.of(2025, 3, 1)) | |
| .timeStart(LocalTime.of(10, 0)) | |
| .timeEnd(LocalTime.of(12, 0)) | |
| .duration(120) | |
| .deadline(LocalDate.now().plusDays(10)) | |
| .meetingMethod(MeetingMethod.ONLINE) | |
| .location("Test Location") | |
| .build(); | |
| discussion.setDiscussionStatus(DiscussionStatus.ONGOING); | |
| ReflectionTestUtils.setField(discussion, "id", discussionId); | |
| UpdateDiscussionRequest request = new UpdateDiscussionRequest( | |
| "team meeting", | |
| LocalDate.of(2025, 3, 1), | |
| LocalDate.of(2025, 3, 2), | |
| LocalTime.of(10, 0), | |
| LocalTime.of(12, 0), | |
| 120, | |
| MeetingMethod.ONLINE, | |
| "회의실 1", | |
| LocalDate.now().plusDays(10) | |
| ); | |
| when(discussionRepository.findById(discussionId)).thenReturn(Optional.of(discussion)); | |
| when(discussionParticipantService.amIHost(discussionId)).thenReturn(true); | |
| when(discussionRepository.save(discussion)).thenReturn(discussion); | |
| // when | |
| DiscussionResponse response = discussionService.updateDiscussion(discussionId, request); | |
| // then | |
| - verify(discussionBitmapService).deleteDiscussionBitmaps(discussionId); | |
| + verify(discussionBitmapService).deleteDiscussionBitmapsAsync(discussionId); | |
| verify(personalEventService).restorePersonalEvents(discussion); | |
| assertThat(response).isNotNull(); | |
| assertThat(response.id()).isEqualTo(discussionId); | |
| assertThat(response.title()).isEqualTo("team meeting"); | |
| } |
kwon204
left a 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.
고생하셨습니다
#️⃣ 연관된 이슈>
📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
Summary by CodeRabbit
New Features
Enhancements