Skip to content

Commit

Permalink
fix : 테스트 검증 부분 수정
Browse files Browse the repository at this point in the history
- 테스트의 목적을 더 명확하게 하기위해 레포지토리가 삭제를 수행하는지 검증하도록 변
  • Loading branch information
seokho-1116 committed May 11, 2024
1 parent b751681 commit 360f3fc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -166,10 +169,6 @@ private List<MemberGroup> ownerGroupMember() {
);
}

private Optional<Long> notZeroGroupCapsuleCount() {
return Optional.of(999L);
}

@Test
void 그룹을_삭제할_조건을_만족한_그룹_아이디로_삭제를_시도하면_그룹이_삭제된다() {
//given
Expand All @@ -184,5 +183,6 @@ private Optional<Long> notZeroGroupCapsuleCount() {
//when
//then
assertThatCode(() -> groupService.deleteGroup(groupOwnerId, groupId)).doesNotThrowAnyException();
verify(groupRepository, times(1)).delete(any(Group.class));
}
}

0 comments on commit 360f3fc

Please sign in to comment.