@Test
public void setSuccessHeadersTest() throws Exception {

  final ExecuteReportContentHandler handler = new ExecuteReportContentHandler( contentGenerator );
  // validated and executed.
  when( reportComponent.validate() ).thenReturn( true );
  when( reportComponent.execute() ).thenReturn( true );
  handler.createReportContent( outputStream, fileId, path, true, reportComponent, audit );
  // since this is successfull report execution check for response headers set:
  verify( response, times( 1 ) )
    .setHeader( eq( "Content-Disposition" ), eq( "inline; filename*=UTF-8''%3AsomeFile.html" ) );
  verify( response, times( 1 ) ).setHeader( eq( "Content-Description" ), eq( fileName ) );
  verify( response, times( 1 ) ).setHeader( eq( "Cache-Control" ), eq( "private, max-age=0, must-revalidate" ) );
  verify( response, times( 1 ) ).setContentLength( anyInt() );
  // we don't flush or close servlet output stream manually:
  verify( outputStream, times( 0 ) ).flush();
  verify( outputStream, times( 0 ) ).close();
}