@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
public void shouldAllowDirectSettingOfIdField() {
final IdGraphStrategy strategy = (IdGraphStrategy) ((StrategyWrappedGraph) g).getStrategy().getGraphStrategy().get();
final Vertex v = g.addVertex(T.id, "test", "something", "else");
final Edge e = v.addEdge("self", v, T.id, "edge-id", "try", "this", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=false");
tryCommit(g, c -> {
assertNotNull(e);
assertEquals("edge-id", e.id());
assertEquals("this", e.property("try").value());
assertEquals("should be ok to set this as supportsEdgeId=false", e.property(strategy.getIdKey()).value());
final Edge found = g.e("edge-id");
assertEquals("edge-id", found.id());
assertEquals("this", found.property("try").value());
assertEquals("should be ok to set this as supportsEdgeId=false", found.property(strategy.getIdKey()).value());
});
try {
g.addVertex(T.id, "test", "something", "else", strategy.getIdKey(), "this should toss and exception as supportsVertexId=true");
fail("An exception should be tossed here because supportsVertexId=true");