SFDC (Salesforce) plugin
- Plugin name:
- Plugin class:
- Basic Salesforce mock implementation.
- Non-persistent SObject creation.
- Non-persistent SObject update.
- SObject retrieval by ID.
- Dummy SOQL queries.
Option 1: Using the CLI
To use this plugin, install it with the Imposter CLI:
imposter plugin install -d mock-sfdc
This will install the plugin version matching the current engine version used by the CLI. The next time you run
imposter up, the plugin will be available.
Option 2: Using the JAR
To use this plugin, download the plugin
imposter-plugin-mock-sfdc.jar JAR file from the Releases page.
Enable it with the following environment variables:
Using the plugin
Read the Configuration section to understand how to configure Imposter.
Note: Clients interacting with this plugin often require TLS/SSL to be enabled. If this is the case for your client, ensure that you use an https:// scheme for accessing the mock server. See the TLS/SSL section in the TLS/SSL section for more details.
Note: Typically, an OAuth2 login step precedes interactions with the SFDC API. As part of this, the mock server is required to return an
instance_url to the client. Imposter uses the 'server URL', which is described in the Usage section.
For working examples, see:
Let's assume your configuration is in a folder named
docker run -ti -p 8080:8080 \ -v $PWD/config:/opt/imposter/config \ outofcoffee/imposter-all \ --serverUrl http://localhost:8080
Standalone Java example:
java -jar distro/sfdc/build/libs/imposter-all.jar \ --configDir ./config \ --serverUrl http://localhost:8080
This starts a mock server using the SFDC plugin. Responses are served based on the configuration files inside the
Using the example above, you can connect a Salesforce client, such as ForceApi, to http://localhost:8080/ to interact with the API. In this example, you can interact with the
Account SObject, as defined in
Additional script context objects
There are no additional script context objects available.