@Test public void findAllUsers() { List<User> users = userDao.findAll(); assertEquals("There should be 3 users in the datastore", 3, users.size()); assertEquals("The first item in the user list should have and id of \"third-user\"", "third-user", users.get(0).getId()); assertEquals("The second item in the user list should have and id of \"first-user\"", "first-user", users.get(1).getId()); assertEquals("The third item in the user list should have and id of \"second-user\"", "second-user", users.get(2).getId()); }
@Override public List<User> findAll() { return query().order("lastName, firstName").asList(); }
MongoUserDao extends MongoDao<User, String> implements UserDao { @Override public List<User> findAll() { return query().order("lastName, firstName").asList(); } }
MongoUserDao extends MongoDao<User, String> implements UserDao { @Override public List<User> findAll() { return query().order("lastName, firstName").asList(); } @Inject  MongoUserDao(Datastore datastore); }
MongoUserDao extends MongoDao<User, String> implements UserDao { @Override public List<User> findAll() { return query().order("lastName, firstName").asList(); } @Inject  MongoUserDao(Datastore datastore); @Override List<User> findAll(); @Override User findByUsername(String username); @Override User findByEmail(String email); }
MongoUserDao extends MongoDao<User, String> implements UserDao { @Override public List<User> findAll() { return query().order("lastName, firstName").asList(); } @Inject  MongoUserDao(Datastore datastore); @Override List<User> findAll(); @Override User findByUsername(String username); @Override User findByEmail(String email);  }