Axel
05/05/2023, 1:56 PM@ExperimentalCoroutinesApi
internal class PartnerApiClientTest {
private lateinit var partnerApiClient: PartnerApiClient
@BeforeEach
fun setup() {
partnerApiClient = PartnerApiClient()
}
@Test
fun `When foo is bar then baz`() = runBlockingTest {
val partner = partnerApiClient.getPartner(Brand.SomeBrand, "1234")
expectThat(partner).isRight()
}
}
getPartner()
returns Either<PartnerClientError, Option<Partner>>
This throws exception
java.lang.IllegalStateException: This job has not completed yet
at kotlinx.coroutines.JobSupport.getCompletionExceptionOrNull(JobSupport.kt:1190)
What should I do?Axel
05/05/2023, 1:57 PMgetPartners()
function is using kotlinx.coroutines.future.await()