@RunWithCustomExecutor @Test public void should_get_listing_when_listing_gots_and_storage_returns_response_ok() throws StorageServerClientException { when(storageClientFactory.getClient().getOfferLogs(STRATEGY_UNIT, DataCategory.OBJECTGROUP, 100L, 2, Order.ASC)) .thenReturn(getListingOk(100L, 2L)); RestoreBackupService restoreBackupService = new RestoreBackupService(storageClientFactory); Iterator<OfferLog> listingIterator = restoreBackupService.getListing(STRATEGY_UNIT, DataCategory.OBJECTGROUP, 100L, 2, Order.ASC, VitamConfiguration.getRestoreBulkSize()); List<OfferLog> listing = IteratorUtils.toList(listingIterator); assertThat(listing).hasSize(2); assertThat(listing.get(0).getFileName()).isEqualTo("100"); assertThat(listing.get(1).getFileName()).isEqualTo("101"); }
public Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order, int batchSize) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", category, strategy, offset, limit)); return OfferLogHelper.getListing( storageClientFactory, strategy, category, offset, order, batchSize, limit); }
RestoreBackupService { public Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order, int batchSize) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", category, strategy, offset, limit)); return OfferLogHelper.getListing( storageClientFactory, strategy, category, offset, order, batchSize, limit); } }
RestoreBackupService { public Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order, int batchSize) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", category, strategy, offset, limit)); return OfferLogHelper.getListing( storageClientFactory, strategy, category, offset, order, batchSize, limit); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); }
RestoreBackupService { public Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order, int batchSize) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", category, strategy, offset, limit)); return OfferLogHelper.getListing( storageClientFactory, strategy, category, offset, order, batchSize, limit); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order,
        int batchSize); MetadataBackupModel loadData(String strategy, MetadataCollections collection, String filename,
        long offset); InputStream loadData(String strategy, DataCategory category, String filename); }
RestoreBackupService { public Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order, int batchSize) { LOGGER.info(String.format( "[Reconstruction]: Retrieve listing of {%s} Collection on {%s} Vitam strategy from {%s} offset with {%s} limit", category, strategy, offset, limit)); return OfferLogHelper.getListing( storageClientFactory, strategy, category, offset, order, batchSize, limit); } RestoreBackupService(); @VisibleForTesting  RestoreBackupService(StorageClientFactory storageClientFactory); Iterator<OfferLog> getListing(String strategy, DataCategory category, Long offset, Integer limit, Order order,
        int batchSize); MetadataBackupModel loadData(String strategy, MetadataCollections collection, String filename,
        long offset); InputStream loadData(String strategy, DataCategory category, String filename);  }