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