Closed marcela-cardona-s closed 1 year ago
Hi @marcela-cardona-s ,
It is unclear what behaviour you want to test and which contract should be ensured. Could you clarify, please?
I am trying to test the behavior of the launch
coroutine that guarantees that there are no concurrency problems when saving to any database (repository), the idea is to be able to mock this component and when executing this test the injection does not work of dependencies given by @Mockk. What I hope is to be able to verify that there will be no concurrency problems when storing the information.
I am afraid this kind of test is not the case for Lincheck. I would suggest writing a stress test instead, which runs threads and calls the save
function concurrently.
Hi, I have an implementation question for a unit test.
How can I test this case, where I need to mock the repository because I'm not interested in actually saving it, but I'm interested in knowing what the concurrency behavior is when saving information.
Code:
Test:
Repository:
Entity: