@Test(expectedExceptions = ResponseFormattingFailedException.class)
public void testFormatTemplateShouldThrowExceptionWhenXslFileResourceDoesNotExist() throws Exception {

    //GIVEN
    params.addParameter(new Parameter(XSL_PARAM_KEY, XSL_PARAM_KEY));
    given(stubResourcePathProvider.getTemplatesPathAsString()).willReturn(XSL_PARAM_KEY);
    given(fileFactory.createFile(Mockito.anyString())).willReturn(file);
    given(fileUtils.getFileAsByteArray(file)).willThrow(new IOException());
    //WHEN
    underTest.formatResponse(wilmaRequest, response, templateResource, params);
    //THEN exception is thrown
}