@Test public void testSelectAdjacentEntitiesWithNullName() { GraphVisitor repository = new MockGraphVisitor(); GraphQueryImpl graphQueryImpl = new GraphQueryImpl(repository); try { graphQueryImpl.selectAdjacentEntitiesVia(null); Assert.fail("Should have thrown an exception for null name"); } catch (Exception e) { AssertJUnit.assertTrue(e instanceof IllegalArgumentException); AssertJUnit.assertEquals(e.getMessage(), "Parameter \"name::com.intuit.ugc.api.Relationship$Name\" cannot be null"); } }
@Override public Queries.GraphTraversal selectAdjacentEntitiesVia( Relationship.Name name) { Preconditions.argumentNotNull(name, "name::"+Relationship.Name.class.getName()); pipeline.add(new SelectEntities(name, null)); return this; }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal selectAdjacentEntitiesVia( Relationship.Name name) { Preconditions.argumentNotNull(name, "name::"+Relationship.Name.class.getName()); pipeline.add(new SelectEntities(name, null)); return this; } }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal selectAdjacentEntitiesVia( Relationship.Name name) { Preconditions.argumentNotNull(name, "name::"+Relationship.Name.class.getName()); pipeline.add(new SelectEntities(name, null)); return this; } GraphQueryImpl(GraphVisitor repository); }
GraphQueryImpl implements Queries.GraphQuery, Queries.GraphTraversal { @Override public Queries.GraphTraversal selectAdjacentEntitiesVia( Relationship.Name name) { Preconditions.argumentNotNull(name, "name::"+Relationship.Name.class.getName()); pipeline.add(new SelectEntities(name, null)); 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 selectAdjacentEntitiesVia( Relationship.Name name) { Preconditions.argumentNotNull(name, "name::"+Relationship.Name.class.getName()); pipeline.add(new SelectEntities(name, null)); 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();  }