Package org.mockito.internal.progress
Class ThreadSafeMockingProgress
- java.lang.Object
-
- org.mockito.internal.progress.ThreadSafeMockingProgress
-
public class ThreadSafeMockingProgress extends java.lang.Object
Provides access to theMockingProgress
of a correspondingThread
. EveryThread
in Mockito has it s ownMockingProgress
to avoid data races while stubbing.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<MockingProgress>
MOCKING_PROGRESS_PROVIDER
-
Constructor Summary
Constructors Modifier Constructor Description private
ThreadSafeMockingProgress()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MockingProgress
mockingProgress()
Returns theMockingProgress
for the current Thread.
-
-
-
Field Detail
-
MOCKING_PROGRESS_PROVIDER
private static final java.lang.ThreadLocal<MockingProgress> MOCKING_PROGRESS_PROVIDER
-
-
Method Detail
-
mockingProgress
public static final MockingProgress mockingProgress()
Returns theMockingProgress
for the current Thread.IMPORTANT: Never assign and access the returned
MockingProgress
to an instance or static field. Thread safety can not be guaranteed in this case, cause the Thread that wrote the field might not be the same that read it. In other words multiple threads will access the sameMockingProgress
.- Returns:
- never
null
-
-