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 {