Class UUIDService

java.lang.Object
org.mockserver.uuid.UUIDService

public class UUIDService extends Object
  • Field Details

    • FIXED_UUID_FOR_TESTS

      public static final String FIXED_UUID_FOR_TESTS
  • Constructor Details

    • UUIDService

      public UUIDService()
  • Method Details

    • getUUID

      public static String getUUID()
    • fixedUUID

      public static void fixedUUID(boolean fixed)
      Test-only: pin (or unpin) getUUID() to FIXED_UUID_FOR_TESTS for the CURRENT thread only, so parallel test classes do not generate colliding ids. Every fixedUUID(true) MUST be paired with a fixedUUID(false) on the same thread - prefer the org.mockserver.uuid.FixedUUID JUnit 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()