@Test public void testFromRootEntityWithNullId(){ GraphVisitor repository = new MockGraphVisitor(); GraphQueryImpl graphQueryImpl = new GraphQueryImpl(repository); try{ graphQueryImpl.fromRootEntity(null); Assert.fail("Should have thrown exception"); }catch(Exception e){ AssertJUnit.assertTrue(e instanceof IllegalArgumentException); AssertJUnit.assertEquals(e.getMessage(), "Parameter \"id\" cannot be null"); } }
@Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; } }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; } GraphQueryImpl(GraphVisitor repository); }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; } GraphQueryImpl(GraphVisitor repository); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal where(Predicate predicate); @Override Queries.GraphTraversal fromRootEntity(ID id); @Override Projection select(); }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal fromRootEntity(ID id) { Preconditions.argumentNotNull(id, "id"); pipeline.add(new GetEntityByID(id)); return this; } GraphQueryImpl(GraphVisitor repository); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentEntitiesVia(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name); @Override Queries.GraphTraversal selectAdjacentRelationships(
			Relationship.Name name, Direction direction); @Override Queries.GraphTraversal where(Predicate predicate); @Override Queries.GraphTraversal fromRootEntity(ID id); @Override Projection select();  }