Skip to content

Instantly share code, notes, and snippets.

@okram
Created January 24, 2013 21:31
Show Gist options
  • Save okram/4627959 to your computer and use it in GitHub Desktop.
Save okram/4627959 to your computer and use it in GitHub Desktop.
TransactionalGraph g = new EgoSystemGraph();
AddFollowsExtension af = new AddFollowsExtension();
JSONObject request = new JSONObject('''
{
sourceIdentity: {uri:'http://marko'},
targetIdentities: [{uri:'http://herbert'}],
inOrOut: 'out'
}
''');
assertFalse(af.addFollows(new RexsterResourceContext(null, null, null, request, null, null, null), g).errorResponse);
assertEquals(g.V.count(), 2);
assertEquals(g.E.count(), 1);
assertEquals(g.v(0).out(Tokens.FOLLOWS).retain([g.v(1)]).count(), 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment