Skip to content

Commit 37c2256

Browse files
committed
skip
1 parent 5141677 commit 37c2256

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class SingleRxJavaToCoroutineDeferredUnitTest {
3232

3333
private suspend fun Deferred<*>.assertOver500AndSorted() {
3434
assertThat(this.await() as List<*>).containsExactly(
35-
Product(4, "Lenovo", 550.0),
36-
Product(2, "Oppo", 800.0),
37-
Product(1, "Samsung", 1200.0)
35+
Product(4, "Lenovo", 550.0), Product(2, "Oppo", 800.0), Product(1, "Samsung", 1200.0)
3836
)
3937
}
4038

@@ -46,13 +44,20 @@ class SingleRxJavaToCoroutineDeferredUnitTest {
4644
}
4745

4846
@Test
49-
fun `using subscribe and CompletableDeferred`() = runBlocking {
47+
fun `using subscribe and CompletableDeferred`(): Unit = runBlocking {
48+
// val deferred = CompletableDeferred<List<Product>>()
49+
// getFilteredProducts().subscribe({ products ->
50+
// deferred.complete(products)
51+
// }, { error ->
52+
// deferred.completeExceptionally(error)
53+
// })
54+
// deferred.assertOver500AndSorted()
5055
val deferred = CompletableDeferred<List<Product>>()
51-
getFilteredProducts().subscribe({ products ->
52-
deferred.complete(products)
53-
}, { error ->
54-
deferred.completeExceptionally(error)
55-
})
56+
// async {
57+
getFilteredProducts().subscribeOn(Schedulers.io()).observeOn(Schedulers.io()).subscribe { products ->
58+
deferred.complete(products)
59+
}
60+
// }
5661
deferred.assertOver500AndSorted()
5762
}
5863

0 commit comments

Comments
 (0)