@Test public void testCreateRelationship() { 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(); CreateRelationship createRelationship = new CreateRelationship(newRelationship); assertEquals(newRelationship.getName(), createRelationship.newRelationship().getName()); assertEquals(sourceEntity.getEntityID(), createRelationship.newRelationship().getSourceID()); assertEquals(TartanImplTestConstants.ATTR_PARENT_CHILD_KEY.toString(), createRelationship.newRelationship().getName().toString()); String expectedRelationString = "Operation [Create Relationship] SOURCE ID [" + newRelationship.getSourceID() + "]" + " TARGET ID [" + newRelationship.getTargetID() + "]"; assertEquals(expectedRelationString, createRelationship.toString()); }
public CreateRelationship(NewRelationship newRelationship) { super(); this.newRelationship = newRelationship; }
CreateRelationship implements Operation { public CreateRelationship(NewRelationship newRelationship) { super(); this.newRelationship = newRelationship; } }
CreateRelationship implements Operation { public CreateRelationship(NewRelationship newRelationship) { super(); this.newRelationship = newRelationship; } CreateRelationship(NewRelationship newRelationship); }
CreateRelationship implements Operation { public CreateRelationship(NewRelationship newRelationship) { super(); this.newRelationship = newRelationship; } CreateRelationship(NewRelationship newRelationship); NewRelationship newRelationship(); @Override String toString(); }
CreateRelationship implements Operation { public CreateRelationship(NewRelationship newRelationship) { super(); this.newRelationship = newRelationship; } CreateRelationship(NewRelationship newRelationship); NewRelationship newRelationship(); @Override String toString();  }