ParsingHistoneProcessingExceptionProcessor extends HistoneProcessingExceptionProcessor { @Override protected void processInternal(HttpServletRequest request, HttpServletResponse response, Exception exception, String templateLocation) throws Exception { throw new RuntimeException("Error evaluating histone template '" + templateLocation + "' in line " + ((ParserException) exception).getLine() + ": " + exception.getMessage(), exception); }    }
@Test public void testProcessInternal() throws Exception { try { HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); postProcessor.process(request, response, new ParserException("parsing was failed", "uri", 0), "someLocation"); fail("Exception should be thrown"); } catch (Exception ex) { assertThat(ex.getMessage(), is("Error evaluating histone template 'someLocation' in line 0: parsing was failed")); } }