From 9bf8c12899a4f49402018ec3169346f50768355b Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Sun, 2 Nov 2025 22:44:12 +0200 Subject: [PATCH] Accept delete and private for up-to-date-test --- .../uptodate/TikTokDownloadRemoteSourceUpToDateTest.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/test/java/org/fnives/uptodate/TikTokDownloadRemoteSourceUpToDateTest.kt b/app/src/test/java/org/fnives/uptodate/TikTokDownloadRemoteSourceUpToDateTest.kt index 0cbd6ad..c7c33ea 100644 --- a/app/src/test/java/org/fnives/uptodate/TikTokDownloadRemoteSourceUpToDateTest.kt +++ b/app/src/test/java/org/fnives/uptodate/TikTokDownloadRemoteSourceUpToDateTest.kt @@ -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 {