@Test
public void testGetJoinedResourceProperties() throws Exception {

  ResourceDefinition resourceDefinition = new StackResourceDefinition();
  Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
  mapIds.put(Resource.Type.Stack, "HDP");
  //test
  QueryImpl instance = new TestQuery(mapIds, resourceDefinition);
  instance.addProperty("versions/*", null);
  instance.addProperty("versions/operating_systems/*", null);
  instance.addProperty("versions/operating_systems/repositories/*", null);
  instance.execute();
  Set<String> propertyIds = new HashSet<String>();
  propertyIds.add("versions/operating_systems/repositories/Repositories/repo_id");
  propertyIds.add("versions/operating_systems/OperatingSystems/os_type");
  Map<Resource, Set<Map<String, Object>>> resourcePropertiesMap = instance.getJoinedResourceProperties(propertyIds, null, null);
  Set<Map<String, Object>> propertyMaps = null;
  for (Map.Entry<Resource, Set<Map<String, Object>>> resourceSetEntry : resourcePropertiesMap.entrySet()) {
    Assert.assertEquals(Resource.Type.Stack, resourceSetEntry.getKey().getType());
    propertyMaps = resourceSetEntry.getValue();
  }
  if (propertyMaps == null) {
    fail("No property maps found!");
  }
  Assert.assertEquals(6, propertyMaps.size());
  for (Map<String, Object> map : propertyMaps) {
    Assert.assertEquals(2, map.size());
    Assert.assertTrue(map.containsKey("versions/operating_systems/OperatingSystems/os_type"));
    Assert.assertTrue(map.containsKey("versions/operating_systems/repositories/Repositories/repo_id"));
  }
}