@RunWithCustomExecutor @Test public void should_get_listing_when_listing_units_and_storage_returns_response_ok() throws StorageServerClientException { Mockito .when(storageClientFactory.getClient().getOfferLogs(VitamConfiguration.getDefaultStrategy(), DataCategory.BACKUP_OPERATION, 100L, 2, Order.ASC)) .thenReturn(getListingOk(100L, 2L)); RestoreBackupService restoreBackupService = new RestoreBackupService(storageClientFactory); Iterator<List<OfferLog>> listingIterator = restoreBackupService.getListing(VitamConfiguration.getDefaultStrategy(), 100L, 2); List<List<OfferLog>> listing = IteratorUtils.toList(listingIterator); assertThat(listing).isNotNull().isNotEmpty(); assertThat(listing.size()).isEqualTo(1); assertThat(listing.get(0)).isNotNull().isNotEmpty(); assertThat(listing.get(0).size()).isEqualTo(2); assertThat(listing.get(0).get(0).getFileName()).isEqualTo("100"); assertThat(listing.get(0).get(1).getFileName()).isEqualTo("101"); }
public Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", DataCategory.BACKUP_OPERATION.name(), strategy, offset, limit)); return Iterators.partition( OfferLogHelper.getListing(storageClientFactory, strategy, DataCategory.BACKUP_OPERATION, offset, Order.ASC, VitamConfiguration.getRestoreBulkSize(), limit), VitamConfiguration.getRestoreBulkSize()); }
RestoreBackupService { public Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", DataCategory.BACKUP_OPERATION.name(), strategy, offset, limit)); return Iterators.partition( OfferLogHelper.getListing(storageClientFactory, strategy, DataCategory.BACKUP_OPERATION, offset, Order.ASC, VitamConfiguration.getRestoreBulkSize(), limit), VitamConfiguration.getRestoreBulkSize()); } }
RestoreBackupService { public Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", DataCategory.BACKUP_OPERATION.name(), strategy, offset, limit)); return Iterators.partition( OfferLogHelper.getListing(storageClientFactory, strategy, DataCategory.BACKUP_OPERATION, offset, Order.ASC, VitamConfiguration.getRestoreBulkSize(), limit), VitamConfiguration.getRestoreBulkSize()); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); }
RestoreBackupService { public Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", DataCategory.BACKUP_OPERATION.name(), strategy, offset, limit)); return Iterators.partition( OfferLogHelper.getListing(storageClientFactory, strategy, DataCategory.BACKUP_OPERATION, offset, Order.ASC, VitamConfiguration.getRestoreBulkSize(), limit), VitamConfiguration.getRestoreBulkSize()); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit); LogbookBackupModel loadData(String strategy, String filename,
        long offset); }
RestoreBackupService { public Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", DataCategory.BACKUP_OPERATION.name(), strategy, offset, limit)); return Iterators.partition( OfferLogHelper.getListing(storageClientFactory, strategy, DataCategory.BACKUP_OPERATION, offset, Order.ASC, VitamConfiguration.getRestoreBulkSize(), limit), VitamConfiguration.getRestoreBulkSize()); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); Iterator<List<OfferLog>> getListing(String strategy, long offset, int limit); LogbookBackupModel loadData(String strategy, String filename,
        long offset);  }