Package ru.testit.services
Class ResultStorage
java.lang.Object
ru.testit.services.ResultStorage
Storage for test results
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>getClassContainer(String uuid) getFixture(String uuid) getTestResult(String uuid) getTestsContainer(String uuid) <T> Tvoid<T> voidupdateIfPresent(String uuid, Class<T> clazz, Consumer<T> update) Updates stored item in a thread-safe way.
-
Constructor Details
-
ResultStorage
public ResultStorage()
-
-
Method Details
-
getTestResult
-
getFixture
-
getStep
-
getTestsContainer
-
getClassContainer
-
get
-
put
-
remove
-
updateIfPresent
Updates stored item in a thread-safe way.Uses
ConcurrentHashMap.computeIfPresent(Object, java.util.function.BiFunction)to avoid "get-then-update" races and synchronizes on the stored instance to protect its internal state (e.g. nested lists/maps) from concurrent modifications.
-