@Test
public void testFinalizeProperties__instance_properties() {

  SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
  Schema schema = createNiceMock(Schema.class);
  // schema expectations
  expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(schema).anyTimes();
  expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
  replay(schemaFactory, schema);
  HashSet<String> serviceProperties = new HashSet<String>();
  serviceProperties.add("foo/bar");
  QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
  TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
  MinimalRenderer renderer = new MinimalRenderer();
  renderer.init(schemaFactory);
  TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
  assertEquals(2, propertyTree.getObject().size());
  assertTrue(propertyTree.getObject().contains("ServiceInfo/service_name"));
  assertTrue(propertyTree.getObject().contains("foo/bar"));
  assertEquals(0, propertyTree.getChildren().size());
  verify(schemaFactory, schema);
}