Skip to content

Commit f57b577

Browse files
committed
fix: 기관 조회 테스트 코드 수정
- 중복 아이디 사용으로 인한 테스트 실패를 수정하기 위해 @beforeeach를 이용한 테스트 실행전 데이터 클렌징 작업 수행 추
1 parent ec93f29 commit f57b577

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/java/com/somemore/center/service/query/CenterSignServiceTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import com.somemore.IntegrationTestSupport;
44
import com.somemore.center.domain.Center;
5+
import com.somemore.center.repository.center.CenterJpaRepository;
56
import com.somemore.center.repository.center.CenterRepository;
67
import com.somemore.global.exception.BadRequestException;
8+
import org.junit.jupiter.api.BeforeEach;
79
import org.junit.jupiter.api.DisplayName;
810
import org.junit.jupiter.api.Test;
911
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +26,14 @@ class CenterSignServiceTest extends IntegrationTestSupport {
2426
@Autowired
2527
private CenterRepository centerRepository;
2628

29+
@Autowired
30+
private CenterJpaRepository centerJpaRepository;
31+
32+
@BeforeEach
33+
void cleanUp() {
34+
centerJpaRepository.deleteAll();
35+
}
36+
2737
@DisplayName("계정 ID로 센터 ID를 조회할 수 있다.")
2838
@Test
2939
void getIdByAccountId() {

0 commit comments

Comments
 (0)