}
@Test
public void testAdditionalTypes() {
Graph graph = TinkerGraphFactory.createTinkerGraph();
FramedGraphFactory factory = new FramedGraphFactory(new AbstractModule() {
@Override
public void doConfigure(FramedGraphConfiguration config) {
config.addTypeResolver(new TypeResolver() {
@Override
public Class<?>[] resolveTypes(Edge e, Class<?> defaultType) {
return new Class[] { AdditionalEdge.class };
}
@Override
public Class<?>[] resolveTypes(Vertex v, Class<?> defaultType) {
return new Class[] { AdditionalVertex.class };
}
});
}
});
framedGraph = factory.create(graph);
Person marko = framedGraph.getVertex(1, Person.class);
Assert.assertTrue(marko instanceof AdditionalVertex);
Assert.assertFalse(marko instanceof AdditionalEdge);