// but doesn't actually blow it away
swg.getStrategy().setGraphStrategy(new GraphStrategy() {
@Override
public UnaryOperator<Supplier<Void>> getRemoveVertexStrategy(final Strategy.Context<StrategyWrappedVertex> ctx) {
return (t) -> () -> {
final Vertex v = ctx.getCurrent().getBaseVertex();
v.bothE().remove();
v.properties().forEachRemaining(Property::remove);
v.property("deleted", true);
return null;
};
}
});
final Vertex toRemove = g.addVertex("name", "pieter");
toRemove.addEdge("likes", g.addVertex("feature", "Strategy"));
assertEquals(1, toRemove.properties().count().next().intValue());
assertEquals(new Long(1), toRemove.bothE().count().next());
assertFalse(toRemove.property("deleted").isPresent());
swg.v(toRemove.id()).remove();
final Vertex removed = g.v(toRemove.id());
assertNotNull(removed);
assertEquals(1, removed.properties().count().next().intValue());
assertEquals(new Long(0), removed.bothE().count().next());
assertTrue(removed.property("deleted").isPresent());
}