Class ExpectationFileSystemPersistence

java.lang.Object
org.mockserver.persistence.ExpectationFileSystemPersistence
All Implemented Interfaces:
MockServerMatcherListener

public class ExpectationFileSystemPersistence extends Object implements MockServerMatcherListener
  • Constructor Details

    • ExpectationFileSystemPersistence

      public ExpectationFileSystemPersistence(Configuration configuration, MockServerLogger mockServerLogger, RequestMatchers requestMatchers, BlobStore blobStore)
      Creates persistence backed by the given BlobStore. The blob key is derived by BlobKeys.forPersistedFile(BlobStore, Path): the absolute path of configuration.persistedExpectationsPath() for the FilesystemBlobStore, so it writes the exact same file as the previous direct-I/O implementation, and the FILE NAME alone for every other store, because an absolute local path is not a valid object-store key.
      Parameters:
      configuration - the MockServer configuration
      mockServerLogger - logger for diagnostics
      requestMatchers - the request matchers to observe for changes
      blobStore - the blob store to delegate writes to
    • ExpectationFileSystemPersistence

      public ExpectationFileSystemPersistence(Configuration configuration, MockServerLogger mockServerLogger, RequestMatchers requestMatchers)
      Backwards-compatible constructor that creates a FilesystemBlobStore internally, preserving the original direct-file-I/O behaviour for callers that do not supply a BlobStore (e.g. existing tests).
  • Method Details