Test Mode

Learn how to work with test mode for Android ATS Mobile SDK.

You can simulate the actual flow of the library without prior setup in Console and without creating network requests from the library itself to the backend.

Activate Test Mode

To activate test mode, set LRAtsConfiguration's isTestMode param value to true during initialization of the library:

LRAtsManager.initialize(
    LRAtsConfiguration(
        configID = "40b867f9-93cc-4687-a2c7-d02bed91aaee",
        apiKey = "",
        isTestMode = true,
        logToFileEnabled = false
    )
) { success, error ->
    if (success) {
        // SDK ready for use
    } else {
        // SDK failed to initialize
    }
}
LRAtsManager.INSTANCE.initialize(new LRAtsConfiguration("40b867f9-93cc-4687-a2c7-d02bed91aaee", "", true, false), (success, lrError) -> {
    if (success) {
        // SDK ready for use
    } else {
        // SDK failed to initialize
    }
});

Test Configuration

In test mode, the library uses the following test configuration:

{
  "pId": 1,
  "preferredATS": "regular",
  "bloomFilters": [
    {
      "id": "1000-hashed-binary.filter"
    }
  ],
  "syncConfiguration": {
    "isAutomaticSyncEnabled": true,
    "maximumStorageAllowed": 0,
    "isBackgroundSyncEnabled": false,
    "preferredSyncTime": "duringInactiveHours",
    "useMobileNetwork": false
  },
  "geoTargeting": {
    "ccpa": {
      "allCountries": false,
      "allStates": true,
      "countries": [
        "US"
      ],
      "states": []
    },
    "gdpr": {
      "allCountries": false,
      "allStates": false,
      "countries": [
        "AT",
        "BE",
        "BG",
        "RS"
      ],
      "states": []
    }
  },
  "isLoggingEnabled": true,
  "envelope": {
    "expirationTime": 420000,
    "minimumRefreshTime": 60000
  },
  "atsEnabledCountries": [
    "AT",
    "NL",
    "RS",
    "BG",
    "US"
  ],
  "isPlacementApproved": true
}

Envelope Flow

In order to get envelopes, you can use the getEnvelope API. The returned envelope will be a random string in the same format as envelopes in real use cases.

ATS On-Device Flow

You can test the ATS On-Device flow by calling the getDealIDs API as with a real use case. After the call, the passed identifiers will be checked and a list of matching Deal IDs will be returned.

The sample emails below are used to test the Deal IDs generation process. If the test mode was successfully set up, you should be able to find these emails in campaign(data set):