-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat : 그룹 삭제 기능 추가 #405 #436
feat : 그룹 삭제 기능 추가 #405 #436
Conversation
private void checkGroupOwnership(Long memberId, List<MemberGroup> groupMembers) { | ||
final boolean isGroupOwner = groupMembers.stream() | ||
.anyMatch(mg -> mg.getMember().getId().equals(memberId) && mg.getIsOwner()); |
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.
93번째 줄부터 매개변수에 final 붙여야겠당
...archive/core/domain/group_member/repository/groupInviteRepository/GroupInviteRepository.java
Show resolved
Hide resolved
class GroupCommandServiceTest { | ||
|
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.
여기서 notOwnerGroupMember() 메서드들 같은걸 Fixture에 안넣고 여기에 넣은 이유가 있어? 이건 걍 궁금
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.
이거 옮길께 나도 모르게 그냥 테스트에 작성해버림
public static Member memberWithMemberId(long memberId) { | ||
try { | ||
Member member = member((int) memberId); | ||
setFieldValue(member, "id", memberId); | ||
return member; | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
private static void setFieldValue(Object instance, String fieldName, Object value) | ||
throws NoSuchFieldException, IllegalAccessException { | ||
Field field = instance.getClass().getDeclaredField(fieldName); | ||
field.setAccessible(true); | ||
field.set(instance, value); | ||
} |
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.
기존의 Fixture에서 Member를 만드는 방법을 사용안하고 이렇게 했을 때의 장점이 뭐야?
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.
이거 memberId 넣을 수 있는 생성자가 없어서 이렇게 한거 기존 Member를 테스트위해서 수정할 수 없어성
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.
아 좋다! 굿굿
public static Member memberWithMemberId(long memberId) { | ||
try { | ||
Member member = member((int) memberId); | ||
setFieldValue(member, "id", memberId); | ||
return member; | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
private static void setFieldValue(Object instance, String fieldName, Object value) | ||
throws NoSuchFieldException, IllegalAccessException { | ||
Field field = instance.getClass().getDeclaredField(fieldName); | ||
field.setAccessible(true); | ||
field.set(instance, value); | ||
} |
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.
아 좋다! 굿굿
작업 내용 (Content)
링크 (Links)
기타 사항 (Etc)
1. 그룹이 존재해야 함.
2. 그룹 삭제를 요청한 사용자가 그룹장이여야 함.
3. 그룹에 그룹원이 존재하지 않아야 함.
4. 그룹에 그룹 캡슐이 존재하지 않아야 함.
5. 위의 4가지 조건을 만족하면 그룹 삭제
Merge 전 필요 작업 (Checklist before merge)
희망 리뷰 완료 일 (Expected due date)