@Test public void testEntityWithNullInput(){ GraphVisitor repository = new MockGraphVisitor(); GraphLookUpQuery graphLookupQuery = new GraphLookUpQuery(repository); try{ graphLookupQuery.entity(null); fail("Should have thrown with null entities"); }catch(Exception e){ assertTrue(e instanceof IllegalArgumentException); assertEquals(e.getMessage(), "Parameter \"entityID\" cannot be null"); } }
@Override public Queries.Projection entity(Entity.ID entityID) { Preconditions.argumentNotNull(entityID, "entityID"); OperationPipeline pipeline = new OperationPipeline(); pipeline.add(new GetEntityByID(entityID)); return new GraphProjection(repository, pipeline); }
GraphLookUpQuery implements Queries.LookupQuery { @Override public Queries.Projection entity(Entity.ID entityID) { Preconditions.argumentNotNull(entityID, "entityID"); OperationPipeline pipeline = new OperationPipeline(); pipeline.add(new GetEntityByID(entityID)); return new GraphProjection(repository, pipeline); } }
GraphLookUpQuery implements Queries.LookupQuery { @Override public Queries.Projection entity(Entity.ID entityID) { Preconditions.argumentNotNull(entityID, "entityID"); OperationPipeline pipeline = new OperationPipeline(); pipeline.add(new GetEntityByID(entityID)); return new GraphProjection(repository, pipeline); } GraphLookUpQuery(final GraphVisitor repository); }
GraphLookUpQuery implements Queries.LookupQuery { @Override public Queries.Projection entity(Entity.ID entityID) { Preconditions.argumentNotNull(entityID, "entityID"); OperationPipeline pipeline = new OperationPipeline(); pipeline.add(new GetEntityByID(entityID)); return new GraphProjection(repository, pipeline); } GraphLookUpQuery(final GraphVisitor repository); @Override Queries.Projection entities(Entity.ID... entityIDs); @Override Queries.Projection entity(Entity.ID entityID); @Override ValueSpecifier<Projection> entityBy(Name name); }
GraphLookUpQuery implements Queries.LookupQuery { @Override public Queries.Projection entity(Entity.ID entityID) { Preconditions.argumentNotNull(entityID, "entityID"); OperationPipeline pipeline = new OperationPipeline(); pipeline.add(new GetEntityByID(entityID)); return new GraphProjection(repository, pipeline); } GraphLookUpQuery(final GraphVisitor repository); @Override Queries.Projection entities(Entity.ID... entityIDs); @Override Queries.Projection entity(Entity.ID entityID); @Override ValueSpecifier<Projection> entityBy(Name name);  }