Github Codespaces is the easiest way to evaluate this repository as all of the prerequisites are automatically installed. If you want to setup locally instead of through Codespaces, using a Dev Container with Visual Studio Code is recommended as the Java based prerequisites are automatically installed.
Code
buttonOpen with Codespaces
New codespace
buttonTo manage your codespaces, visit the Github Codespaces page.
Ensure you have the following prerequisites installed.
Setup a Dev Container for the kafka-connect-cosmosdb repo by cloning it in a Docker container.
Remote Explorer
menu from the left sidebar and click on the Clone Repository in Container Volume
option as shown below. Alternatively, you can open up the Command Palette (F1
key) and search for Remote Containers: Clone Repository
Create a new volume
option.vs-remote-container
for the volume name and kafka-connect-cosmosdb
for the target folder name.You can manage your dev containers from the Remote Explorer
menu from the left sidebar of Visual Studio Code (as shown previously in the first step of installation).
For more information on working with Dev Containers in Visual Studio Code, refer to the documentation.
Ensure you have the following prerequisites installed.
Clone the Github repo microsoft/kafka-connect-cosmosdb GitHub repository.
git clone https://github.com/microsoft/kafka-connect-cosmosdb.git
JAVA_HOME
system environment variable to the install location of the JDK, for example, C:\Program Files\Java\jdk-13.0.2
.java.home
setting in VS Code’s User or Workspace settingsNavigate to root project directory and execute unit tests
cd kafka-connect-cosmosdb
mvn clean test
To run the integration tests, you will need to first setup the following resources:
Update the sink and source connectors configuration files located in src/test/resources
by filling out the values for connect.cosmos.connection.endpoint
and connect.cosmos.master.key
, which you should have saved from the Cosmos DB setup guide.
Navigate to root project directory and execute the integration tests
cd kafka-connect-cosmosdb
# copy the template connector configs into src/test/resources
# you will need to update the configs for the Cosmos values as mentioned above
cp src/docker/resources/sink.example.json src/test/resources/sink.config.json
cp src/docker/resources/source.example.json src/test/resources/source.config.json
# run the integration tests
mvn clean test-compile failsafe:integration-test