@Test public void storageInfos() throws Exception { final JsonNode expectedResult = JsonHandler.getFromString(StorageClientMock.MOCK_INFOS_RESULT_ARRAY); final StorageClient client = StorageClientFactory.getInstance().getClient(); assertNotNull(client); final JsonNode result = client.getStorageInformation("idStrategy"); assertEquals(result, expectedResult); }
@Override public JsonNode getStorageInformation(String strategyId) throws StorageServerClientException { Integer tenantId = 0; try { tenantId = ParameterHelper.getTenantParameter(); } catch (Exception e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } try { if (tenantId == -1) { return null; } else if (tenantId == -2) { return JsonHandler.getFromString(MOCK_INFOS_EMPTY_RESULT_ARRAY); } else { return JsonHandler.getFromString(MOCK_INFOS_RESULT_ARRAY); } } catch (final InvalidParseOperationException e) { throw new StorageServerClientException(e); } }
StorageClientMock extends AbstractMockClient implements StorageClient { @Override public JsonNode getStorageInformation(String strategyId) throws StorageServerClientException { Integer tenantId = 0; try { tenantId = ParameterHelper.getTenantParameter(); } catch (Exception e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } try { if (tenantId == -1) { return null; } else if (tenantId == -2) { return JsonHandler.getFromString(MOCK_INFOS_EMPTY_RESULT_ARRAY); } else { return JsonHandler.getFromString(MOCK_INFOS_RESULT_ARRAY); } } catch (final InvalidParseOperationException e) { throw new StorageServerClientException(e); } } }
StorageClientMock extends AbstractMockClient implements StorageClient { @Override public JsonNode getStorageInformation(String strategyId) throws StorageServerClientException { Integer tenantId = 0; try { tenantId = ParameterHelper.getTenantParameter(); } catch (Exception e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } try { if (tenantId == -1) { return null; } else if (tenantId == -2) { return JsonHandler.getFromString(MOCK_INFOS_EMPTY_RESULT_ARRAY); } else { return JsonHandler.getFromString(MOCK_INFOS_RESULT_ARRAY); } } catch (final InvalidParseOperationException e) { throw new StorageServerClientException(e); } }  }
StorageClientMock extends AbstractMockClient implements StorageClient { @Override public JsonNode getStorageInformation(String strategyId) throws StorageServerClientException { Integer tenantId = 0; try { tenantId = ParameterHelper.getTenantParameter(); } catch (Exception e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } try { if (tenantId == -1) { return null; } else if (tenantId == -2) { return JsonHandler.getFromString(MOCK_INFOS_EMPTY_RESULT_ARRAY); } else { return JsonHandler.getFromString(MOCK_INFOS_RESULT_ARRAY); } } catch (final InvalidParseOperationException e) { throw new StorageServerClientException(e); } }  @Override JsonNode getStorageInformation(String strategyId); @Override List<String> getOffers(String strategyId); @Override StoredInfoResult storeFileFromWorkspace(String strategyId, DataCategory type, String guid,
        ObjectDescription description); @Override boolean delete(String strategyId, DataCategory type, String guid); @Override boolean delete(String strategyId, DataCategory type, String guid, List<String> offerIds); @Override boolean existsContainer(String strategyId); @Override Map<String, Boolean> exists(String strategyId, DataCategory type, String guid, List<String> offerIds); @Override BulkObjectStoreResponse bulkStoreFilesFromWorkspace(String strategyId,
        BulkObjectStoreRequest bulkObjectStoreRequest); @Override Response getContainerAsync(String strategyId, String guid, DataCategory type, AccessLogInfoModel logInfo); @Override CloseableIterator<ObjectEntry> listContainer(String strategyId, DataCategory type); @Override RequestResponseOK storageAccessLogBackup(); @Override RequestResponseOK storageLogBackup(); @Override RequestResponseOK storageLogTraceability(); @Override JsonNode getInformation(String strategyId, DataCategory type, String guid, List<String> offerIds, boolean noCache); @Override RequestResponse<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, Collection<String> offerIds,
        Collection<String> objectIds); @Override RequestResponseOK copyObjectToOneOfferAnother(String objectId, DataCategory category, String source,
        String destination, String strategyId); @Override RequestResponseOK create(String strategyId, String objectId, DataCategory category, InputStream inputStream,
        Long inputStreamSize, List<String> offerIds); @Override RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory type, Long offset, int limit,
        Order order); @Override RequestResponse<StorageStrategy> getStorageStrategies(); }
StorageClientMock extends AbstractMockClient implements StorageClient { @Override public JsonNode getStorageInformation(String strategyId) throws StorageServerClientException { Integer tenantId = 0; try { tenantId = ParameterHelper.getTenantParameter(); } catch (Exception e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } try { if (tenantId == -1) { return null; } else if (tenantId == -2) { return JsonHandler.getFromString(MOCK_INFOS_EMPTY_RESULT_ARRAY); } else { return JsonHandler.getFromString(MOCK_INFOS_RESULT_ARRAY); } } catch (final InvalidParseOperationException e) { throw new StorageServerClientException(e); } }  @Override JsonNode getStorageInformation(String strategyId); @Override List<String> getOffers(String strategyId); @Override StoredInfoResult storeFileFromWorkspace(String strategyId, DataCategory type, String guid,
        ObjectDescription description); @Override boolean delete(String strategyId, DataCategory type, String guid); @Override boolean delete(String strategyId, DataCategory type, String guid, List<String> offerIds); @Override boolean existsContainer(String strategyId); @Override Map<String, Boolean> exists(String strategyId, DataCategory type, String guid, List<String> offerIds); @Override BulkObjectStoreResponse bulkStoreFilesFromWorkspace(String strategyId,
        BulkObjectStoreRequest bulkObjectStoreRequest); @Override Response getContainerAsync(String strategyId, String guid, DataCategory type, AccessLogInfoModel logInfo); @Override CloseableIterator<ObjectEntry> listContainer(String strategyId, DataCategory type); @Override RequestResponseOK storageAccessLogBackup(); @Override RequestResponseOK storageLogBackup(); @Override RequestResponseOK storageLogTraceability(); @Override JsonNode getInformation(String strategyId, DataCategory type, String guid, List<String> offerIds, boolean noCache); @Override RequestResponse<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, Collection<String> offerIds,
        Collection<String> objectIds); @Override RequestResponseOK copyObjectToOneOfferAnother(String objectId, DataCategory category, String source,
        String destination, String strategyId); @Override RequestResponseOK create(String strategyId, String objectId, DataCategory category, InputStream inputStream,
        Long inputStreamSize, List<String> offerIds); @Override RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory type, Long offset, int limit,
        Order order); @Override RequestResponse<StorageStrategy> getStorageStrategies();  }