TimelineReaderClientImpl extends TimelineReaderClient { @Override public List<TimelineEntity> getContainerEntities( ApplicationId appId, String fields, Map<String, String> filters, long limit, String fromId) throws IOException { String path = PATH_JOINER.join("clusters", clusterId, "apps", appId, "entities", YARN_CONTAINER); if (fields == null || fields.isEmpty()) { fields = "INFO"; } MultivaluedMap<String, String> params = new MultivaluedMapImpl(); params.add("fields", fields); if (limit > 0) { params.add("limit", Long.toString(limit)); } if (fromId != null && !fromId.isEmpty()) { params.add("fromid", fromId); } mergeFilters(params, filters); ClientResponse response = doGetUri(baseUri, path, params); TimelineEntity[] entity = response.getEntity(TimelineEntity[].class); return Arrays.asList(entity); } TimelineReaderClientImpl(); @Override TimelineEntity getApplicationEntity(ApplicationId appId, String fields,
      Map<String, String> filters); @Override TimelineEntity getApplicationAttemptEntity(
      ApplicationAttemptId appAttemptId,
      String fields, Map<String, String> filters); @Override List<TimelineEntity> getApplicationAttemptEntities(
      ApplicationId appId, String fields, Map<String, String> filters,
      long limit, String fromId); @Override TimelineEntity getContainerEntity(ContainerId containerId,
      String fields, Map<String, String> filters); @Override List<TimelineEntity> getContainerEntities(
      ApplicationId appId, String fields,
      Map<String, String> filters,
      long limit, String fromId);  }
@Test public void testGetContainers() throws Exception { ApplicationId appId = ApplicationId.fromString("application_1234_0001"); List<TimelineEntity> entities = client.getContainerEntities(appId, null, null, 0, null); Assert.assertEquals(2, entities.size()); Assert.assertEquals("mockContainer2", entities.get(1).getId()); }