Package org.mockserver.uuid
Class UUIDService
java.lang.Object
org.mockserver.uuid.UUIDService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic voidfixedUUID(boolean fixed) Test-only: pin (or unpin)getUUID()toFIXED_UUID_FOR_TESTSfor the CURRENT thread only, so parallel test classes do not generate colliding ids.static voidfixedUUIDGlobally(boolean fixed) Test-only: pin (or unpin)getUUID()for ALL threads.static StringgetUUID()
-
Field Details
-
FIXED_UUID_FOR_TESTS
-
-
Constructor Details
-
UUIDService
public UUIDService()
-
-
Method Details
-
getUUID
-
fixedUUID
public static void fixedUUID(boolean fixed) Test-only: pin (or unpin)getUUID()toFIXED_UUID_FOR_TESTSfor the CURRENT thread only, so parallel test classes do not generate colliding ids. EveryfixedUUID(true)MUST be paired with afixedUUID(false)on the same thread - prefer theorg.mockserver.uuid.FixedUUIDJUnit rule, which guarantees the reset. -
fixedUUIDGlobally
public static void fixedUUIDGlobally(boolean fixed) Test-only: pin (or unpin)getUUID()for ALL threads. Required by integration tests that assert on ids generated on the in-process server's threads rather than the test thread. Because it is JVM-global it is NOT parallel-safe - use only from tests that run sequentially. -
fixedUUID
public static boolean fixedUUID()
-