Skip to content

Commit

Permalink
test: id로 공개 동영상 조회 메서드
Browse files Browse the repository at this point in the history
  • Loading branch information
SJ70 committed Jul 18, 2024
1 parent 9f724cc commit 311bc75
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/j9/bestmoments/service/VideoServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,19 @@ void findDeletedByIdAndUploaderId_Fail() {
Assertions.assertThrows(EntityNotFoundException.class, () -> videoService.findDeletedByIdAndUploaderId(videoId, memberId));
}

@Test
@Transactional
void findPublicById_Success() {
UUID videoId = publicVideo.getId();
Video foundVideo = videoService.findPublicById(videoId);
Assertions.assertEquals(publicVideo, foundVideo);
}

@Test
@Transactional
void findPublicById_Fail() {
Assertions.assertThrows(EntityNotFoundException.class, () -> videoService.findPublicById(privateVideo.getId()));
Assertions.assertThrows(EntityNotFoundException.class, () -> videoService.findPublicById(urlPublicVideo.getId()));
}

}

0 comments on commit 311bc75

Please sign in to comment.