@Test(expectedExceptions = ResponseFormattingFailedException.class)
public void testGenerateResponseWhenSAXExceptionDuringTransformShouldThrowException() throws SaxonApiException, SAXException {

    //GIVEN
    given(transformer.transform(xslInputStream, requestInputStream, templateInputStream, nameToXml)).willThrow(new SAXException());
    //WHEN
    underTest.generateResponse(requestXml, xsl, templateXml, nameToXml);
    //THEN it should throw excpetion
}