Accept delete and private for up-to-date-test

This commit is contained in:
Gergely Hegedus 2025-11-02 22:44:12 +02:00
parent 9aa54ab28d
commit 9bf8c12899

View file

@ -69,12 +69,13 @@ class TikTokDownloadRemoteSourceUpToDateTest {
@Test
fun GIVEN_private_WHEN_downloading_THEN_proper_exception_is_thrown() {
val parameter = VideoInPending("123", PRIVATE_VIDEO_URL)
Assertions.assertThrows(VideoDeletedException::class.java) {
// DELETED response is also accepted: sometimes cant differentiate
Assertions.assertThrows(VideoPrivateException::class.java) {
val throwable = Assertions.assertThrows(Throwable::class.java) {
runBlocking { sut.getVideo(parameter) }
}
}
// DELETED response is also accepted: sometimes cant differentiate
assert(throwable is VideoDeletedException || throwable is VideoPrivateException, {
"Expected throwable to be DELETED or PRIVAte, but it was netiher: $throwable"
})
}
companion object {