@Test public void should_deleteObject() throws Exception { ArrayList<String> offers = new ArrayList<>(); offers.add("offer-fs-1.service.consul"); given(storageClient .getInformation(VitamConfiguration.getDefaultStrategy(), DataCategory.OBJECT, "aeeaaaaaacew2hcbaafoialcsdnwzyyaaaaq.json", offers, true)) .willReturn( JsonHandler.getFromString(information)); given(storageClient.getOffers(VitamConfiguration.getDefaultStrategy())).willReturn(offers); storageCRUDUtils = new StorageCRUDUtils(storageClient); boolean result = storageCRUDUtils.deleteFile(DataCategory.OBJECT, VitamConfiguration.getDefaultStrategy(), "aeeaaaaaacew2hcbaafoialcsdnwzyyaaaaq.json","offer-fs-1.service.consul"); assertThat(result).isFalse(); }
public boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId) throws StorageServerClientException { return storageClient.delete(strategyId, dataCategory, uid, Collections.singletonList(offerId)); }
StorageCRUDUtils { public boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId) throws StorageServerClientException { return storageClient.delete(strategyId, dataCategory, uid, Collections.singletonList(offerId)); } }
StorageCRUDUtils { public boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId) throws StorageServerClientException { return storageClient.delete(strategyId, dataCategory, uid, Collections.singletonList(offerId)); } StorageCRUDUtils(); @VisibleForTesting  StorageCRUDUtils(StorageClient storageClient); }
StorageCRUDUtils { public boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId) throws StorageServerClientException { return storageClient.delete(strategyId, dataCategory, uid, Collections.singletonList(offerId)); } StorageCRUDUtils(); @VisibleForTesting  StorageCRUDUtils(StorageClient storageClient); RequestResponse<StorageStrategy> getStrategies(); boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId); void storeInOffer(DataCategory dataCategory, String uid, String strategyId, String offerId, Long size, InputStream stream); }
StorageCRUDUtils { public boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId) throws StorageServerClientException { return storageClient.delete(strategyId, dataCategory, uid, Collections.singletonList(offerId)); } StorageCRUDUtils(); @VisibleForTesting  StorageCRUDUtils(StorageClient storageClient); RequestResponse<StorageStrategy> getStrategies(); boolean deleteFile(DataCategory dataCategory, String uid, String strategyId, String offerId); void storeInOffer(DataCategory dataCategory, String uid, String strategyId, String offerId, Long size, InputStream stream);  }