Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
NebulaGraph is a popular open-source graph database that can handle large volumes of data with milliseconds of latency, scale up quickly, and have the ability to perform fast graph analytics. NebulaGraph has been widely used for social media, recommendation systems, knowledge graphs, security, capital flows, AI, etc.
Support Java 8+, Scala 3, Scala 2.13 and Scala 2.12
sbt:
"io.github.jxnu-liguobin" %% "testcontainers-nebula" % "latest version" % Test
maven:
<dependency>
<groupId>io.github.jxnu-liguobin</groupId>
<artifactId>testcontainers-nebula_2.13</artifactId>
<version>'latest version'</version>
<scope>test</scope>
</dependency>
gradle:
testImplementation group: 'io.github.jxnu-liguobin', name: 'testcontainers-nebula_2.13', version: 'latest version'
Create a cluster with three nodes, this means that 3 metad nodes, 3 storaged nodes, 3 graphd nodes and 1 console will be created:
// Logs and data are mounted to the current directory.
NebulaClusterContainer cluster = new ArbitraryNebulaCluster(3, "v3.6.0", Optional.of("./"));
cluster.start();
In general, it is only necessary to create a cluster with one node, this means that 1 metad node, 1 storaged node, 1 graphd node and 1 console will be created:
// Logs and data are mounted to the current directory.
NebulaClusterContainer cluster = new ArbitraryNebulaCluster(1, "v3.6.0", Optional.of("./"));
cluster.start();
Java example: SimpleNebulaCluster
ZIO example: NebulaSpec
The zio module provides default configurations for better integration with zio-nebula, just adding dependency:
"io.github.jxnu-liguobin" %% "testcontainers-nebula-zio" % "latest version"
// testcontainers-nebula-zio depends on zio-nebula dependency
"io.github.jxnu-liguobin" %% "zio-nebula" % "latest version"