---
schema_version: "1"
id: 58789704b9e871441a0f6075416f252ba6b8b658c4bb15cd211b130e08c7c478
title: Test Constants
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_Test_constants.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_Test_constants.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 37dfd1cebef5819eb6507c5de9a26600d7b7a3d208ce26b789f552705fd01740
description: The Test class provides constants that are used as keys when you set mock application and environment context data.
---
# Test Constants

The Test class provides constants that are used as keys when you set mock application and environment context data.

When you call [Canvas.Test.mockRenderContext(applicationContextTestValues, environmentContextTestValues)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_Test_mockRenderContext.htm "Creates and returns a test Canvas.RenderContext based on the provided application and environment context parameters."), you need to provide maps of key-value pairs to represent your mock application and environment context data. The Test class provides static constant strings that you can use as keys for various parts of the application and environment context.

| Constant | Description |
| --- | --- |
| KEY\_CANVAS\_URL | Represents the canvas app URL key in the [ApplicationContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_ApplicationContext.htm "Use this interface to retrieve application context information, such as the application version or URL."). |
| KEY\_DEVELOPER\_NAME | Represents the canvas app developer or API name key in the [ApplicationContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_ApplicationContext.htm "Use this interface to retrieve application context information, such as the application version or URL."). |
| KEY\_DISPLAY\_LOCATION | Represents the canvas app display location key in the [EnvironmentContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_EnvironmentContext.htm "Use this interface to retrieve environment context information, such as the app display location or the configuration parameters."). |
| KEY\_LOCATION\_URL | Represents the canvas app location URL key in the [EnvironmentContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_EnvironmentContext.htm "Use this interface to retrieve environment context information, such as the app display location or the configuration parameters."). |
| KEY\_NAME | Represents the canvas app name key in the [ApplicationContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_ApplicationContext.htm "Use this interface to retrieve application context information, such as the application version or URL."). |
| KEY\_NAMESPACE | Represents the canvas app namespace key in the [ApplicationContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_ApplicationContext.htm "Use this interface to retrieve application context information, such as the application version or URL."). |
| KEY\_SUB\_LOCATION | Represents the canvas app sublocation key in the [EnvironmentContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_EnvironmentContext.htm "Use this interface to retrieve environment context information, such as the app display location or the configuration parameters."). |
| KEY\_VERSION | Represents the canvas app version key in the [ApplicationContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_ApplicationContext.htm "Use this interface to retrieve application context information, such as the application version or URL."). |