We use mockito as mocking library for our unit tests. As it turns out mockito mocks cannot be accessed concurrently.
According to their docs:
However Mockito is only thread-safe in healthy tests, that is tests without multiple threads stubbing/verifying a shared mock. Stubbing or verification of a shared mock from different threads is NOT the proper way of testing because it will always lead to intermittent behavior.
So, now I'm looking for some thread-safe mockito alternative to unit test concurrent code. Couldn't google anything relevant.
Any suggestions are welcome
Thank you
Aucun commentaire:
Enregistrer un commentaire