### Question:
DatabaseService implements IDatabaseService { @Override public DumpReportDto getDumpReportDto(String reportCode) { DumpReportDto dtos = null; try { DataSourceDumpReport report = this.getDatabaseManager().getBackupReport(reportCode); if (null == report) { logger.warn("no dump found with code {}", reportCode); throw new ResourceNotFoundException(DatabaseValidator.ERRCODE_NO_DUMP_FOUND, "reportCode", reportCode); } dtos = new DumpReportDto(report, this.getComponentManager()); } catch (ResourceNotFoundException r) { throw r; } catch (Throwable t) { logger.error("error extracting database report {}", reportCode, t); throw new RestServerError("error extracting database report " + reportCode, t); } return dtos; }  @Override int getStatus(); @Override PagedMetadata<ShortDumpReportDto> getShortDumpReportDtos(RestListRequest requestList); @Override DumpReportDto getDumpReportDto(String reportCode); @Override void deleteDumpReport(String reportCode); @Override List<ComponentDto> getCurrentComponents(); @Override void startDatabaseBackup(); @Override void startDatabaseRestore(String reportCode); @Override byte[] getTableDump(String reportCode, String dataSource, String tableName); IDatabaseManager getDatabaseManager(); void setDatabaseManager(IDatabaseManager databaseManager); IComponentManager getComponentManager(); void setComponentManager(IComponentManager componentManager);  }### Answer:
@Test(expected = ResourceNotFoundException.class) public void getInvalidReport() throws Throwable { when(databaseManager.getBackupReport(ArgumentMatchers.anyString())).thenReturn(null); this.databaseService.getDumpReportDto("reportCode"); }
@Test public void getValidReport() throws Throwable { String xml = null; DataSourceDumpReport report = new DataSourceDumpReport(xml); when(databaseManager.getBackupReport(ArgumentMatchers.anyString())).thenReturn(report); DumpReportDto dto = this.databaseService.getDumpReportDto("reportCode"); Assert.assertNotNull(dto); }