Bixby Developer Center

Mock Data

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.

OAuth and Configs & Secrets Mock Data

This sample capsule demonstrates using mock data with Configs & Secrets and authorization with OAuth.

Download Capsule

To see the capsule in action, open the Simulator and give one of the following utterances, or run one of the provided stories.

  • "get mocked data": demonstrates a Config & Secrets Mock
    • In the Simulator, this gets the configuration and secret values from the Developer Console.
    • In the provided 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.
  • "goal with authorization": demonstrates an OAuth Mock
    • In the Simulator, this asks the user to authenticate.
    • In the provided 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.