@Test public void testCreateRelationshipWithValidRelationship(){ TartanImplTestUtil util = new TartanImplTestUtil(); NewEntity sourceEntity = util.createNewEntity(TartanImplTestConstants.ATTR_CHILD_KEY); NewEntity targetEntity = util.createNewEntity(TartanImplTestConstants.ATTR_PARENT_KEY); NewRelationship newRelationship = NewRelationship .between(sourceEntity.getEntityID(), targetEntity.getEntityID()).withLabel(TartanImplTestConstants.ATTR_PARENT_CHILD_KEY).build(); MockMutationExecuterFactory mutationExecutionFactory = new MockMutationExecuterFactory(); GraphMutation graphMutation = new GraphMutation(mutationExecutionFactory); BatchMutation createRelationship = graphMutation.createRelationship(newRelationship); assertNotNull(createRelationship); }
@Override public BatchMutation createRelationship(NewRelationship newRelationship) { Preconditions.argumentNotNull(newRelationship, "newRelationship"); CreateRelationship createRelationships = new CreateRelationship( newRelationship); pipeline.add(createRelationships); return this; }
GraphMutation implements BatchMutation { @Override public BatchMutation createRelationship(NewRelationship newRelationship) { Preconditions.argumentNotNull(newRelationship, "newRelationship"); CreateRelationship createRelationships = new CreateRelationship( newRelationship); pipeline.add(createRelationships); return this; } }
GraphMutation implements BatchMutation { @Override public BatchMutation createRelationship(NewRelationship newRelationship) { Preconditions.argumentNotNull(newRelationship, "newRelationship"); CreateRelationship createRelationships = new CreateRelationship( newRelationship); pipeline.add(createRelationships); return this; } @Inject  GraphMutation(MutationExecutorFactory factory); }
GraphMutation implements BatchMutation { @Override public BatchMutation createRelationship(NewRelationship newRelationship) { Preconditions.argumentNotNull(newRelationship, "newRelationship"); CreateRelationship createRelationships = new CreateRelationship( newRelationship); pipeline.add(createRelationships); return this; } @Inject  GraphMutation(MutationExecutorFactory factory); @Override BatchMutation createEntity(NewEntity newEntity); @Override BatchMutation createRelationship(NewRelationship newRelationship); @Override OperationResult<Result> execute(); @Override Entity.Mutation withEntity(Entity entity); @Override Relationship.Mutation withRelationship(Relationship relationship); }
GraphMutation implements BatchMutation { @Override public BatchMutation createRelationship(NewRelationship newRelationship) { Preconditions.argumentNotNull(newRelationship, "newRelationship"); CreateRelationship createRelationships = new CreateRelationship( newRelationship); pipeline.add(createRelationships); return this; } @Inject  GraphMutation(MutationExecutorFactory factory); @Override BatchMutation createEntity(NewEntity newEntity); @Override BatchMutation createRelationship(NewRelationship newRelationship); @Override OperationResult<Result> execute(); @Override Entity.Mutation withEntity(Entity entity); @Override Relationship.Mutation withRelationship(Relationship relationship);  }