Search in sources :

Example 1 with GraphMock

use of org.eclipse.jnosql.mapping.graph.configuration.GraphConfigurationMock.GraphMock in project jnosql-diana by eclipse.

the class GraphConverterTest method shouldReturnManagerFactory.

@Test
public void shouldReturnManagerFactory() {
    final String prefix = UUID.randomUUID().toString();
    System.setProperty(prefix, prefix);
    System.setProperty(prefix + ".settings.key", "value");
    System.setProperty(prefix + ".settings.key2", "value2");
    System.setProperty(prefix + ".provider", GraphConfigurationMock.class.getName());
    final Graph graph = config.getValue(prefix, Graph.class);
    final GraphMock factoryMock = GraphMock.class.cast(graph);
    final Settings settings = factoryMock.getSettings();
    assertEquals(2, settings.size());
    assertEquals(settings.get("key").get(), "value");
    assertEquals(settings.get("key2").get(), "value2");
    assertNotNull(graph);
    System.clearProperty(prefix);
    System.clearProperty(prefix + ".settings.key");
    System.clearProperty(prefix + ".settings.key2");
    System.clearProperty(prefix + ".provider");
}
Also used : GraphMock(org.eclipse.jnosql.mapping.graph.configuration.GraphConfigurationMock.GraphMock) Graph(org.apache.tinkerpop.gremlin.structure.Graph) Settings(jakarta.nosql.Settings) Test(org.junit.jupiter.api.Test)

Aggregations

Settings (jakarta.nosql.Settings)1 Graph (org.apache.tinkerpop.gremlin.structure.Graph)1 GraphMock (org.eclipse.jnosql.mapping.graph.configuration.GraphConfigurationMock.GraphMock)1 Test (org.junit.jupiter.api.Test)1