@Test
public void testFindComponentsThatDependOn() {

	ApplicationTemplate app = ComplexApplicationFactory1.newApplication();
	// Root with no dependency
	Component comp = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.ROOT_1 );
	Assert.assertNotNull( comp );
	Map<Component,Boolean> map = ComponentHelpers.findComponentsThatDependOn( comp, app );
	Assert.assertEquals( 0, map.size());
	// Application with several dependencies
	comp = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.MYSQL );
	Assert.assertNotNull( comp );
	map = ComponentHelpers.findComponentsThatDependOn( comp, app );
	Assert.assertEquals( 2, map.size());
	Component key = new Component( ComplexApplicationFactory1.APP_1 );
	Assert.assertTrue( map.containsKey( key ));
	Assert.assertTrue( map.get( key ));
	key = new Component( ComplexApplicationFactory1.APP_2 );
	Assert.assertTrue( map.containsKey( key ));
	Assert.assertFalse( map.get( key ));
	// And another one
	comp = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.MONGO_DB );
	Assert.assertNotNull( comp );
	map = ComponentHelpers.findComponentsThatDependOn( comp, app );
	Assert.assertEquals( 1, map.size());
	key = new Component( ComplexApplicationFactory1.APP_2 );
	Assert.assertTrue( map.containsKey( key ));
	Assert.assertTrue( map.get( key ));
	// And again, another one
	comp = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.APP_3 );
	Assert.assertNotNull( comp );
	map = ComponentHelpers.findComponentsThatDependOn( comp, app );
	Assert.assertEquals( 0, map.size());
}