This sample capsule demonstrates how to add "mock data" to your capsule stories for testing purposes. Your capsule might need to work with data that isn't readily available to it within Stories, such as configuration values, or OAuth server responses.
Because you cannot submit a capsule with the example
namespace, in order to test a sample capsule on a device, you must change the id
in the capsule.bxb
file from example
to your organization's namespace before making a private submission.
For example, if your namespace is acme
, change example.oauthConfigSecretSample
to acme.oauthConfigSecretSample
.
This sample capsule demonstrates using mock data with Configs & Secrets and authorization with OAuth.
To see the capsule in action, open the Simulator and give one of the following utterances, or run one of the provided stories.
config&secret
Story, the values from the Developer Console will be overwritten with the mocked values from the story's config-and-secret-mocks.json
file, provided the key names are the same.oauth
Story, this uses the mocked token value from the story's oauth-mocks.json
file without prompting the user.You can modify the mocked values by editing the appropriate JSON files within the appropriate story folders. The stories are located within resources/en/config&secret
and resources/en/oauth
.