Janusgraph enable ConfiguredGraphFactory in test container

Viewed 34

I am using test container with Janusgraph, but I need to use ConfiguredGraphFactory in my test. How to enable it in test container? This is how I am starting the test container:

        GenericContainer<JanusGraph> janus = new JanusGraph()
            .withNetwork(network)
            .withExposedPorts(JANUS_PORT)
            .waitingFor(Wait.forListeningPort())
            .withStartupTimeout(Duration.ofMinutes(5))
            .withEnv("janusgraph.storage.backend", "cql")
            .withEnv("janusgraph.storage.hostname", storageName)
            .withEnv("janusgraph.index.search.backend", "elasticsearch")
            .withEnv("janusgraph.index.search.hostname", indexName)
            .withEnv("janusgraph.schema.default", "tp3");

I was trying to add .withEnv("janusgraph.graph.graphname"."org.janusgraph.core.ConfiguredGraphFactory") but it doesn't work (image name: janusgraph/janusgraph:0.5.3).

2 Answers

From looking at this JanusGraph PR, I think this approach should work:

.withEnv("gremlin.graph"."org.janusgraph.core.ConfiguredGraphFactory")

However, I have no experience with JanusGraph and I think this is not a Testcontainers-specific question. This means you can conceptually configure it for Testcontainers the same way to would configure it for a Docker container with the Docker CLI.

Related