@Test(expectedExceptions = DescriptorValidationFailedException.class)
public void testParseNodeShouldThrowExceptionWhenSubTreeIsTooDeep() {

    //GIVEN
    Whitebox.setInternalState(underTest, "maxDepthOfXmlTree", 1);
    getChildNodes();
    given(element.getNodeType()).willReturn(Node.ELEMENT_NODE);
    given(element.getTagName()).willReturn(TEMPLATE_FORMATTER_SET_INVOKER_TAG, TEMPLATE_FORMATTER_SET_INVOKER_TAG, TEMPLATE_FORMATTER_TAG);
    mockTemplateFormatterAttributes();
    given(xPathEvaluator.getElementByXPath(Mockito.anyString(), Mockito.eq(document))).willReturn(node);
    given(formatterInitializer.getExternalClassObject("class")).willReturn(templateFormatter);
    //WHEN
    underTest.parseNode(node, document);
    //THEN exception is thrown
}