poohbar
06/26/2020, 3:48 PMoleksiyp
06/26/2020, 4:16 PMpoohbar
06/26/2020, 5:16 PMmockkStatic
is not thread safe? I run my tests in parallel and use mockkStatic
of the same class in multiple different classes.poohbar
06/26/2020, 5:17 PMmockkStatic
always unmocks the class first, if the other test is currently running it will briefly be able to access the unmocked class.oleksiyp
06/26/2020, 5:26 PMpoohbar
06/26/2020, 5:27 PMsynchronized(UtilClass::class) {
mockkStatic(UtilClass::class)
every { UtilClass.staticMethod(any()) } returns 42
}
oleksiyp
06/26/2020, 5:31 PMoleksiyp
06/26/2020, 5:32 PMpoohbar
06/26/2020, 5:32 PMpoohbar
06/26/2020, 5:32 PMoleksiyp
06/26/2020, 5:36 PMoleksiyp
06/26/2020, 5:36 PMoleksiyp
06/26/2020, 5:36 PMoleksiyp
06/26/2020, 5:36 PMpoohbar
06/26/2020, 5:37 PMoleksiyp
06/26/2020, 5:37 PMoleksiyp
06/26/2020, 5:38 PM