Skip to content

Commit

Permalink
M3-347 Refactor : 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
qjvk2880 committed Sep 10, 2024
1 parent 0a1bc8d commit fa91398
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ void findCommunityById_shouldReturnCommunityInfoResponse() {
Long communityId = 1L;
when(communityRepository.findById(communityId)).thenReturn(Optional.of(community));
when(userCommunityRepository.countByCommunityId(communityId)).thenReturn(3L);
when(communityRankingService.getCommunityCurrentPixelRankFromCache(communityId)).thenReturn(0L);
when(communityRankingService.getCurrentPixelCountFromCache(communityId)).thenReturn(0L);
when(communityRankingService.getAccumulatePixelCount(communityId)).thenReturn(0L);

// When
CommunityInfoResponse result = communityService.findCommunityById(communityId);

System.out.println("result.getCurrentPixelCount() = " + result.getCurrentPixelCount());
System.out.println("result.getAccumulatePixelCount() = " + result.getAccumulatePixelCount());
System.out.println("result.getCommunityRanking() = " + result.getCommunityRanking());
// Then
assertNotNull(result);
assertEquals("Test Community", result.getName());
Expand Down

0 comments on commit fa91398

Please sign in to comment.