@Test public void testWithRelationshipWhenRelationshipIsNotNull(){ MockMutationExecuterFactory mutationExecutionFactory = new MockMutationExecuterFactory(); GraphMutation graphMutation = new GraphMutation(mutationExecutionFactory); TartanImplTestUtil util = new TartanImplTestUtil(); Entity.ID sourceEntityID = Entity.ID.valueOf("urn:entity:" + TartanImplTestConstants.ATTR_PARENT_ID.getName() + "." + TartanImplTestConstants.ATTR_PARENT_ID.getName() + "/" + UUID.randomUUID()); Entity.ID targetEntityID = Entity.ID.valueOf("urn:entity:" + TartanImplTestConstants.ATTR_CHILD_ID.getName() + "." + TartanImplTestConstants.ATTR_PARENT_ID.getName() + "/" + UUID.randomUUID()); Name attributeName = TartanImplTestConstants.ATTR_DUMMY_ATTRIBUTE_NAME; String attributeValue = "Dummy Attribute"; Metadata metadata = new MockMetadata(); GraphAttribute graphAttribute = new GraphAttribute(attributeName, attributeValue, metadata); GraphRelationship graphRelationship = util.buildGraphRelationship( TartanImplTestConstants.ATTR_DUMMY_RELATIONSHIP_NAME, sourceEntityID, targetEntityID, graphAttribute); assertNotNull(graphMutation.withRelationship(graphRelationship)); }
@Override public Relationship.Mutation withRelationship(Relationship relationship) { Preconditions.argumentNotNull(relationship, "relationship"); return new GraphRelationshipMutation(relationship, pipeline, this); }
GraphMutation implements BatchMutation { @Override public Relationship.Mutation withRelationship(Relationship relationship) { Preconditions.argumentNotNull(relationship, "relationship"); return new GraphRelationshipMutation(relationship, pipeline, this); } }
GraphMutation implements BatchMutation { @Override public Relationship.Mutation withRelationship(Relationship relationship) { Preconditions.argumentNotNull(relationship, "relationship"); return new GraphRelationshipMutation(relationship, pipeline, this); } @Inject  GraphMutation(MutationExecutorFactory factory); }
GraphMutation implements BatchMutation { @Override public Relationship.Mutation withRelationship(Relationship relationship) { Preconditions.argumentNotNull(relationship, "relationship"); return new GraphRelationshipMutation(relationship, pipeline, 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 Relationship.Mutation withRelationship(Relationship relationship) { Preconditions.argumentNotNull(relationship, "relationship"); return new GraphRelationshipMutation(relationship, pipeline, 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);  }