@Test
public void testGetResources_temporal() throws Exception {

  Properties properties = new Properties();
  properties.put("p1", "v1");
  Configuration ambariConfig = new Configuration(properties);
  ViewConfig config = ViewConfigTest.getConfig(xml);
  ViewEntity viewEntity = ViewRegistryTest.getViewEntity(config, ambariConfig, getClass().getClassLoader(), "");
  ViewRegistryTest.getViewInstanceEntity(viewEntity, config.getInstances().get(0));
  Map<Resource.Type, ViewSubResourceDefinition> resourceDefinitions = viewEntity.getResourceDefinitions();
  Assert.assertEquals(1, resourceDefinitions.size());
  Resource.Type type = resourceDefinitions.keySet().iterator().next();
  ViewSubResourceProvider viewSubResourceProvider = new ViewSubResourceProvider(type, MyResource.class, "id", viewEntity);
  Set<String> requestProperties = new HashSet<String>();
  requestProperties.add("metrics/myMetric");
  Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
  TemporalInfo temporalInfo = new TemporalInfoImpl(1000L, 1100L, 10L);
  temporalInfoMap.put("metrics/myMetric", temporalInfo);
  Request request = PropertyHelper.getReadRequest(requestProperties, temporalInfoMap);
  Predicate predicate = new AlwaysPredicate();
  Set<Resource> resources = viewSubResourceProvider.getResources(request, predicate);
  Assert.assertEquals(2, resources.size());
}