@SuppressWarnings("unchecked") @Test public void testUpsertStb() { MongoHouseService service = new MongoHouseService(); MongoOperations operations = EasyMock.createMock(MongoOperations.class); EasyMock.expect(operations.collectionExists((Class) EasyMock.anyObject())).andReturn(false); EasyMock.expect(operations.createCollection((Class) EasyMock.anyObject())).andReturn(null); operations.save((PersistableDevice) EasyMock.anyObject(), (String) EasyMock.anyObject()); EasyMock.expectLastCall(); EasyMock.expect(operations.findById((Object) EasyMock.anyObject(), (Class) EasyMock.anyObject(), (String) EasyMock.anyObject())).andReturn(null); EasyMock.replay(operations); ReflectionTestUtils.setField(service, "template", operations); ParkService mockParkService = EasyMock.createMock(ParkService.class); EasyMock.expect(mockParkService.getModelById((String) EasyMock.anyObject())).andReturn(null); EasyMock.replay(mockParkService); ReflectionTestUtils.setField(service, "parkService", mockParkService); DawgDevice[] stb = new DawgDevice[1]; stb[0] = new PersistableDevice(); try { service.upsertStb(stb); } catch (Exception e) { Assert.fail(e.getMessage(),e); } }
@Override public void upsertStb(DawgDevice... stbs) { upsertStb(false, stbs); }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public void upsertStb(DawgDevice... stbs) { upsertStb(false, stbs); } }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public void upsertStb(DawgDevice... stbs) { upsertStb(false, stbs); }  }
MongoHouseService extends AbstractDawgService implements HouseService { @Override public void upsertStb(DawgDevice... stbs) { upsertStb(false, stbs); }  @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 void upsertStb(DawgDevice... stbs) { upsertStb(false, stbs); }  @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);  }