AsyncReportStatusListener implements IAsyncReportListener { @Override public synchronized void reportProcessingFinished( final ReportProgressEvent event ) { if ( CollectionUtils.isNotEmpty( callbackListeners ) ) { for ( final ReportProgressListener listener : callbackListeners ) { listener.reportProcessingFinished( event ); } } } AsyncReportStatusListener( final String path,
                                    final UUID uuid,
                                    final String mimeType,
                                    final List<? extends ReportProgressListener> callbackListeners ); @Override synchronized void setStatus( final AsyncExecutionStatus status ); @Override synchronized void setErrorMessage( final String errorMessage ); boolean isFirstPageMode(); synchronized void setRequestedPage( final int requestedPage ); @Override synchronized int getRequestedPage(); @Override synchronized void updateGenerationStatus( final int generatedPage ); @Override synchronized boolean isScheduled(); @Override synchronized void reportProcessingStarted( final ReportProgressEvent event ); @Override synchronized void reportProcessingUpdate( final ReportProgressEvent event ); @Override synchronized void reportProcessingFinished( final ReportProgressEvent event ); @Override String toString(); synchronized IAsyncReportState getState(); boolean isQueryLimitReached(); @Override void setIsQueryLimitReached( boolean isQueryLimitReached ); @Override int getTotalRows(); synchronized void cancel();  }
@Test public void reportProcessingFinished() throws Exception { final ReportProgressListener progressListener = mock( ReportProgressListener.class ); final AsyncReportStatusListener listener = new AsyncReportStatusListener( "", UUID.randomUUID(), "", Collections.singletonList( progressListener ) ); final ReportProgressEvent event = mock( ReportProgressEvent.class ); listener.reportProcessingFinished( event ); verify( progressListener, times( 1 ) ).reportProcessingFinished( event ); assertFalse( AsyncExecutionStatus.FINISHED.equals( listener.getState().getStatus() ) ); }