@Test public void findAllComponentsWithFramework() { List<Component> components = componentDao.findAllWithFramework("test"); assertEquals("There should be 2 components with the given framework", 2, components.size()); assertEquals("The first item in the component list should have and id of \"first\"", "first", components.get(0).getId()); assertEquals("The second item in the component list should have and id of \"third\"", "third", components.get(1).getId()); }
@Override public List<Component> findAllWithFramework(String framework) { return query().field("framework").equal(framework) .order("label").asList(); }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public List<Component> findAllWithFramework(String framework) { return query().field("framework").equal(framework) .order("label").asList(); } }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public List<Component> findAllWithFramework(String framework) { return query().field("framework").equal(framework) .order("label").asList(); } @Inject  MongoComponentDao(Datastore datastore); }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public List<Component> findAllWithFramework(String framework) { return query().field("framework").equal(framework) .order("label").asList(); } @Inject  MongoComponentDao(Datastore datastore); @Override List<Component> findAll(); @Override List<Component> findAllWithFramework(String framework); @Override Component findByFrameworkAndName(String framework, String name); }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public List<Component> findAllWithFramework(String framework) { return query().field("framework").equal(framework) .order("label").asList(); } @Inject  MongoComponentDao(Datastore datastore); @Override List<Component> findAll(); @Override List<Component> findAllWithFramework(String framework); @Override Component findByFrameworkAndName(String framework, String name);  }