---
title: Test script
description: Connectors continue to be released outside the IDM release. For the latest documentation, refer to the OpenICF documentation.
component: pingidm
version: 7.2
page_id: pingidm:connector-dev-guide:scripts/script-test
canonical_url: https://docs.pingidentity.com/pingidm/7.2/connector-dev-guide/scripts/script-test.html
---

# Test script

|   |                                                                                                                                                                                   |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Connectors continue to be released outside the IDM release. For the latest documentation, refer to the [OpenICF documentation](https://docs.pingidentity.com/openicf/index.html). |

A test script tests the connection to the external resource to ensure that the other operations that are provided by the connector can succeed.

A sample test script for an SQL database is provided in `openidm/samples/scripted-sql-with-mysql/tools/TestScript.groovy`.

* Input variables

  The following variables are available to the test script:

  * configuration

    A handler to the connector's configuration object.

  * operation

    An OperationType that corresponds to the action (`TEST`).

  * log

    A logger instance for the connector.

* Returns

  Nothing, if the test is successful. The script can throw any exception if it fails.

Test Script

```groovy
import org.identityconnectors.common.logging.Log
import org.forgerock.openicf.connectors.groovy.OperationType
import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration

def operation = operation as OperationType
def configuration = configuration as ScriptedConfiguration
def log = log as Log

log.info("This is a TestScript")
throw new MissingResourceException("Test Failed", operation.name(), "")
```
