@Test public void findComponentByFrameworkAndName() { Component validComponent = componentDao.findByFrameworkAndName("test", "first-component"); assertNotNull("The returned component should not be null with valid query values", validComponent); Component invalidComponent = componentDao.findByFrameworkAndName("test", "invalid-component"); assertNull("The returned component should be null with invalid query values", invalidComponent); }
@Override public Component findByFrameworkAndName(String framework, String name) { return query().field("framework").equal(framework) .field("name").equal(name).get(); }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public Component findByFrameworkAndName(String framework, String name) { return query().field("framework").equal(framework) .field("name").equal(name).get(); } }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public Component findByFrameworkAndName(String framework, String name) { return query().field("framework").equal(framework) .field("name").equal(name).get(); } @Inject  MongoComponentDao(Datastore datastore); }
MongoComponentDao extends MongoDao<Component, String> implements ComponentDao { @Override public Component findByFrameworkAndName(String framework, String name) { return query().field("framework").equal(framework) .field("name").equal(name).get(); } @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 Component findByFrameworkAndName(String framework, String name) { return query().field("framework").equal(framework) .field("name").equal(name).get(); } @Inject  MongoComponentDao(Datastore datastore); @Override List<Component> findAll(); @Override List<Component> findAllWithFramework(String framework); @Override Component findByFrameworkAndName(String framework, String name);  }