aaverin
12/04/2018, 10:59 AMasSingle(CommonPool)
In a unit-test class, I have 2 different tests. Each one of them uses test()
method from RxJava2 to assert the value
Problem is, every time I run my tests, on of them fails, but only one of them. If I comment away one of the tests – the other one always passes.
It feels like some threading issue, anybody had similar problems?aaverin
12/04/2018, 11:02 AMaaverin
12/04/2018, 11:16 AMCommonPool
that was hardcoded inside the class and not replaced with Unconfined
in the unit testgildor
12/04/2018, 11:20 AMaaverin
12/04/2018, 11:22 AMclass ApiCall() {
fun execute(): Single<Data> {
async { ... }.asSingle(CommonPool)
}
}
class ApiCallTest {
val classToTest = ApiCall()
@Test
fun test1() {
classToTest.execute().test().assertValue(testValue)
}
@Test
fun test2() {
classToTest.execute().test().assertValue(testValue)
}
}
aaverin
12/04/2018, 11:23 AMaaverin
12/04/2018, 11:23 AM