@Test public void testWithRelationshipWhenRelationshipIsNull(){ MockMutationExecuterFactory mutationExecutionFactory = new MockMutationExecuterFactory(); GraphMutation graphMutation = new GraphMutation(mutationExecutionFactory); try{ graphMutation.withRelationship(null); fail("Should have thrown an exception with null entity"); }catch(Exception e){ assertTrue(e instanceof IllegalArgumentException); assertEquals(e.getMessage(), "Parameter \"relationship\" cannot be null"); } }
@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);  }