@Test public void findAllRoles() { List<Role> roles = roleDao.findAll(); assertEquals("There should be 3 roles in the datastore", 3, roles.size()); assertEquals("The first item in the role list should have and id of \"first-role\"", "first-role", roles.get(0).getId()); assertEquals("The second item in the role list should have and id of \"second-role\"", "second-role", roles.get(1).getId()); assertEquals("The third item in the role list should have and id of \"third-role\"", "third-role", roles.get(2).getId()); }
@Override public List<Role> findAll() { return query().order("name").asList(); }
MongoRoleDao extends MongoDao<Role, String> implements RoleDao { @Override public List<Role> findAll() { return query().order("name").asList(); } }
MongoRoleDao extends MongoDao<Role, String> implements RoleDao { @Override public List<Role> findAll() { return query().order("name").asList(); } @Inject  MongoRoleDao(Datastore datastore); }
MongoRoleDao extends MongoDao<Role, String> implements RoleDao { @Override public List<Role> findAll() { return query().order("name").asList(); } @Inject  MongoRoleDao(Datastore datastore); @Override List<Role> findAll(); @Override Role findByName(String name); }
MongoRoleDao extends MongoDao<Role, String> implements RoleDao { @Override public List<Role> findAll() { return query().order("name").asList(); } @Inject  MongoRoleDao(Datastore datastore); @Override List<Role> findAll(); @Override Role findByName(String name);  }