Skip to main content
Skip table of contents

B25.TestUtil_GoMeddoPlatformCache

Overview

TestUtil_GoMeddoPlatformCache allows for the GoMeddo cache layer to be temporarily mocked instead of using the Salesforce Platform Cache.

This class can only be used inside of unit tests and should only be used if the GoMeddo cache is causing issues. This is most likely if a unit test requires SeeAllData=true because the salesforce platform cache can’t be used in tests that use SeeAllData=true

Example

JAVA
@IsTest
private with sharing class MyTest {
  @IsTest(SeeAllData=true)
  private static void myUnitTest() {
    // Enabled the GoMeddo cache mocks because the Salesforce Platform Cache can't be used in SeeAllData tests.
    B25.TestUtil_GoMeddoPlatformCache.enableCacheMock();
    // Perform test logic.
    // Disable the GoMeddo cache mocks again.
    B25.TestUtil_GoMeddoPlatformCache.disableCacheMock();
  }
}

Methods

enableCacheMock

CODE
void enableCacheMock()

Enables the GoMeddoPlatformCache mocks. This causes the values to be stored in memory instead of caching it in the salesforce platform cache. Doing this could cause GoMeddo to use more memory or CPU time. Only use these mocks if for some reason your unit test can’t use the salesforce platform cache.

disableCacheMock

CODE
void disableCacheMock()

Disables the GoMeddoPlatformCache mocks.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.