Testing your Custom Connector
On This Page
After creating the logic of your custom connector, you need to test whether it retrieves data from your Source. Hevo provides a structured method to test your connector within the test_connector
repository.
The testing files are available in the src/main/java
directory under:
src > main > java/io/hevo/connector > generic_test
The generic_test
folder contains the following files:
-
FileConnectorProcessor.java: Internal file that handles the testing processes. You do not need to modify this file.
-
GenericConnectorTester.java: Execution file containing the testing class that runs the connector in a development environment. You need to execute the main class within this file.
-
config.json: Configuration file where you input your Source credentials for testing.
The testing process involves two main steps:
Update the Test Configuration File
Before running the test, you need to update config.json
file with your Source credentials. This ensures that GenericConnectorTester.java
can establish a connection using real values. To update the config.json file, do the following:
-
Navigate to the
generic_test
folder and open theconfig.json
file. This contains the following:{ "accountType": "PRODUCTION", "authCredentials": { "authType": "OAUTH", "clientId": "<your-client-id>", "clientSecret": "<your-client-secret>", "refreshToken": "***" } }
-
Replace
<your-client-id>
and<your-client-secret>
with the Source credentials.
Note: If your authentication method is different, such as API Key, modify the authType
and structure accordingly.
Execute the Test Class and Verify the Output
Once the credentials are configured, you can run the test to verify your connector. To do this:
-
In your Integrated Development Environment (IDE), locate the
GenericConnectorTester.java
file. -
Right click the file and select Run, or use the following terminal command:
java -cp target/test_connector.jar io.hevo.connector.generic_test.GenericConnectorTester
After running the test class, the connector performs the following steps:
-
Initialize connection to the Source.
-
Fetch available objects such as tables or views.
-
Retrieve schema details for each object, including field types and constraints.
-
Fetch Source data to verify that records can be read and processed correctly.
-
Display the retrieved data as it would appear in the Destination, allowing you to validate its structure and accuracy.
Based on the test results, there are a few possible next steps:
-
If the test is successful, the connector is ready for integration with Hevo. You must send the
TestConnector.java
file containing the connection logic to your Hevo account executive through Google Drive. Hevo will then handle the next steps and deploy the custom connector. -
If the test fails, check the error logs to troubleshoot potential issues such as incorrect credentials, connection failures, or unsupported data types. Additionally, validate the data formatting to ensure that retrieved records match the expected types and structure.