From 360f3fcb9ccc1476ab0ab9c44270e60812f893be Mon Sep 17 00:00:00 2001 From: hong seokho Date: Sat, 11 May 2024 21:56:03 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 테스트의 목적을 더 명확하게 하기위해 레포지토리가 삭제를 수행하는지 검증하도록 변 --- .../core/domain/group/service/GroupServiceTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupServiceTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupServiceTest.java index 82214b29b..c4d39296f 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupServiceTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupServiceTest.java @@ -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; @@ -166,10 +169,6 @@ private List ownerGroupMember() { ); } - private Optional notZeroGroupCapsuleCount() { - return Optional.of(999L); - } - @Test void 그룹을_삭제할_조건을_만족한_그룹_아이디로_삭제를_시도하면_그룹이_삭제된다() { //given @@ -184,5 +183,6 @@ private Optional notZeroGroupCapsuleCount() { //when //then assertThatCode(() -> groupService.deleteGroup(groupOwnerId, groupId)).doesNotThrowAnyException(); + verify(groupRepository, times(1)).delete(any(Group.class)); } } \ No newline at end of file