@Test public void findAllTopologiesForAnonymous() { List<Topology> topologies = topologyDao.findAll(null); assertEquals("There should be 1 topologies for the anonymous user", 1, topologies.size()); assertEquals("The only item in the topology list should have and id of \"fourth\"", "fourth", topologies.get(0).getId()); }
@Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @Inject  MongoTopologyDao(Datastore datastore); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @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 List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @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);  }