Skip to content

Commit 76d2b0c

Browse files
hanggatheangrydev
andauthored
Update core-kotlin-modules/core-kotlin-concurrency-3/src/test/java/com/baeldung/singlerxjavatocoroutinedeferred/SingleRxJavaToCoroutineDeferredUnitTest.kt
Co-authored-by: Liam Williams <[email protected]>
1 parent 4744bc3 commit 76d2b0c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core-kotlin-modules/core-kotlin-concurrency-3/src/test/java/com/baeldung/singlerxjavatocoroutinedeferred/SingleRxJavaToCoroutineDeferredUnitTest.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ class SingleRxJavaToCoroutineDeferredUnitTest {
4848
@Test
4949
fun `using subscribe and CompletableDeferred`() = runBlocking {
5050
val deferred = CompletableDeferred<List<Product>>()
51-
getFilteredProducts().subscribe({ products ->
52-
deferred.complete(products)
53-
}, { error ->
54-
deferred.completeExceptionally(error)
55-
})
51+
getFilteredProducts().subscribe(deferred::complete, deferred::completeExceptionally)
5652
deferred.assertOver500AndSorted()
5753
}
5854

0 commit comments

Comments
 (0)