@SuppressWarnings("unchecked") @Test public void testGetById() { MongoHouseService service = new MongoHouseService(); MongoOperations operations = EasyMock.createMock(MongoOperations.class); EasyMock.expect(operations.findById((Object) EasyMock.anyObject(), (Class) EasyMock.anyObject(), (String) EasyMock.anyObject())).andReturn(null).anyTimes(); EasyMock.replay(operations); ReflectionTestUtils.setField(service, "template", operations); Assert.assertNull(service.getById("id"), "expected null but got" + service.getById("id")); }
@Override public Map<String,Object> getById(String id) { return toArray(template.findById(id, PersistableDevice.class,COLLECTION_NAME)); }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public Map<String,Object> getById(String id) { return toArray(template.findById(id, PersistableDevice.class,COLLECTION_NAME)); } }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public Map<String,Object> getById(String id) { return toArray(template.findById(id, PersistableDevice.class,COLLECTION_NAME)); }  }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public Map<String,Object> getById(String id) { return toArray(template.findById(id, PersistableDevice.class,COLLECTION_NAME)); }  @Override void upsertStb(DawgDevice... stbs); void replace(DawgDevice... stbs); @Override Map<String,Object>[] getStbsById(String... id); @Override Map<String,Object>[] getStbsByKey(String... keys); @Override Map<String,Object>[] getStbsByQuery(String query); @Override void deleteStbById(String... id); @Override Map<String,Object> getById(String id); @Override Map<String,Object>[] getAll(); @Override Map<String, Object>[] getStbsByTag(String tag, String query); }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public Map<String,Object> getById(String id) { return toArray(template.findById(id, PersistableDevice.class,COLLECTION_NAME)); }  @Override void upsertStb(DawgDevice... stbs); void replace(DawgDevice... stbs); @Override Map<String,Object>[] getStbsById(String... id); @Override Map<String,Object>[] getStbsByKey(String... keys); @Override Map<String,Object>[] getStbsByQuery(String query); @Override void deleteStbById(String... id); @Override Map<String,Object> getById(String id); @Override Map<String,Object>[] getAll(); @Override Map<String, Object>[] getStbsByTag(String tag, String query);  }