DefaultGraphManager implements GraphManager { public final Bindings getAsBindings() { final Bindings bindings = new SimpleBindings(); graphs.forEach(bindings::put); traversalSources.forEach(bindings::put); return bindings; } DefaultGraphManager(final Settings settings); final Set<String> getGraphNames(); final Graph getGraph(final String graphName); final void putGraph(final String graphName, final Graph g); final Set<String> getTraversalSourceNames(); final TraversalSource getTraversalSource(final String traversalSourceName); final void putTraversalSource(final String tsName, final TraversalSource ts); final TraversalSource removeTraversalSource(final String tsName); final Bindings getAsBindings(); final void rollbackAll(); final void rollback(final Set<String> graphSourceNamesToCloseTxOn); final void commitAll(); final void commit(final Set<String> graphSourceNamesToCloseTxOn); final Graph openGraph(final String graphName, final Function<String, Graph> supplier); final Graph removeGraph(final String graphName);  }
@Test public void shouldGetAsBindings() { final Settings settings = Settings.read(DefaultGraphManagerTest.class.getResourceAsStream("../gremlin-server-integration.yaml")); final GraphManager graphManager = new DefaultGraphManager(settings); final Bindings bindings = graphManager.getAsBindings(); assertNotNull(bindings); assertEquals(6, bindings.size()); assertThat(bindings.containsKey("graph"), is(true)); assertThat(bindings.containsKey("classic"), is(true)); assertThat(bindings.containsKey("modern"), is(true)); assertThat(bindings.containsKey("crew"), is(true)); assertThat(bindings.containsKey("sink"), is(true)); assertThat(bindings.containsKey("grateful"), is(true)); assertThat(bindings.get("graph"), instanceOf(TinkerGraph.class)); }