@Test public void findTopologyByIdForAnonymous() { Topology validTopology = topologyDao.findById("fourth", null); assertNotNull("The returned topology should not be null with valid query values", validTopology); Topology invalidTopology = topologyDao.findById("second", null); assertNull("The returned topology should be null with invalid query values", invalidTopology); }
@Override public Topology findById(String id, String userId) { return query().field("_id").equal(id).field("userId").equal(userId).get(); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public Topology findById(String id, String userId) { return query().field("_id").equal(id).field("userId").equal(userId).get(); } }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public Topology findById(String id, String userId) { return query().field("_id").equal(id).field("userId").equal(userId).get(); } @Inject  MongoTopologyDao(Datastore datastore); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public Topology findById(String id, String userId) { return query().field("_id").equal(id).field("userId").equal(userId).get(); } @Inject  MongoTopologyDao(Datastore datastore); @Override boolean exists(String id, String userId); @Override List<Topology> findAll(String userId); @Override Topology findById(String id, String userId); @Override Topology findByName(String name, String userId); @Override Topology save(Topology topology, String userId); @Override Topology update(Topology topology, String userId); @Override void delete(Topology topology, String userId); @Override void deleteById(String id, String userId); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public Topology findById(String id, String userId) { return query().field("_id").equal(id).field("userId").equal(userId).get(); } @Inject  MongoTopologyDao(Datastore datastore); @Override boolean exists(String id, String userId); @Override List<Topology> findAll(String userId); @Override Topology findById(String id, String userId); @Override Topology findByName(String name, String userId); @Override Topology save(Topology topology, String userId); @Override Topology update(Topology topology, String userId); @Override void delete(Topology topology, String userId); @Override void deleteById(String id, String userId);  }