ReservationReportPdfStamperView extends AbstractPdfStamperView { @Override protected void prepareResponse(HttpServletRequest request, HttpServletResponse response) { super.prepareResponse(request, response); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); }  @Override String getUrl();  }
@Test public void testPrepareResponse() { HttpServletRequest request = new MockHttpServletRequest(); HttpServletResponse response = new MockHttpServletResponse(); reservationReportPdfStamperView.prepareResponse(request, response); assertThat(response.getHeader("Pragma"), is("private")); assertThat(response.getHeader("Cache-Control"), is( "private, must-revalidate")); assertThat(response.getCharacterEncoding(), is(StandardCharsets.UTF_8 .name())); }