Class VCRRegistry

java.lang.Object
com.redis.vl.test.vcr.VCRRegistry

public class VCRRegistry extends Object
Tracks which tests have been recorded and their status.

The registry maintains metadata about each test in Redis, including:

  • Recording status (RECORDED, FAILED, MISSING)
  • Timestamp of last recording
  • Associated cassette keys
  • Error messages for failed tests
  • Constructor Details

    • VCRRegistry

      public VCRRegistry(UnifiedJedis jedis)
      Creates a new VCR registry.
      Parameters:
      jedis - the Redis client
  • Method Details

    • registerSuccess

      public void registerSuccess(String testId, List<String> cassetteKeys)
      Registers a successful test recording.
      Parameters:
      testId - the unique test identifier
      cassetteKeys - the keys of cassettes recorded for this test
    • registerFailure

      public void registerFailure(String testId, String error)
      Registers a failed test recording.
      Parameters:
      testId - the unique test identifier
      error - the error message
    • getTestStatus

      public VCRRegistry.RecordingStatus getTestStatus(String testId)
      Gets the recording status of a test.
      Parameters:
      testId - the unique test identifier
      Returns:
      the recording status
    • determineEffectiveMode

      public VCRMode determineEffectiveMode(String testId, VCRMode globalMode)
      Determines the effective VCR mode for a test based on registry status.
      Parameters:
      testId - the unique test identifier
      globalMode - the global VCR mode
      Returns:
      the effective mode to use for this test
    • getAllRecordedTests

      public Set<String> getAllRecordedTests()
      Gets all recorded test IDs.
      Returns:
      set of test IDs
    • getCassetteKeys

      public Set<String> getCassetteKeys(String testId)
      Gets the cassette keys for a test.
      Parameters:
      testId - the unique test identifier
      Returns:
      set of cassette keys