Skip to content

Commit cb6e0f0

Browse files
committed
feat: 임원진 멤버 삭제 테스트 추가
1 parent 6c7113f commit cb6e0f0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/test/java/dmu/dasom/api/domain/executive/service/ExecutiveServiceTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,30 @@ void createExecutive_success() {
8181
assertThat(responseDto.getId()).isEqualTo(id);
8282
}
8383

84+
@Test
85+
@DisplayName("임원진 멤버 삭제 - 성공")
86+
void deleteExecutive_success() {
87+
// given
88+
Long id = 1L;
89+
90+
ExecutiveEntity entity = ExecutiveEntity.builder()
91+
.id(1L)
92+
.name("김다솜")
93+
.position("회장")
94+
.githubUrl("https://github.com/dasom")
95+
.build();
96+
97+
when(executiveRepository.findById(id)).thenReturn(Optional.of(entity));
98+
doNothing().when(executiveRepository).delete(entity);
99+
100+
// when
101+
executiveService.deleteExective(id);
102+
103+
// then
104+
verify(executiveRepository, times(1)).findById(id);
105+
verify(executiveRepository, times(1)).delete(entity);
106+
}
107+
84108
@Test
85109
@DisplayName("임원진 멤버 수정 - 성공")
86110
void updateExecutive_success() {

0 commit comments

Comments
 (0)