Conversation
기존에 운동 생성 및 운동 멤버 수정은 이미 부모임장도 사용 가능
- Classist 방식으로 ExerciseValidator, ExerciseConverter는 실제 인스턴스 사용 - 인프라 의존성(MemberPartyRepository, ExerciseRepository, ImageService)는 Mock 처리 - 성공: 모임장/부모임장의 운동 생성 케이스 - 실패: 비활성 파티, 권한 없음, 시간 역전, 과거 시간
- Party, Member 조회 후 ExerciseLifecycleService 위임 검증 - 존재하지 않는 파티 → PARTY_NOT_FOUND 예외 검증 - 존재하지 않는 멤버 → MEMBER_NOT_FOUND 예외 검증
- IntegrationTestBase 상속, MockMvc로 HTTP 레이어 전체 검증 - 성공: 모임장/부모임장 운동 생성 (201) - 실패: 존재하지 않는 파티(404), 존재하지 않는 멤버(404), 비활성 파티(400), 권한 없는 멤버(403), 시간 역전(400), 과거 시간(400)
- 성공: 모임장/부모임장 삭제 케이스 (exerciseRepository.delete, partyRepository.save 호출 검증) - 실패: 권한 없는 일반 멤버 → INSUFFICIENT_PERMISSION 예외 검증
- Exercise, Member 조회 후 ExerciseLifecycleService 위임 검증 - 존재하지 않는 운동 → EXERCISE_NOT_FOUND 예외 검증 - 존재하지 않는 멤버 → MEMBER_NOT_FOUND 예외 검증
- 모임장/부모임장 삭제 성공 (200, deletedExerciseId 반환) - 존재하지 않는 운동 404 (EXERCISE_NOT_FOUND) - SecurityContext 멤버 DB 미존재 404 (MEMBER_NOT_FOUND) - 일반 멤버 삭제 시 403 (INSUFFICIENT_PERMISSION)
- 모임장/부모임장 수정 성공 - 일반 멤버 수정 시 INSUFFICIENT_PERMISSION - 이미 시작된 운동 수정 시 EXERCISE_ALREADY_STARTED_UPDATE - 시간 역전 시 INVALID_EXERCISE_TIME - 과거 날짜 수정 시 PAST_TIME_NOT_ALLOWED
- 성공: Exercise, Member 조회 후 ExerciseLifecycleService에 위임 - 실패: EXERCISE_NOT_FOUND, MEMBER_NOT_FOUND
- 성공: 모임장 200, 부모임장 200 - 실패: EXERCISE_NOT_FOUND 404, MEMBER_NOT_FOUND 404, 일반 멤버 403, 이미 시작된 운동 400, 시간 역전 400, 과거 날짜 400
- ExerciseParticipationService: cancelParticipationByManager - 모임장/부모임장 멤버 취소 성공 - 모임장 게스트 취소 성공 - 일반 멤버 취소 시 INSUFFICIENT_PERMISSION - 이미 시작된 운동 취소 시 EXERCISE_ALREADY_STARTED_CANCEL - 존재하지 않는 멤버 참여자 MEMBER_NOT_FOUND - 존재하지 않는 게스트 GUEST_NOT_FOUND - GuestFixture 추가
- ExerciseParticipationService 위임 성공
- EXERCISE_NOT_FOUND, MEMBER_NOT_FOUND
- 모임장/부모임장 멤버 취소 성공 (200) - 모임장 게스트 취소 성공 (200) - 존재하지 않는 운동 404 (EXERCISE_NOT_FOUND) - SecurityContext 멤버 DB 미존재 404 (MEMBER_NOT_FOUND) - 일반 멤버 취소 시 403 (INSUFFICIENT_PERMISSION) - 이미 시작된 운동 취소 시 400 (EXERCISE_ALREADY_STARTED_CANCEL)
kanghana1
approved these changes
Mar 3, 2026
| } | ||
|
|
||
| public static <T> ResponseEntity<BaseResponse<T>> of(BaseCode code) { | ||
| return of(code, null); |
| private List<MemberAddr> addresses = new ArrayList<>(); | ||
|
|
||
| @OneToMany(mappedBy = "member", cascade = CascadeType.ALL) | ||
| @Builder.Default |
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.
❤️ 기능 설명
[핵심 변경] 운동 삭제/수정 권한 확장
ExerciseValidator의validateDeleteExercise,validateUpdateExercise에서validateManagerPermission→validateSubManagerPermission으로 변경validateManagerPermission메서드 제거[부가 변경] 테스트 추가
BaseResponse.of()추가: ResponseEntity 래핑으로 HTTP status 정상 반환Member컬렉션 필드@Builder.Default추가: 빌더 사용 시 NPE 방지연결된 issue
연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #505
🩷 Approve 하기 전 확인해주세요!
✅ 체크리스트