@Test
public final void test_isResourceGraphValid_detectCycle() {

	/*
	 * Create a service-def with cycles in resource graph
	 *  A --> B --> C
	 *  ^           |
	 *  |           |
	 *  |---- D <---
	 */
	RangerResourceDef A = createResourceDef("A", "D"); // A's parent is D, etc.
	RangerResourceDef B = createResourceDef("B", "C");
	RangerResourceDef C = createResourceDef("C", "D");
	RangerResourceDef D = createResourceDef("D", "A");
	// order of resources in list sould not matter
	List<RangerResourceDef> resourceDefs = Lists.newArrayList(A, B, C, D);
	when(_serviceDef.getResources()).thenReturn(resourceDefs);
	_helper = new RangerServiceDefHelper(_serviceDef);
	assertFalse("Graph was valid!", _helper.isResourceGraphValid());
}