@Test
public void testGetSubResourceDefinitions() throws Exception {

  ViewConfig config = ViewConfigTest.getConfig();
  ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
  ViewRegistry registry = ViewRegistry.getInstance();
  viewDefinition.setConfiguration(config);
  registry.setupViewDefinition(viewDefinition, getClass().getClassLoader());
  Set<SubResourceDefinition> subResourceDefinitions =
      registry.getSubResourceDefinitions(viewDefinition.getCommonName(), viewDefinition.getVersion());
  Assert.assertEquals(3, subResourceDefinitions.size());
  Set<String> names = new HashSet<String>();
  for (SubResourceDefinition definition : subResourceDefinitions) {
    names.add(definition.getType().name());
  }
  Assert.assertTrue(names.contains("MY_VIEW{1.0.0}/resources"));
  Assert.assertTrue(names.contains("MY_VIEW{1.0.0}/resource"));
  Assert.assertTrue(names.contains("MY_VIEW{1.0.0}/subresource"));
}