diff --git a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/integration/BidiStreamingTests.kt b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/integration/BidiStreamingTests.kt index 289665f..01f127e 100644 --- a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/integration/BidiStreamingTests.kt +++ b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/integration/BidiStreamingTests.kt @@ -119,7 +119,7 @@ class BidiStreamingTests { val reqChanSpy = spyk(requestChannel) launch(Dispatchers.Default, start = CoroutineStart.UNDISPATCHED) { - assertFailsWithStatus(Status.CANCELLED, "CANCELLED: Call has been cancelled") { + assertFailsWithStatus(Status.CANCELLED) { repeat(6) { reqChanSpy.send { name = "name $it" } } diff --git a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallBidiStreamingTests.kt b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallBidiStreamingTests.kt index b557a02..cf9666b 100644 --- a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallBidiStreamingTests.kt +++ b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallBidiStreamingTests.kt @@ -452,7 +452,7 @@ class ServerCallBidiStreamingTests { val respChannel = deferredRespChannel.await() assert(respChannel.isClosedForSend){ "Abandoned response channel should be closed" } - verify(exactly = 1) { responseObserver.onError(matchStatus(Status.CANCELLED, "CANCELLED: test")) } + verify(exactly = 1) { responseObserver.onError(matchStatus(Status.CANCELLED)) } coVerify(exactly = 0) { respChannel.send(any()) } assert(serverCtx[Job]!!.isCompleted){ "Server job should be completed" } assert(serverCtx[Job]!!.isCancelled){ "Server job should be cancelled" } diff --git a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallUnaryTests.kt b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallUnaryTests.kt index 2b3c9ff..fa08f69 100644 --- a/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallUnaryTests.kt +++ b/kroto-plus-coroutines/src/test/kotlin/com/github/marcoferrer/krotoplus/coroutines/server/ServerCallUnaryTests.kt @@ -160,6 +160,7 @@ class ServerCallUnaryTests { verify(exactly = 1) { responseObserver.onError(matchStatus(Status.CANCELLED)) } + runBlocking { serverSpy.job?.join() } assertEquals("Job was cancelled",serverSpy.error?.message) }