@SuppressWarnings("rawtypes") @Test public void testGetByIds() throws HttpException, CerealException { MockRestClient mockClient = new MockRestClient(URL); DawgHouseClient client = new DawgHouseClient(); client.setClient(mockClient); JsonCerealEngine engine = new JsonCerealEngine(); String id = "770000004A12"; Map[] returnDevices = new Map[1]; MetaStb stb = new MetaStb(); stb.setId(id); returnDevices[0] = stb.getData(); mockClient.expect().andReturn(200).withBody(engine.writeToString(returnDevices), "application/json"); Collection<MetaStb> stbs = client.getByIds(Arrays.asList(id)); Assert.assertNotNull(stbs); Assert.assertEquals(stbs.size(), 1); Assert.assertEquals(stbs.iterator().next().getId(), id); }
@Override public Collection<MetaStb> getByIds(Collection<String> ids) { return getByCollection("/devices/id", ids, "id"); }
DawgHouseClient extends DawgClient implements IDawgHouseClient<MetaStb> { @Override public Collection<MetaStb> getByIds(Collection<String> ids) { return getByCollection("/devices/id", ids, "id"); } }
DawgHouseClient extends DawgClient implements IDawgHouseClient<MetaStb> { @Override public Collection<MetaStb> getByIds(Collection<String> ids) { return getByCollection("/devices/id", ids, "id"); } DawgHouseClient();  DawgHouseClient(String baseURL); }
DawgHouseClient extends DawgClient implements IDawgHouseClient<MetaStb> { @Override public Collection<MetaStb> getByIds(Collection<String> ids) { return getByCollection("/devices/id", ids, "id"); } DawgHouseClient();  DawgHouseClient(String baseURL); @Override MetaStb getById(String id); @Override void add(MetaStb stb); @Override void delete(String id); @Override Collection<MetaStb> getByIds(Collection<String> ids); @Override Collection<MetaStb> getByQuery(String query); @Override void deleteByIds(Collection<String> ids); @Override void delete(MetaStb stb); @Override void delete(Collection<MetaStb> stbs); @Override void add(Collection<MetaStb> stbs); @Override void update(MetaStb stb); @Override void update(Collection<String> id, Map<String, Object> data); @Override Collection<MetaStb> getAll(); DawgModel[] getDawgModels(String... modelNames); }
DawgHouseClient extends DawgClient implements IDawgHouseClient<MetaStb> { @Override public Collection<MetaStb> getByIds(Collection<String> ids) { return getByCollection("/devices/id", ids, "id"); } DawgHouseClient();  DawgHouseClient(String baseURL); @Override MetaStb getById(String id); @Override void add(MetaStb stb); @Override void delete(String id); @Override Collection<MetaStb> getByIds(Collection<String> ids); @Override Collection<MetaStb> getByQuery(String query); @Override void deleteByIds(Collection<String> ids); @Override void delete(MetaStb stb); @Override void delete(Collection<MetaStb> stbs); @Override void add(Collection<MetaStb> stbs); @Override void update(MetaStb stb); @Override void update(Collection<String> id, Map<String, Object> data); @Override Collection<MetaStb> getAll(); DawgModel[] getDawgModels(String... modelNames);  }