Skip to main content

Test Account

To test your connector, you can define a test account in the testAccounts top-level property of the configuration file. The information provided in this section will be sent to the X-Unito-Credentials header of your connector.

Custom Authorization method

For example, if your connector has the following configuration using a custom authorization method;

{
"authorizations": [
{
"name": "apiKey",
"method": "custom",
"variables": {
"apiKey": {
"type": "password",
"required": true,
"label": "Your API key"
}
}
}
]
}

You could define the following test account;

{
"testAccounts": {
"development": {
"apiKey": "<your test api key>"
}
}
}

Note: Here the 'apiKey' field is not named randomly, it matches the variable defined in the Authorization above.

Oauth2 Authorization method

Here is another example for a connector using the following configuration with a oauth2 authorization method;

{
"authorizations": [
{
"name": "oauth2",
"method": "oauth2",
"variables": {
"workspace": {
"type": "string",
"label": "Your workspace"
}
}
"oauth2": {
"clientSecret": "<obtained from the provider>",
"clientId": "<obtained from the provider>",
"authorizationUrl": "<obtained from the provider>",
"grantType": "authorization_code",
"tokenUrl": "<obtained from the provider>"
"scopes": [{ "name": "<obtained from the provider>", "help": "<description of the scope>" }]
}
}
]
}

You could define the following test account;

{
"testAccounts": {
"development": {
"accessToken": "<test account access token>", // When using oauth2 method, we always look for 'accessToken'
"workspace": "<test account workspace>" // And the other variables needed, as defined in the Authorization
}
}
}

Sensitive field encryption

If you need to keep some test account information secret for any reasons (e.g maybe you are using your own tiktok account apiKey), you can encrypt the sensitive values individually using the CLI encrypt command, use them in your configuration file and the Debugger will take care of decrypting it at runtime.

warning

To use this feature, you must deploy your integration once with the publish command.

{
...,
"testAccounts": {
"development": {
"apiKey": "Not so secret api key for test account",
"otherValue": "Blue font"
},
"compliance": {
// Encrypted value retrieved with the `integration-cli encrypt` command
// Starts with 'unito-secret-vX://'
"apiKey": "unito-secret-v1://encrypted-secret",
"otherValue": "Blue font"
}
}
}

Test account types

Two types of test accounts are currently supported — development, and compliance. They both serve distinct purposes, and prevent conflicts that may arise when multiple parties run tests concurrently. Here's why they are necessary:

  • Isolation: We maintain separate testing environments for development and compliance accounts to prevent interference between tests.

  • Conflict Prevention: This separation ensures that simultaneous testing activities do not disrupt each other, providing a smooth testing experience.

A compliance account is mandatory if you eventually want to publish your connector.