@RunWithCustomExecutor @Test public void should_throw_VitamRuntimeException_when_listing_and_storage_throws_StorageServerClientException() throws StorageException { when( distribution.getOfferLogsByOfferId(VitamConfiguration.getDefaultStrategy(), OFFER_ID, DataCategory.OBJECT, 10L, 1, Order.DESC)) .thenThrow(new StorageException("ERROR: Storage exception has been thrown.")); assertThatCode( () -> restoreOfferBackupService.getListing(VitamConfiguration.getDefaultStrategy(), OFFER_ID, DataCategory.OBJECT, 10L, 1, Order.DESC)) .isInstanceOf(StorageException.class); }
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);  }