ArchiverAccessor Class

Provides access to Archive Apex. In tests, use setMock() to return a simulated response instead of making a live archive callout.

SF_Archive

In an Apex test, call setMock() to register a mock response so your test doesn’t make a live callout to archived data.

The following are methods for ArchiverAccessor.

  • setMock(mock)

    Instructs the Apex runtime to send a mock response whenever Archive Apex makes a callout, so you can test your Apex without accessing archived data.

Instructs the Apex runtime to send a mock response whenever Archive Apex makes a callout, so you can test your Apex without accessing archived data.

public static void setMock(System.HttpCalloutMock mock)

mock

Type: System.HttpCalloutMock

The mock implementation that returns your simulated response.

Type: Void

This example tests global search against archived data. MockHttpResponseGenerator implements HttpCalloutMock and returns a simulated response, so the test runs without a live archive callout.