@Test
public void test_invalid_resourceHierarchies_with_leaf_specification() {


 Leaf Spec for resources:
      Database: non-leaf
      UDF: Not-specified
      Table: Leaf
      Column: non-Leaf
      Table-Attribute: Leaf

 Create a service-def with following resource graph

   Database -> UDF
       |
       v
      Table -> Column
         |
         v
        Table-Attribute

  It should fail as the hierarchy is invalid ("Error in path: sink node:[Column] is not leaf node")
     *
/
    RangerResourceDef Database = createResourceDef("Database", "", false);
    RangerResourceDef UDF = createResourceDef("UDF", "Database");
    RangerResourceDef Table = createResourceDef("Table", "Database", true);
    RangerResourceDef Column = createResourceDef("Column", "Table", false);
    RangerResourceDef Table_Attribute = createResourceDef("Table-Attribute", "Table", true);
    // order of resources in list should not matter
    List<RangerResourceDef> resourceDefs = Lists.newArrayList(Column, Database, Table, Table_Attribute, UDF);
    // stuff this into a service-def
    when(_serviceDef.getResources()).thenReturn(resourceDefs);
    // now assert the behavior
    _helper = new RangerServiceDefHelper(_serviceDef);
    assertFalse(_helper.isResourceGraphValid());
}