### Question:
AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return new ReportMetadata(mReportUri, reportDescriptor.getTotalPages()); } protected  AbstractReportExecution(ReportExecutionApi reportExecutionApi,
                                      String execId,
                                      String reportUri,
                                      long delay); @NotNull @Override final ReportMetadata waitForReportCompletion(); @NotNull @Override final ReportExport export(@NotNull ReportExportOptions options); @NotNull final ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters); @NotNull @Override String getExecutionId();  }### Answer:
@Test public void testWaitForReportCompletion() throws Exception { ReportMetadata metadata = abstractReportExecution.waitForReportCompletion(); assertThat("Failed to create report metadata with exact total pages", metadata.getUri(), is(REPORT_URI)); assertThat("Failed to create report metadata with exact report uri", metadata.getTotalPages(), is(TOTAL_PAGES)); verify(mReportExecutionApi).awaitStatus(EXEC_ID, REPORT_URI, 0, Status.ready()); verify(mReportExecutionApi).getDetails(EXEC_ID); }