@Test(expectedExceptions = DescriptorValidationFailedException.class)
public final void testValidateShouldThrowExceptionWhenValidationFailed() throws SAXException, IOException {

    //GIVEN
    given(schema.newValidator()).willReturn(validator);
    given(domSourceFactory.newDOMSource(document)).willReturn(domSource);
    willThrow(new IOException()).given(validator).validate(domSource);
    //WHEN
    underTest.validate(document, schema);
    //THEN exception thrown
}