@RunWithCustomExecutor @Test public void should_get_empty_listing_when_listing_objects_returns_empty_response_ok() throws StorageException { when( distribution.getOfferLogsByOfferId(VitamConfiguration.getDefaultStrategy(), OFFER_ID, DataCategory.OBJECT, 10L, 1, Order.ASC)) .thenReturn(getOfferLogsListing(DataCategory.OBJECT.getFolder(), 10L, -1L)); List<OfferLog> offerLogListing = restoreOfferBackupService.getListing(VitamConfiguration.getDefaultStrategy(), OFFER_ID, DataCategory.OBJECT, 10L, 1, Order.ASC); assertThat(offerLogListing).isNotNull().isEmpty(); }
public List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException { LOGGER.debug(String.format( "[Offer synchronization]: Retrieve listing of {%s} dataCategory from {%s} offer, with {%s} Vitam strategy from {%s} offset with {%s} limit", category.name(), offerId, strategy, offset, limit)); RequestResponse<OfferLog> result = distribution.getOfferLogsByOfferId(strategy, offerId, category, offset, limit, order); if (!result.isOk()) { throw new StorageException( String.format("ERROR: VitamError has been returned when using storage service: {%s}", result.toString())); } return ((RequestResponseOK<OfferLog>) result).getResults(); }
RestoreOfferBackupService { public List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException { LOGGER.debug(String.format( "[Offer synchronization]: Retrieve listing of {%s} dataCategory from {%s} offer, with {%s} Vitam strategy from {%s} offset with {%s} limit", category.name(), offerId, strategy, offset, limit)); RequestResponse<OfferLog> result = distribution.getOfferLogsByOfferId(strategy, offerId, category, offset, limit, order); if (!result.isOk()) { throw new StorageException( String.format("ERROR: VitamError has been returned when using storage service: {%s}", result.toString())); } return ((RequestResponseOK<OfferLog>) result).getResults(); } }
RestoreOfferBackupService { public List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException { LOGGER.debug(String.format( "[Offer synchronization]: Retrieve listing of {%s} dataCategory from {%s} offer, with {%s} Vitam strategy from {%s} offset with {%s} limit", category.name(), offerId, strategy, offset, limit)); RequestResponse<OfferLog> result = distribution.getOfferLogsByOfferId(strategy, offerId, category, offset, limit, order); if (!result.isOk()) { throw new StorageException( String.format("ERROR: VitamError has been returned when using storage service: {%s}", result.toString())); } return ((RequestResponseOK<OfferLog>) result).getResults(); } RestoreOfferBackupService(StorageDistribution distribution); }
RestoreOfferBackupService { public List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException { LOGGER.debug(String.format( "[Offer synchronization]: Retrieve listing of {%s} dataCategory from {%s} offer, with {%s} Vitam strategy from {%s} offset with {%s} limit", category.name(), offerId, strategy, offset, limit)); RequestResponse<OfferLog> result = distribution.getOfferLogsByOfferId(strategy, offerId, category, offset, limit, order); if (!result.isOk()) { throw new StorageException( String.format("ERROR: VitamError has been returned when using storage service: {%s}", result.toString())); } return ((RequestResponseOK<OfferLog>) result).getResults(); } RestoreOfferBackupService(StorageDistribution distribution); List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset,
        int limit, Order order); }
RestoreOfferBackupService { public List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException { LOGGER.debug(String.format( "[Offer synchronization]: Retrieve listing of {%s} dataCategory from {%s} offer, with {%s} Vitam strategy from {%s} offset with {%s} limit", category.name(), offerId, strategy, offset, limit)); RequestResponse<OfferLog> result = distribution.getOfferLogsByOfferId(strategy, offerId, category, offset, limit, order); if (!result.isOk()) { throw new StorageException( String.format("ERROR: VitamError has been returned when using storage service: {%s}", result.toString())); } return ((RequestResponseOK<OfferLog>) result).getResults(); } RestoreOfferBackupService(StorageDistribution distribution); List<OfferLog> getListing(String strategy, String offerId, DataCategory category, Long offset,
        int limit, Order order);  }