Skip to content

Commit 135b111

Browse files
committed
test(community): CommunityBoard id로 조회 테스트 수정 및 예외 추가
1 parent 6c410fa commit 135b111

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/java/com/somemore/community/service/query/CommunityBoardQueryServiceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ void getAllCommunityBoards() {
8585
List<CommunityBoardGetResponseDto> dtos = communityBoardQueryService.getCommunityBoards();
8686

8787
// then
88-
Optional<CommunityBoard> communityBoard1 = communityBoardRepository.findById(communityId1);
89-
Optional<CommunityBoard> communityBoard2 = communityBoardRepository.findById(communityId2);
88+
Optional<CommunityBoard> communityBoard1 = communityBoardRepository.getCommunityBoardWithId(communityId1);
89+
Optional<CommunityBoard> communityBoard2 = communityBoardRepository.getCommunityBoardWithId(communityId2);
9090

9191

9292
assertThat(dtos)
@@ -135,8 +135,8 @@ void getCommunityBoardsByWriter() {
135135
List<CommunityBoardGetResponseDto> dtos = communityBoardQueryService.getCommunityBoardsByWriterId(volunteer.getId());
136136

137137
//then
138-
Optional<CommunityBoard> communityBoard1 = communityBoardRepository.findById(communityId1);
139-
Optional<CommunityBoard> communityBoard2 = communityBoardRepository.findById(communityId2);
138+
Optional<CommunityBoard> communityBoard1 = communityBoardRepository.getCommunityBoardWithId(communityId1);
139+
Optional<CommunityBoard> communityBoard2 = communityBoardRepository.getCommunityBoardWithId(communityId2);
140140

141141
assertThat(dtos)
142142
.isNotNull()

0 commit comments

Comments
 (0)