Skip to content

Commit

Permalink
test: 삭제된 동영상 복구 메서드
Browse files Browse the repository at this point in the history
  • Loading branch information
SJ70 committed Jul 18, 2024
1 parent 2a92f0c commit 7a2b793
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/java/com/j9/bestmoments/service/VideoServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,15 @@ void softDelete() {
Assertions.assertDoesNotThrow(() -> videoService.findDeletedByIdAndUploaderId(id, uploaderId));
}

@Test
@Transactional
void restore() {
videoService.softDelete(publicVideo);
videoService.restore(publicVideo);
UUID id = publicVideo.getId();
UUID uploaderId = publicVideo.getUploader().getId();
Assertions.assertDoesNotThrow(() -> videoService.findPublicById(id));
Assertions.assertThrows(EntityNotFoundException.class, () -> videoService.findDeletedByIdAndUploaderId(id, uploaderId));
}

}

0 comments on commit 7a2b793

Please sign in to comment.